-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VNC Trough the API #17
Comments
I'm sorry, I'm just seeing this! 😩 . A guy have contacted me with the same exact problem, did you manage to solve it? it was a problem with the library or with the API consumption? I honestly should say I did never test the vnc via api, so I couldn't help. If you could share your findings would be helpful for others having the same issue. |
Hi there, Could not solve the problem :(. |
You haven't closed your src="" the last " |
This code would work, be aware that you have to change the default variables.
|
Thanks! So the generated URL just needs to be in an iframe and that's it, right? I'll add this to the Readme before closing the issue. 👍 |
That's true, I'd have to test it further and then I'll give you a final response. |
Kudos hehe! |
Hi @YWatchman I tried it just like you mentioned it above, but unfortunately it didn't work. I get a 401 No ticket error. How did you get it working? Isn't it mandatory to use cookies for this? |
Haven't had any time looking at it further, I'll note it in my calendar for this sunday. |
Hi @YWatchman, i have the same 401 no ticket error. |
Didn't make any progress. It seems like you will need to create your own VNC client or use the vnc sdk. |
Problem can be solved by adding modifications to HTTPServer.pm file under /usr/share/perl5/PVE/ |
Hi @JustAMoose, exactly which modifications need to be added? |
@zzantares if ($require_auth) { - die "No ticket\n" if !$ticket; - - ($username, $age) = PVE::AccessControl::verify_ticket($ticket); - - $rpcenv->set_user($username); + if ($rel_uri =~ /vncwebsocket/ && $method eq 'GET' && !$ticket) + { + $rpcenv->set_user("vnc\@pve"); + $username = "vnc\@pve"; + $age = 60; + } else { + die "No ticket\n" if !$ticket; + ($username, $age) = PVE::AccessControl::verify_ticket($ticket); + $rpcenv->set_user($username); + } if ($method eq 'POST' && $rel_uri =~ m|^/nodes/([^/]+)/storage/([^/]+)/upload$|) { my ($node, $storeid) = ($1, $2); |
How do I need to add the user |
Did anyone figure out a way to make this work without having to patch PVE? |
Yes. I found a way to cheat it with cookies. |
Thank you very much for your quick reply! Works great. Thank you! |
|
The post above fully describes how to access the console. |
There is a mistake in your solution. You do not need to call vncproxy or vncticket. If you set cookie for user, it will be able to open your proxmox from frame url and get access not only for a console. So, you need to restrict all except vnc access at the point of user creation:
|
I finally won and connected to noVNC from remote host! 100% worked solution:
|
401 No ticket i need help :( |
You can see my solution – https://github.com/dagababaev/ProxmoxVE_API_php |
not working :/ |
not working and all… :) need more information Eventually you can delete all code and add this for check what PVE is return:
If in response you can't see ticket – check if all parameters you pass are correct. |
My last message correct if you use this API. |
Maybe this article will help you. You can enable "ip:port" access, install noVNC on a separate host, and pass "ip: port" & pass to novnc. Use official docs: https://pve.proxmox.com/wiki/VNC_Client_Access |
Hey there! Can someone elaborate on how you'd circumvent the cookie requirement? I'm under the impression that you can call vncproxy and make it return a password to be used in place of the cookie? https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/vncproxy The issue with using a cookie, that I can see, is that even if you create a user with only the VNC role, you're still giving whoever's on the other end of the console a cookie which they can use to view other users' VNC terminals, correct? |
Have you found a solution for this? |
So for anyone here setting PVEAuth Cookies: Don't. This is acceptable for internal development stuff, but don't give that access outside of your infrastructure ever.
From what I know, even if you have a very strict setup for the user you use to create vnc-connections with, the user will have access to all vncs and (worse) can change his own password, so the account can be hijacked quite easily. There is the https://github.com/novnc/websockify project. which works as a proxy server between the client and the Proxmox Node. You can use a token-provider like redis to generate tokens in the backend and open a connection between the client and the proxy-server. The connection is then between the proxy and the node itself. This way you don't need credentials (and no weird cookies) and you can have your proxmox server fully isolated, only allowing managment-access and access from the proxy server. AFAIK there is no direct tutorial anywhere on how to implement this correctly, but I've implemented it in my product so I'll leave the documentation link here in case that's helpful: https://docs-next.bennetg.de/products/proxmox-cp/configuration/vnc-terminal Maintainers: if this link is not okay here, just remove please. |
Hi there,
Thanks for developing this nice API wrapper! I'm very pleased with this!
I want to show the VNC client out of the Proxmox environment but get a 401 No Ticket and I don't really see what i'm doing wrong around here.
Would you mind to take a look at my code?
Thanks in advance!
Cheers,
Ramon
The text was updated successfully, but these errors were encountered: