VNC access with LXC VMs

Hello,

I’m running some tests with a LXC node and I’m getting some problems when I try to connect to the LXC container using VNC (default connection). Connection can’t be establised (“client error”) and /var/log/one/fireedge-error shows this log:

[2025-01-22 ene 2025 13:35:14] [Connection 2] Closing connection with error: Error: not opened
at WebSocket.send (/usr/lib/one/fireedge/node_modules/opennebula-guacamole/node_modules/ws/lib/WebSocket.js:218:38)
at ClientConnection.send (/usr/lib/one/fireedge/node_modules/opennebula-guacamole/lib/ClientConnection.js:126:24)
at GuacdClient.sendBufferToWebSocket (/usr/lib/one/fireedge/node_modules/opennebula-guacamole/lib/GuacdClient.js:172:35)
at GuacdClient.processReceivedData (/usr/lib/one/fireedge/node_modules/opennebula-guacamole/lib/GuacdClient.js:163:14)
at Socket.emit (events.js:314:20)
at Socket.EventEmitter.emit (domain.js:483:12)
at addChunk (_stream_readable.js:297:12)
at readableAddChunk (_stream_readable.js:272:9)
at Socket.Readable.push (_stream_readable.js:213:10)
at TCP.onStreamRead (internal/stream_base_commons.js:188:23)

Where is the problem? KVM nodes run perfectly and their VNC/GUAC connection runs, also, perfectly.

Thanks.

Check if the svncterm (VNC server) corresponding to the LXC instance is running on the LXC node.

root@ubuntu2404-lxc-marketplace-6-10-1bd1-0:~# ss -antlp | grep svnc
LISTEN 0      5            0.0.0.0:5903       0.0.0.0:*    users:(("svncterm_server",pid=72080,fd=5))
LISTEN 0      5            0.0.0.0:5902       0.0.0.0:*    users:(("svncterm_server",pid=72080,fd=4))

There should be a pid bound to the port defined on the GRAPHICS section of your VM instance template.

Hi @dclavijo,

Yes, my LXC instance is running in my LXC node and svcntermn is running too:

root@lxc-host:/var/log# ss -antlp | grep svnc
LISTEN 0      5            0.0.0.0:5904      0.0.0.0:*    users:(("svncterm_server",pid=2470,fd=4))

Process tree in “lxc-host” is:

root        2403  0.4  0.0   3516  1704 ?        Ss   11:17   0:01 bindfs --uid-offset=600100001 --gid-offset=600100001 -o suid /var/lib/one/datastores/0/4/ma
root        2413  0.0  0.0   3372   268 ?        Ss   11:17   0:00 bindfs --uid-offset=600090132 --gid-offset=600090132 -o suid /var/lib/one/datastores/0/4/ma
root        2425  0.0  0.1   4844  2864 ?        Ss   11:17   0:00 [lxc monitor] /var/lib/lxc one-4
6001000+    2426  0.1  0.2 249320  5328 ?        Ss   11:17   0:00  \_ /sbin/init
6001000+    2493  0.0  0.2  32992  4736 ?        Ss   11:17   0:00      \_ /lib/systemd/systemd-journald
6001001+    2533  0.0  0.0   9136  1056 ?        Ss   11:18   0:00      \_ /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-act
6001000+    3092  0.0  0.0   2936    92 pts/0    Ss+  11:18   0:00      \_ /sbin/agetty -o -p -- \u --noclear --keep-baud - 115200,38400,9600 vt220
6001000+    3093  0.0  0.0   2936    84 ?        Ss+  11:18   0:00      \_ /sbin/agetty -o -p -- \u --noclear - vt220
6001000+    3094  0.0  0.0   2936    92 ?        Ss+  11:18   0:00      \_ /sbin/agetty -o -p -- \u --noclear - vt220
6001000+    3095  0.0  0.0   2936    84 ?        Ss+  11:18   0:00      \_ /sbin/agetty -o -p -- \u --noclear - vt220
6001000+    3096  0.0  0.0   2936    88 ?        Ss+  11:18   0:00      \_ /sbin/agetty -o -p -- \u --noclear - vt220
6001000+    3097  0.0  0.1  15436  2064 ?        Ss   11:18   0:00      \_ sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
oneadmin    2470  0.0  0.0  11840  1752 ?        Ss   11:17   0:00 svncterm_server -w 800 -h 600 -t 300
oneadmin    3298  0.2  2.1 1113536 42364 ?       Ssl  11:21   0:00 ruby /var/tmp/one/im/lxc.d/monitord-client.rb lxc 3 lxc-host

