VNC not working

Hi folks!
I am trying to use VNC with my board but I get a connection refused.
I am trying to connect to my board using VNC Viewer and TightVNC Viewer, both in Windows 10. and I am behind a proxy.
A few months ago I was able to use VNC with the same setup. I don’t know if I am missing something.

I am working with:

  • Colibri imx8qxp 2gb.
  • Custom carrier board.
  • OS: Windows 10 and WSL.

Linux version on my board:

$ cat /proc/version
Linux version 5.4.193-5.7.2+git.b60d3160fd04 (oe-user@oe-host) (gcc version 9.5.0 (GCC)) #1-TorizonCore SMP PREEMPT Fri Dec 23 15:47:24 UTC 2022

My “weston.ini” file:

[core]
idle-time=0
require-input=false
xwayland=true
modules=screen-share.so

[shell]
background-image=
background-color=0x00000000
panel-position=none
locking=false
allow-zap=false
num-workspaces=1

[keyboard]
vt-switching=false

[input-method]
#Ponemos un path incorrecto para que no cargue el teclado.
path=/usr/lib/wrong-path/weston-keyboard

[output]
name=DPI-1
transform=rotate-270

I create the environtment variable “ENABLE_VNC” inside the weston service in docker-compose.yml.
I verify that it is created using the command “printenv” in the weston container:

printenv

HOSTNAME=colibri-imx8x-07329488
PWD=/home/torizon
HOME=/root
WAYLAND_DISPLAY=wayland-0
TERM=xterm
DISPLAY=:0
SHLVL=1
XDG_RUNTIME_DIR=/tmp/1000-runtime-dir
LC_ALL=C.UTF-8
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENABLE_VNC=1
WAYLAND_USER=torizon
ACCEPT_FSL_EULA=1
_=/usr/bin/printenv

The “weston-info” command show me:

weston-info

*** Please use wayland-info instead
*** weston-info is deprecated and will be removed in a future version

