no VNC - LXC connection Issues

VVitness

New Member
Feb 6, 2023
1
0
1
Hello everyone. I'm trying to connect via a websocket on LXC using the noVNC library, but the error "failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED" is constantly returned. I can already connect to QEMU in the same way by calling the /vncproxy command and then connecting using the vncwebsocket method. However, when trying to connect to LXC, the above error constantly occurs.

I can't figure out what exactly I'm doing wrong.

1. send request to https://[host_ip]:8006/api2/json/nodes/[node_name]/[lxc/qemu]/[vm_id]/vncproxy (everything is fine here, in response I get a port and a ticket)

2. I try to connect via websocket wss://[host_ip]:[received port]/api2/json/nodes/[node_name]/[lxc/qemu]/[vm_id]/vncwebsocket?port=[received port]&vncticket=[ ticket]` - and here I constantly get error 1005. Although, as I noticed on the host side, it shows how the connection itself didn’t exist and the socket was closed by timeout
 
Hi,
in step 2, you try to connect via websocket using this URL:
wss://[host_ip]:[received port]/api2/json/nodes/[node_name]/[lxc/qemu]/[vm_id]/vncwebsocket?port=[received port]&vncticket=[ ticket]`
Can you try wss://[host_ip]:8006/... instead? I think the port received in step 1 is only relevant for the port query string parameter, not for the websocket connection itself.