TurboVNC / turbovnc

Main TurboVNC repository
https://TurboVNC.org
GNU General Public License v2.0
746 stars 136 forks source link

I am trying to run TurboVNC in the following docker environment using this command. but i meet error #383

Closed sdk17586 closed 8 months ago

sdk17586 commented 8 months ago

I am trying to run TurboVNC in the following environment using this command:

docker run -it \ --privileged \ --gpus all \ --net=host \ -e NVIDIA_DRIVER_CAPABILITIES=all \ -e __GLX_VENDOR_LIBRARY_NAME=nvidia \ -e DISPLAY=:1 \ -e QT_X11_NO_MITSHM=1 \ -v /tmp/.X11-unix:/tmp/.X11-unix:rw \ -v /etc/localtime:/etc/localtime:ro \ -e TZ=Asia/Seoul \ -v /home/iocrops:/root/iocrops \ --name iocrops \ osrf/ros:melodic-desktop-full

However, the vncserver is not starting, and I get the following logs:

root@rdv-NUC11-greenhouse:~/.vnc# cat rdv-NUC11-greenhouse:1.log TurboVNC Server (Xvnc) 64-bit v3.0.3 (build 20230227) Copyright (C) 1999-2022 The VirtualGL Project and many others (see README.txt) Visit http://www.TurboVNC.org for more information on TurboVNC

19/10/2023 15:34:56 Using security configuration file /etc/turbovncserver-security.conf 19/10/2023 15:34:56 Enabled security type 'tlsvnc' 19/10/2023 15:34:56 Enabled security type 'tlsotp' 19/10/2023 15:34:56 Enabled security type 'tlsplain' 19/10/2023 15:34:56 Enabled security type 'x509vnc' 19/10/2023 15:34:56 Enabled security type 'x509otp' 19/10/2023 15:34:56 Enabled security type 'x509plain' 19/10/2023 15:34:56 Enabled security type 'vnc' 19/10/2023 15:34:56 Enabled security type 'otp' 19/10/2023 15:34:56 Enabled security type 'unixlogin' 19/10/2023 15:34:56 Enabled security type 'plain' 19/10/2023 15:34:56 Desktop name 'TurboVNC: rdv-NUC11-greenhouse:1 ()' (rdv-NUC11-greenhouse:1) 19/10/2023 15:34:56 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t 19/10/2023 15:34:56 Listening for VNC connections on TCP port 5901 19/10/2023 15:34:56 Interface 0.0.0.0 19/10/2023 15:34:56 Framebuffer: BGRX 8/8/8/8 19/10/2023 15:34:56 New desktop size: 1240 x 900 19/10/2023 15:34:56 New screen layout: 19/10/2023 15:34:56 0x00000040 (output 0x00000040): 1240x900+0+0 19/10/2023 15:34:56 Maximum clipboard transfer size: 1048576 bytes 19/10/2023 15:34:56 VNC extension running! xstartup.turbovnc: Creating new session bus instance: xstartup.turbovnc: unix:abstract=/tmp/dbus-nINOjmNxq6,guid=013f062838f859af2be65eb26530ce11 xstartup.turbovnc: Using 'ubuntu' window manager in xstartup.turbovnc: /usr/share/xsessions/ubuntu.desktop xstartup.turbovnc: Executing /etc/X11/Xsession "env GNOME_SHELL_SESSION_MODE=ubuntu gnome-session --session=ubuntu" Trace/breakpoint trap (core dumped) Killing Xvnc process ID 15959

My objective is to run TurboVNC in Docker container 'a' and to run a GUI in Docker container 'b', but I want the GUI's display output to show in the VNC session running in container 'a'. Is this possible?

dcommander commented 8 months ago

It should be possible. The basic strategy would be to share /tmp/.X11-unix with both containers so that X applications (X clients) running in the GUI container can display to the X server (TurboVNC session) running in the VNC container, then set DISPLAY in the GUI container to the appropriate display number for the TurboVNC session. You shouldn't need to set DISPLAY in the VNC container, as the /opt/TurboVNC/bin/vncserver script does that automatically.

The issue you are encountering above may be due to the lack of a window manager in the VNC container. The TurboVNC Server will try to use GNOME by default, but that will fail if GNOME isn't installed. If you want to use a more low-profile window manager, such as Xfce, then you need to install it in the container and specify the window manager either in the -wm argument to /opt/TurboVNC/bin/vncserver or in the $wm variable in turbovncserver.conf.

dcommander commented 8 months ago

Closing for now. If you have tried everything above and the issue is unresolved, then feel free to comment regarding your additional findings.