virtualizationpaasopenvzproxmoxnovnc

proxmox CT external vnc access


I'm creating a PAAS provider with openVZ virtual machines on proxmox. I want to use noVNC to access the instances in another website different than proxmox console. I used an url with this form

wss://promox_ip:8006/api2/json/nodes/node_name/openvz/instance_id/vncwebsocket?port=5900&vncticket=vnc_ticket

I'm always getting this error:`

connection closed unexpectedly.

` note that i use a new ticket each connection.


Solution

  • Finally solved by adding modifications to HTTPerver.pm file under

    /usr/share/perl5/PVE/

    to Allow accessing novnc console when not logged in. Then send POST resquest to

    /api2/json/nodes/{node}/lxc/{vmid}/vncproxy

    and get ticket and port. Then you can connect via websocket to this link

    /api2/json/nodes/{node}/lxc/{vmid}/vncwebsocket