proxmox vncwebsocket

liuzezhong

New Member
May 18, 2018
1
0
1
29
I had some problems with proxmox.

Please help me.

I tried to connect to VNC using the proxmox API (local, not using the console in the proxmox web panel) through noVNC.

I send POST requests to/api2 / json/nodes / {node} / qemu / {vmid} / vncproxy to get vncticket and port.
Then, I pass the vncticket and give the port GET/api2 / json/nodes / {node} / qemu / {vmid} / vncwebsocketbut instead of websocket, which always returns null. {" data ": null}.

And the HTTP status is the 401 permissions denied - invalid PVEVNC ticket.

I can't find any mistakes.

I follow the steps above and use the root account.

Proxmox 5.1

upload_2018-5-18_23-18-5.png
 
Last edited:
I was trying the same and notice that vncticket have to be url encoded to work properly.

In my case, i receive HTTP 101 response, which is correct, but noVNC asks me for authentication. I'm trying to figure out which password is it.
All the help is welcome.
Mozilla Firefox_192.png
Mozilla Firefox_195.png
 
I had some problems with proxmox.

Please help me.

I tried to connect to VNC using the proxmox API (local, not using the console in the proxmox web panel) through noVNC.

I send POST requests to/api2 / json/nodes / {node} / qemu / {vmid} / vncproxy to get vncticket and port.
Then, I pass the vncticket and give the port GET/api2 / json/nodes / {node} / qemu / {vmid} / vncwebsocketbut instead of websocket, which always returns null. {" data ": null}.

And the HTTP status is the 401 permissions denied - invalid PVEVNC ticket.

I can't find any mistakes.

I follow the steps above and use the root account.

Proxmox 5.1

View attachment 7466
We have the same problem. How did you resolve it?
 
I

I am also using a react js framework
I worked with Angular, and my TypeScript code is structured like this:
JavaScript:
const encodedTicket = encodeURIComponent(ticket);
const websocketUrl = `wss://pve-node-ip:8006/api2/json/nodes/${node}/qemu/${vmid}/vncwebsocket?port=${port}&vncticket=${encodedTicket}`;

If you want to embed it using an iframe, you can also use the following approach:

JavaScript:
const iframe = document.getElementById('vncFrame') as HTMLIFrameElement;
const consoleUrl = `https://pve-node-ip:8006/?console=kvm&novnc=1&vmid=${vmid}&vmname=${vmName}&node=${node}&resize=scale&cmd=`;
 
Last edited:
const websocketUrl = `wss://pve-node-ip:8006/api2/json/nodes/${node}/qemu/${vmid}/vncwebsocket?port=${port}&vncticket=${encodedTicket}`;
This is correct., you might facing 401 status due to this above websocket request need Cookie in request header., As I making websocket request from javascript in my code., there I am not able to put/send Cookies for websocket request.,Below is correct websocket request URL with pasrams.,

Can Anyone please help me to send Cookie to websocket request or Can we bypass this Cookie authentication for websocket request


wss://192.168.12.16:8006/api2/json/nodes/pve/qemu/203/vncwebsocket?port=5900&vncticket=PVEVNC%3A67E3A6B3%3A%3AHCiuQL79jpVQj6evN4DOLtZVr0jw6B%2B2wC3URJcrAdynwRNHRitwiIL%2Fl1RYqCb8gM4vhhj8oxs%2BZA1jhsciNUPtit7mOGYhG0nVW8rREkQyLSr9%2B1Y57KPBlaBNp9m%2F%2FhUXM9LgPhMTEnKfk7Cro416Ext7tWul51Asadt8O7VhiCDkE1%2B%2BnMuYdLcCC7EzT7oNCrJN7DWrKgLC1tDp%2F2Ec7JHs3hoQS%2BZVqW4bPgOof5zP01JsTpYd4PyODT%2FqVK6PCUST7yV8Vyc1nJiG152V%2FVBEM%2FtR2mlViKGPwiY4oK8tiMk%2FfO4CI4Ga7tTRc74d6I5ohwRr4HOYsq8Rmg%3D%3D