interface: ‘wl_compositor’, version: 4, name: 1
interface: ‘wl_subcompositor’, version: 1, name: 2
interface: ‘wp_viewporter’, version: 1, name: 3
interface: ‘zxdg_output_manager_v1’, version: 2, name: 4
xdg_output_v1
output: 20
name: ‘DPI-1’
logical_x: 0, logical_y: 0
logical_width: 768, logical_height: 1024
interface: ‘wp_presentation’, version: 1, name: 5
presentation clock id: 1 (CLOCK_MONOTONIC)
interface: ‘zwp_alpha_compositing_v1’, version: 1, name: 6
interface: ‘zwp_relative_pointer_manager_v1’, version: 1, name: 7
interface: ‘zwp_pointer_constraints_v1’, version: 1, name: 8
interface: ‘zwp_input_timestamps_manager_v1’, version: 1, name: 9
interface: ‘wl_data_device_manager’, version: 3, name: 10
interface: ‘wl_shm’, version: 1, name: 11
formats: ‘YUYV’(0x56595559) ‘NV12’(0x3231564e) ‘YU12’(0x32315559) RGB565 XRGB8888 ARGB8888
interface: ‘wl_viv’, version: 1, name: 12
interface: ‘wl_drm’, version: 2, name: 13
interface: ‘wl_seat’, version: 7, name: 14
name: default
capabilities: keyboard touch
keyboard repeat rate: 40
keyboard repeat delay: 400
interface: ‘zwp_linux_dmabuf_v1’, version: 3, name: 15
formats:
‘NV21’(0x3132564e), modifier: 0x0000000000000000
‘NV21’(0x3132564e), modifier: 0xf000000000000001
‘NV12’(0x3231564e), modifier: 0x0000000000000000
‘NV12’(0x3231564e), modifier: 0xf000000000000001
‘UYVY’(0x59565955), modifier: 0x0000000000000000
‘YUYV’(0x56595559), modifier: 0x0000000000000000
‘RG16’(0x36314752), modifier: 0x0000000000000000
‘RG16’(0x36314752), modifier: 0x0600000000000002
‘RG16’(0x36314752), modifier: 0x0600000000000001
‘BX24’(0x34325842), modifier: 0x0000000000000000
‘BX24’(0x34325842), modifier: 0x0600000000000002
‘BX24’(0x34325842), modifier: 0x0600000000000001
‘BA24’(0x34324142), modifier: 0x0000000000000000
‘BA24’(0x34324142), modifier: 0x0600000000000002
‘BA24’(0x34324142), modifier: 0x0600000000000001
‘RX24’(0x34325852), modifier: 0x0000000000000000
‘RX24’(0x34325852), modifier: 0x0600000000000002
‘RX24’(0x34325852), modifier: 0x0600000000000001
‘RA24’(0x34324152), modifier: 0x0000000000000000
‘RA24’(0x34324152), modifier: 0x0600000000000002
‘RA24’(0x34324152), modifier: 0x0600000000000001
‘XB24’(0x34324258), modifier: 0x0000000000000000
‘XB24’(0x34324258), modifier: 0x0600000000000002
‘XB24’(0x34324258), modifier: 0x0600000000000001
‘AB24’(0x34324241), modifier: 0x0000000000000000
‘AB24’(0x34324241), modifier: 0x0600000000000002
‘AB24’(0x34324241), modifier: 0x0600000000000001
‘XR24’(0x34325258), modifier: 0x0000000000000000
‘XR24’(0x34325258), modifier: 0x0600000000000002
‘XR24’(0x34325258), modifier: 0x0600000000000001
‘AR24’(0x34325241), modifier: 0x0000000000000000
‘AR24’(0x34325241), modifier: 0x0600000000000002
‘AR24’(0x34325241), modifier: 0x0600000000000001
‘LA88’(0x3838414c), modifier: 0x0600000000000004
‘LA88’(0x3838414c), modifier: 0x0000000000000000
'L8 '(0x2020384c), modifier: 0x0600000000000004
'L8 '(0x2020384c), modifier: 0x0000000000000000
‘YV12’(0x32315659), modifier: 0x0000000000000000
‘YU12’(0x32315559), modifier: 0x0000000000000000
‘NV61’(0x3136564e), modifier: 0x0000000000000000
‘NV16’(0x3631564e), modifier: 0x0000000000000000
‘NV21’(0x3132564e), modifier: 0x0000000000000000
‘NV12’(0x3231564e), modifier: 0x0000000000000000
‘AYUV’(0x56555941), modifier: 0x0000000000000000
‘VYUY’(0x59555956), modifier: 0x0000000000000000
‘UYVY’(0x59565955), modifier: 0x0000000000000000
‘YVYU’(0x55595659), modifier: 0x0000000000000000
‘YUYV’(0x56595559), modifier: 0x0000000000000000
‘BA24’(0x34324142), modifier: 0x0600000000000004
‘BA24’(0x34324142), modifier: 0x0000000000000000
‘RA24’(0x34324152), modifier: 0x0600000000000004
‘RA24’(0x34324152), modifier: 0x0000000000000000
‘AB24’(0x34324241), modifier: 0x0600000000000004
‘AB24’(0x34324241), modifier: 0x0000000000000000
‘AR24’(0x34325241), modifier: 0x0600000000000004
‘AR24’(0x34325241), modifier: 0x0000000000000000
‘BX24’(0x34325842), modifier: 0x0600000000000004
‘BX24’(0x34325842), modifier: 0x0000000000000000
‘RX24’(0x34325852), modifier: 0x0600000000000004
‘RX24’(0x34325852), modifier: 0x0000000000000000
‘XB24’(0x34324258), modifier: 0x0600000000000004
‘XB24’(0x34324258), modifier: 0x0000000000000000
‘XR24’(0x34325258), modifier: 0x0600000000000004
‘XR24’(0x34325258), modifier: 0x0000000000000000
‘BG16’(0x36314742), modifier: 0x0600000000000004
‘BG16’(0x36314742), modifier: 0x0000000000000000
‘RG16’(0x36314752), modifier: 0x0600000000000004
‘RG16’(0x36314752), modifier: 0x0000000000000000
‘AB15’(0x35314241), modifier: 0x0600000000000004
‘AB15’(0x35314241), modifier: 0x0000000000000000
‘AR15’(0x35315241), modifier: 0x0600000000000004
‘AR15’(0x35315241), modifier: 0x0000000000000000
‘XB15’(0x35314258), modifier: 0x0600000000000004
‘XB15’(0x35314258), modifier: 0x0000000000000000
‘XR15’(0x35315258), modifier: 0x0600000000000004
‘XR15’(0x35315258), modifier: 0x0000000000000000
‘AB12’(0x32314241), modifier: 0x0600000000000004
‘AB12’(0x32314241), modifier: 0x0000000000000000
‘AR12’(0x32315241), modifier: 0x0600000000000004
‘AR12’(0x32315241), modifier: 0x0000000000000000
‘XB12’(0x32314258), modifier: 0x0600000000000004
‘XB12’(0x32314258), modifier: 0x0000000000000000
‘XR12’(0x32315258), modifier: 0x0600000000000004
‘XR12’(0x32315258), modifier: 0x0000000000000000
‘GR88’(0x38385247), modifier: 0x0600000000000004
‘GR88’(0x38385247), modifier: 0x0000000000000000
'R8 '(0x20203852), modifier: 0x0600000000000004
'R8 '(0x20203852), modifier: 0x0000000000000000
interface: ‘weston_direct_display_v1’, version: 1, name: 16
interface: ‘zwp_linux_explicit_synchronization_v1’, version: 2, name: 17
interface: ‘weston_content_protection’, version: 1, name: 18
interface: ‘zwp_hdr10_metadata_v1’, version: 1, name: 19
interface: ‘wl_output’, version: 3, name: 20
x: 0, y: 0, scale: 1,
physical_width: 211 mm, physical_height: 158 mm,
make: ‘unknown’, model: ‘unknown’,
subpixel_orientation: unknown, output_transform: 270°,
mode:
width: 1024 px, height: 768 px, refresh: 60.004 Hz,
flags: current preferred
interface: ‘zwp_input_panel_v1’, version: 1, name: 21
interface: ‘zwp_input_method_v1’, version: 1, name: 22
interface: ‘zwp_text_input_manager_v1’, version: 1, name: 23
interface: ‘xdg_wm_base’, version: 1, name: 24
interface: ‘zxdg_shell_v6’, version: 1, name: 25
interface: ‘wl_shell’, version: 1, name: 26
interface: ‘weston_desktop_shell’, version: 1, name: 27
interface: ‘weston_screenshooter’, version: 1, name: 28

What can I do to fix this?

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Based on the context provided, here are some steps you can take to troubleshoot and potentially resolve the VNC connection issue:

  1. Verify VNC Server Status: Ensure that the VNC server is actively running on your Colibri iMX8QXP board. You can check the service status and logs for any errors that might indicate why the connection is refused.

  2. Check ENABLE_VNC Configuration: You’ve mentioned that the ENABLE_VNC environment variable is set to 1, which is correct. Double-check that this variable is correctly set in your docker-compose.yml and that the Weston service is restarted after any changes.

  3. Review weston.ini Configuration: Your weston.ini file includes the necessary modules=screen-share.so line, which is required for VNC functionality. Ensure there are no typos or misconfigurations in this file.

  4. Network and Proxy Settings: Since you are behind a proxy, verify that your proxy settings allow VNC traffic. Proxies can block certain ports or protocols, which may lead to connection issues. You may need to configure your VNC viewer to work with the proxy settings.

  5. Firewall Settings: Check the firewall settings on both your Windows 10 machine and the Colibri board to ensure that VNC traffic is allowed. The default VNC port is usually 5900, and it should be open for incoming connections.

  6. Port Accessibility: Use commands like netstat on your Colibri board to check if the VNC server is listening on the expected port (usually 5900). This will help confirm that the server is set up correctly to accept connections.

  7. Review Recent Changes: Since you were able to connect previously, consider any recent changes to your network configuration, firewall settings, or updates to the VNC software that may have affected connectivity.

  8. Check Logs: Review the logs of the VNC server or the Weston service for any error messages that could provide more insight into why the connection is being refused.