This errors occurs after upgrading OpenNebula from 6.8.0-1 to 6.10. Before upgrade, in 6.8.0-1, I have been able to connect via VNC to my LXC instances and, also, to my KVM instances, but after upgrade, I can only connect to KVM instances.

Could be a problem in upgrade process?

Thanks.

Could be a problem in upgrade process?

When issuing the upgrade, only the VNC client used be fireedge changes. The VNC server on the LXC instance is unaffected. Check if you can connect using an external VNC client like TigerVNC.

Hi, @dclavijo

I’m running a new test with a “fresh” installation of 6.10 and one LXC node. Before configuration of this LXC node, I have trying to download a “LinuxContainer” debian bullseye image… but process never ends. I have read Single Front-end Installation — OpenNebula 6.10.2 documentation and LXC Node Deployment — OpenNebula 6.10.2 documentation but it seems there is a problem.

Process tree:

oneadmin    2118  0.0  0.1   8164  3360 ?        SN   14:15   0:00  |   \_ /bin/bash /var/lib/one/remotes/datastore/fs/cp 4
oneadmin    2169  0.0  0.0   8164  1804 ?        SN   14:15   0:00  |       \_ /bin/bash /var/lib/one/remotes/datastore/fs/cp 4
oneadmin    2170  0.0  0.1   4368  2032 ?        SN   14:15   0:00  |           \_ bash -s
oneadmin    2171  0.0  0.1   4896  2672 ?        SN   14:15   0:00  |               \_ /bin/bash /var/lib/one/remotes/datastore/fs/../downloader.sh lxd://https://images.linuxcontainers.org/images/debian/bul
oneadmin    2192  0.0  0.0   4896  1400 ?        SN   14:15   0:00  |                   \_ /bin/bash /var/lib/one/remotes/datastore/fs/../downloader.sh lxd://https://images.linuxcontainers.org/images/debian
oneadmin    2195  0.0  0.1   4764  2464 ?        SN   14:15   0:00  |                   |   \_ /bin/bash /var/lib/one/remotes/datastore/lxd_downloader.sh lxd://https://images.linuxcontainers.org/images/debi
root        2275  0.0  0.2   8500  5096 ?        SN   14:15   0:00  |                   |       \_ sudo -n /usr/lib/one/sh/create_container_image.sh /var/tmp 40cc8a8a-db56-4e2f-8da5-ed3e6c101b15 tar.xz /bin
root        2276  0.0  0.1   4364  2732 ?        SN   14:15   0:00  |                   |           \_ /bin/bash /usr/lib/one/sh/create_container_image.sh /var/tmp 40cc8a8a-db56-4e2f-8da5-ed3e6c101b15 tar.x
root        2297  0.0  0.0   2480   516 ?        SN   14:15   0:00  |                   |               \_ /bin/sh
root        2301  0.1  0.3  12848  7624 ?        SN   14:15   0:00  |                   |                   \_ apt-get update
_apt        2304  0.0  0.4  18452  9204 ?        SN   14:15   0:00  |                   |                       \_ /usr/lib/apt/methods/http
oneadmin    2193  0.0  0.0   2800  1036 ?        SN   14:15   0:00  |                   \_ tee /dev/fd/63
oneadmin    2196  0.0  0.0   4896  1528 ?        SN   14:15   0:00  |                   |   \_ /bin/bash /var/lib/one/remotes/datastore/fs/../downloader.sh lxd://https://images.linuxcontainers.org/images/de
oneadmin    2198  0.0  0.0   2936  1060 ?        SN   14:15   0:00  |                   |       \_ cat
oneadmin    2194  0.0  0.0   4896  1380 ?        SN   14:15   0:00  |                   \_ /bin/bash /var/lib/one/remotes/datastore/fs/../downloader.sh lxd://https://images.linuxcontainers.org/images/debian
oneadmin    2197  0.0  0.0   2936  1056 ?        SN   14:15   0:00  |                       \_ cat

and no continues… I have been waiting 10 minutes or more and all process tree is always the same.

It is a new fresh installation of 6.10 in Ubuntu Server 22.04.

Thanks.

We’ve had problems with debian images and LXC before. Could you please try an ubuntu2204 image instead ?

Hello,

I have found the problem: my company rejects outgoing DNS queries to 8.8.8.8 and because of LXC container is configured with that DNS server, “apt update” or “dnf install” hangs some minutes trying to do the DNS resolution. Solution has been apply two lines in my “iptables” to redirect queries to port 53 to DNS server in my company.

Solved :wink: