TurboVNC / turbovnc

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

Launching vncserver #335

Closed chekhovana closed 2 years ago

chekhovana commented 2 years ago

I've installed turbovnc on remote server (ubuntu 18.04), and I am trying to launch it. vncserver command issues the following output:

Desktop 'TurboVNC: ip-1234:1 (ubuntu)' started on display ip-1-2-3-4:1

Starting applications specified in /opt/TurboVNC/bin/xstartup.turbovnc
Log file is /home/ubuntu/.vnc/ip-1-2-3-4:1.log

But then I can't see that any process is listening on 59XX port (sudo netstat -tulpn | grep 59 output is empty)

Is it ok? If not, then what might be the problem? Log file contains the following:

TurboVNC Server (Xvnc) 64-bit v3.0 (build 20220503)
Copyright (C) 1999-2022 The VirtualGL Project and many others (see README.txt)
Visit http://www.TurboVNC.org for more information on TurboVNC
15/06/2022 08:34:48 Using security configuration file /etc/turbovncserver-security.conf
15/06/2022 08:34:48 Enabled security type 'tlsvnc'
15/06/2022 08:34:48 Enabled security type 'tlsotp'
15/06/2022 08:34:48 Enabled security type 'tlsplain'
15/06/2022 08:34:48 Enabled security type 'x509vnc'
15/06/2022 08:34:48 Enabled security type 'x509otp'
15/06/2022 08:34:48 Enabled security type 'x509plain'
15/06/2022 08:34:48 Enabled security type 'vnc'
15/06/2022 08:34:48 Enabled security type 'otp'
15/06/2022 08:34:48 Enabled security type 'unixlogin'
15/06/2022 08:34:48 Enabled security type 'plain'
15/06/2022 08:34:48 Desktop name 'TurboVNC: ip-1-2-3-4:1 (ubuntu)' (ip-1-2-3-4:1)
15/06/2022 08:34:48 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
15/06/2022 08:34:48 Listening for VNC connections on TCP port 5901
15/06/2022 08:34:48   Interface 0.0.0.0
15/06/2022 08:34:48 Framebuffer: BGRX 8/8/8/8
15/06/2022 08:34:48 New desktop size: 1240 x 900
15/06/2022 08:34:48 New screen layout:
15/06/2022 08:34:48   0x00000040 (output 0x00000040): 1240x900+0+0
15/06/2022 08:34:48 Maximum clipboard transfer size: 1048576 bytes
15/06/2022 08:34:48 VNC extension running!
Unable to create /home/ubuntu/.dbus/session-bus
xstartup.turbovnc: Creating new session bus instance:
xstartup.turbovnc:   unix:abstract=/tmp/dbus-sr7D2ZiI9E,guid=a9b4455cc8cd8fc5d10ed64562a999a9
xstartup.turbovnc: Executing /etc/X11/xinit/xinitrc
Killing Xvnc process ID 14962
chekhovana commented 2 years ago

The problem was solved by adding -noxstartup option:

vncserver -noxstartup

dcommander commented 2 years ago

That doesn't really solve the problem, though. It just works around it. The crux of the issue seems to be that your system doesn't have the GNOME window manager installed and you haven't specified an alternative window manager using the -wm argument to /opt/TurboVNC/bin/vncserver or the $wm config file variable. /opt/TurboVNC/bin/xstartup.turbovnc will launch GNOME by default if GNOME exists. Otherwise, you have to specify a window manager. (Note that the window manager name should correspond to a .desktop file under /usr/share/xsessions. For instance, if /usr/share/xsessions/xfce.desktop exists, then you can specify /opt/TurboVNC/bin/vncserver -wm xfce or $wm = xfce; in /etc/turbovncserver.conf or ~/.vnc/turbovncserver.conf.) If no window manager is specified and GNOME doesn't exist, then /opt/TurboVNC/bin/xstartup.turbovnc falls back to executing /etc/X11/xinit/xinitrc, which will probably try (and fail on your system) to launch GNOME as well. (Falling back to /etc/X11/xinit/xinitrc is legacy behavior that will probably go away in the next major TurboVNC release.)

chekhovana commented 2 years ago

@dcommander Thanks for the answer. Could you please clarify: the window manager you are talking about should be installed on the remote server? My server is headless, and it doesn't have /usr/share/xsessions folder at all.

I supposed that window manager is needed on my local machine (MacOS + XQuartz as X server), which will be used to render GUI generated by remote app (headless ubuntu + vncserver).

Is my understanding wrong?

dcommander commented 2 years ago

Your understanding is incorrect. The TurboVNC Server is a virtual X server, so it requires a window manager on the remote machine, even though the remote machine is headless. (Strictly speaking, a window manager is not required if you intend only to run a single full-screen application in the TurboVNC Server session, but if you want to use the TurboVNC Server as a remote desktop environment, then a window manager is required.) The window manager will render into the virtual X server (the TurboVNC Server), and the TurboVNC Server will compress and send those images to the TurboVNC Viewer, which should be installed on your client. An X server is not needed on the client machine. For the remote window manager, I recommend Xfce or MATE. (Refer to https://turbovnc.org/Documentation/Compatibility30 for a list of window managers that have been tested with TurboVNC on various operating systems.)

chekhovana commented 2 years ago

@dcommander I don't want to use TurboVNC Server as a remote desktop environment. All I need is to run OpenGL app (https://github.com/NVlabs/instant-ngp) remotely using VirtualGL. I am not sure whether to classify this app as a full-screen or not. Do I have to install window manager to achieve this?

dcommander commented 2 years ago

You don't need TurboVNC, then. Follow the instructions in the VirtualGL User's Guide for using VirtualGL with the VGL Transport. (This does require an X server on the client machine.)

chekhovana commented 2 years ago

It turns out that I do have TurboVNC, because XQuartz as the Xserver on MacOS limits OpenGL version to 1.4 which is not acceptable in my case. At the moment I am able to launch glxsphere64, but my app exits with error. I opened separate issue for this error.

dcommander commented 2 years ago

When using VirtualGL, all OpenGL rendering occurs on the server side, so the client-side OpenGL version is not relevant.