By following these steps, you should be able to identify and resolve the issue preventing your VNC connection. If the problem persists, consider reaching out for further assistance with specific error messages or configurations.

Please, also check if these links can help you solve your problem:

Easyinstaller VNC connection refused.

Greetings @jeremias23x,

Do you have any kind of display output hooked up to your hardware? The way VNC works in Weston is that it needs to actually be displaying to some kind of output for VNC to work.

I just checked this myself. If I don’t have say an HDMI screen attached to my hardware when Weston is running, and I attempt to connect via TightVNC Viewer I get a connection refused. If I restart the Weston container with an HDMI screen attached, and try again this time the VNC connection works.

Best Regards,
Jeremias

Hi @jeremias.tx , I have a display connected to the board.

Running this command inside the weston container:

# ls /sys/class/drm -l
total 0
lrwxrwxrwx 1 root root    0 Nov  4 07:08 card0 -> ../../devices/platform/display-subsystem/drm/card0
lrwxrwxrwx 1 root root    0 Nov  4 07:08 card0-DPI-1 -> ../../devices/platform/display-subsystem/drm/card0/card0-DPI-1
lrwxrwxrwx 1 root root    0 Nov  4 07:09 card1 -> ../../devices/platform/bus@53100000/80000000.imx8_gpu0_ss/drm/card1
lrwxrwxrwx 1 root root    0 Nov  4 07:08 renderD128 -> ../../devices/platform/display-subsystem/drm/renderD128
lrwxrwxrwx 1 root root    0 Nov  4 07:09 renderD129 -> ../../devices/platform/bus@53100000/80000000.imx8_gpu0_ss/drm/renderD129
-r--r--r-- 1 root root 4096 Nov  4 07:08 version

When I run the Qt application in my board, I can see it in the display and interact with it normally.

Greetings

I have a display connected to the board.

Okay, then that’s not it. Could you share this docker-compose.yml you’re using to start the containers?

Maybe it has to do with how you’re starting the Weston container. At least for me if I use the command as documented in this article: Remote Access the TorizonCore GUI Using VNC or RDP | Toradex Developer Center

Then VNC works for me just fine.

Best Regards,
Jeremias

Hi!

Our docker-compose is the following:

version: "3.9"
services:
  qt-debug:
    image: ${LOCAL_REGISTRY}:5002/qt-debug:${TAG}
    ports:
      - 2232:2232
      - 2233:2233
      - 2234:2234
    volumes:
      - type: bind
        source: /tmp
        target: /tmp
      - type: bind
        source: /dev
        target: /dev
    device_cgroup_rules:
      - c 4:* rmw
      - c 13:* rmw
      - c 199:* rmw
      - c 226:* rmw
    devices:
      - /dev/snd
      - /dev/gpiochip3 
    depends_on:
      - weston
  
  qt:
    image: ${DOCKER_LOGIN}/qt:${TAG}
    volumes:
      - type: bind
        source: /tmp
        target: /tmp
      - type: bind
        source: /dev
        target: /dev
    device_cgroup_rules:
      - c 4:* rmw
      - c 13:* rmw
      - c 199:* rmw
      - c 226:* rmw
    devices:
      - /dev/snd
    depends_on:
      - weston
  
  weston:
    image: torizon/weston${GPU}:2
    environment:
      - ACCEPT_FSL_EULA=1
      - ENABLE_VNC=1
    network_mode: host
    volumes:
      - type: bind
        source: /tmp/weston.ini
        target: /etc/xdg/weston/weston.ini
      - type: bind
        source: /tmp
        target: /tmp
      - type: bind
        source: /dev
        target: /dev
      - type: bind
        source: /run/udev
        target: /run/udev
    cap_add:
      - CAP_SYS_TTY_CONFIG
    device_cgroup_rules:
      - c 4:* rmw
      - c 13:* rmw
      - c 199:* rmw
      - c 226:* rmw
  
  csharp-debug:
    image: ${LOCAL_REGISTRY}:5002/csharp-debug:${TAG}
    network_mode: host
    cap_add:
      - NET_ADMIN
    volumes:
      - /home/torizon/.sensor:/root/.sensor
      - /sys/class/backlight/backlight:/sys/class/backlight/backlight
      - /tmp:/tmp
    devices:
      - /dev/gpiochip3:/dev/gpiochip3
      - /dev/gpiochip10:/dev/gpiochip10
      - /dev/colibri-uartb:/dev/colibri-uartb
  
  csharp:
    image: ${DOCKER_LOGIN}/csharp:${TAG}

We also created a task in “task.json” for copy the weston config file. We added the following:

{ 
            "label": "copy-weston.ini",
            "detail": "",
            "hide": true,
            "command": "sshpass",
            "type": "process",
            "args": [
                "-p",
                "${config:torizon_psswd}",
                "scp",
                "-o",
                "UserKnownHostsFile=/dev/null",
                "-o",
                "StrictHostKeyChecking=no",
                "weston.ini",
                "torizon@${config:torizon_ip}:/tmp/"
            ],
            "dependsOrder": "sequence",
            "problemMatcher": "$msCompile",
            "icon": {
                "id": "layers",
                "color": "terminal.ansiCyan"
            }
        },

This task is done before “copy-docker-compose”.

I don’t remember if I mentioned it, but we are using the Torizon IDE extension 2.4.2.

Greetings

Alright I took the compose file you provided and stripped out everything not related to Weston since those other containers should not matter for VNC. I ended up with this:

version: "3.9"
services:
  weston:
    image: torizon/weston-vivante:2
    environment:
      - ACCEPT_FSL_EULA=1
      - ENABLE_VNC=1
    network_mode: host
    volumes:
      - type: bind
        source: /tmp/weston.ini
        target: /etc/xdg/weston/weston.ini
      - type: bind
        source: /tmp
        target: /tmp
      - type: bind
        source: /dev
        target: /dev
      - type: bind
        source: /run/udev
        target: /run/udev
    cap_add:
      - CAP_SYS_TTY_CONFIG
    device_cgroup_rules:
      - c 4:* rmw
      - c 13:* rmw
      - c 199:* rmw
      - c 226:* rmw

I also copied the exact weston.ini you provided at the start. If I run docker-compose up -d on this and attempt to connect via TightVNC Viewer, then it works as expected. If you try just this minimal compose file with only Weston, are you still not able to connect with VNC?

If you’re still having issues could you maybe share the docker logs from the running Weston container. This would be my next thing to check, though at this point I’m curious why this is all just working on my setup, but not yours. You said this worked before, are you sure nothing about your setup has changed since then?

Best Regards,
Jeremias

Hi!

Still not working :frowning:

This is the output of the docker logs command from the weston container:
docker-log-weston.txt (33.5 KB)

I’m starting to think that a change was made to the network (firewall for example) and that’s why it’s failing now. Here we are behind a proxy. I will do a few more test.

Greetings

Still not working

You tried the Weston container on it’s own like I did and still nothing?

This is the output of the docker logs command from the weston container:

Your logs look similar to mine, I can see the VNC components being initialized properly. I don’t see anything obviously wrong in the logs.

I’m starting to think that a change was made to the network (firewall for example) and that’s why it’s failing now.

I’m starting to have a similar suspicion. At this point, as far as I can tell we’re doing the same thing and running the same container in the same way. We should have the same result, unless there are external factors like you suggested.

Please do let me know if you find out anything new on your end. For me at least it seems like VNC works as expected.

Best Regards,
Jeremias