VNC server stopped working after Ubuntu 22 -> 24 upgrade

I upgraded from Ubutuntu 22.04.5 to 24.04.1, on x64 .

My VNC server, using tightvncserver-standalone, was previously working fine.

After the upgrade, I’m facing two problems :

  1. when started through systemd, there is a hang after the vnc server starts, even though the daemon is up
  2. while I’m able to connect to the server with RealVNC client on Windows, very soon after, sometimes mere seconds, the connection is dropped, making the VNC server unusable. A new connection attempt results in a new desktop, ie. the previous X session is lost. I believe I’m running into a crash.

The system had Wayland disabled prior to the upgrade, and still does.
Also, note that this is a standalone server on X session :2 , running xfce4, while the X server on the local console / GPU is using Gnome.

Here are the relevant config files, as they were working under Ubuntu 22.

systemd unit :


[Unit]
Description=Tiger VNC server
After=syslog.target network.target

[Service]
Type=forking
User=madbrain
PIDFile=/home/madbrain/.vnc/%H:590%i.pid
ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1
ExecStart=/usr/bin/vncserver -geometry 3840x2160 -localhost no :%i
ExecStop=/usr/bin/vncserver -kill :%i

[Install]
WantedBy=multi-user.target

~/.vnc/xstartup :

#!/bin/sh
# Start up the standard system desktop
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
xhost +
/usr/bin/startxfce4
#/usr/bin/gnome-session
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
x-window-manager &

packages :

  1. VNC
tigervnc-common/noble,now 1.13.1+dfsg-2build2 amd64 [installed,automatic]
tigervnc-standalone-server/noble,now 1.13.1+dfsg-2build2 amd64 [installed]
tigervnc-tools/noble,now 1.13.1+dfsg-2build2 amd64 [installed,automatic]
  1. xfce4

gir1.2-libxfce4util-1.0/noble,now 4.18.1-2build3 amd64 [installed,automatic]
libxfce4panel-2.0-4/noble,now 4.18.4-1build2 amd64 [installed,automatic]
libxfce4ui-2-0/noble,now 4.18.4-1build4 amd64 [installed,automatic]
libxfce4ui-common/noble,noble,now 4.18.4-1build4 all [installed,automatic]
libxfce4ui-utils/noble,now 4.18.4-1build4 amd64 [installed,automatic]
libxfce4util-bin/noble,now 4.18.1-2build3 amd64 [installed,automatic]
libxfce4util-common/noble,noble,now 4.18.1-2build3 all [installed,automatic]
libxfce4util7/noble,now 4.18.1-2build3 amd64 [installed,automatic]
xfce4-appfinder/noble,now 4.18.0-1build2 amd64 [installed,automatic]
xfce4-helpers/noble,now 4.18.4-0ubuntu3 amd64 [installed,automatic]
xfce4-notifyd/noble,now 0.9.4-1 amd64 [installed,automatic]
xfce4-panel/noble,now 4.18.4-1build2 amd64 [installed,automatic]
xfce4-pulseaudio-plugin/noble,now 0.4.8-1build2 amd64 [installed,automatic]
xfce4-screensaver/noble,now 4.18.3-1build1 amd64 [installed,automatic]
xfce4-session/noble,now 4.18.3-1build2 amd64 [installed,automatic]
xfce4-settings/noble,now 4.18.4-0ubuntu3 amd64 [installed,automatic]
xfce4/noble,noble,now 4.18 all [installed]

Does anyone know what I need to do to get it working ?

And is there another recommended remote access protocol I can use from a Windows client ?

Edit : I gave gnome-remote-desktop a try . It works, for some definition of the word - better than VNC does on 24.04, anyway.

There are numerous issues with gnome-remote-desktop, though, the most serious being that the entire X session is torn down when the Windows RDP client disconnects. The other is that performance at 4K/60 is abysmal, even on my 10 Gbps LAN, to the point that the program is not usable.

Anybody ? I’m thinking of rolling back to 22.04 if I can’t resolve this.

I reverted to Ubuntu 22.04 on my production system as I couldn’t live without proper remote access GUI, and I didn’t find any usable option in 24.04 .

I setup a Virtualbox VM so that if a solution exists, I will be able to test it before attempting to move to 24.04 again.

While, GNOME 46 (used in Ubuntu 24.04) introduced headless remote login sessions, persistent remote login sessions (being able to reconnect to a headless session, where the an RDP client disconnect from previously) needed a few more parts, which did not make it in time for GNOME 46. So, persistent remote login sessions are upstream-wise available with GNOME 47 or later. The change needed for that breaks API, thus in GNOME upstream, it cannot be backported to GNOME 46.
Theoretically, Ubuntu could backport the required patches, if they want to. This was also asked multiple times (e.g. here Bug #2072130 “RDP doesn't keep sessions alive in Ubuntu 24.04 af...” : Bugs : gnome-remote-desktop package : Ubuntu). But that’s up to the Ubuntu Desktop Team.

You can also try Ubuntu 24.10, which should contain GNOME 47, where persistent headless sessions are possible.

Regardless of the remote desktop solution, 4K is an extremely demanding resolution. For proper performance, hardware acceleration is needed. By default, on Debian- Ubuntu-based distros, hardware acceleration in headless sessions is disabled. Partial hardware acceleration can be enabled, if the affected user is added to the render group, but this has to be done manually by the user (on Debian/Ubuntu), e.g. via gpasswd.

A discussion with @jbicha and @3v1n0 was started a few months ago in the g-r-d issue tracker in order to find solution for the lack of hardware acceleration on Debian/Ubuntu, but due to lack of input from the Ubuntu side, it became stalled. @jbicha and @3v1n0, it would be great if we could revive that discussion there btw.

Thanks for the background on the issue with RDP on Linux not keeping sessions alive.

RDP works fine at 4K resolution between all my wired Windows hosts. Obviously, this is the native protocol for Windows, so this is not surprising. I have one Windows host behind a Unifi Wifi bridge, and there is some lag when using RDP, but it is still usable.

I have been using 4K resolution with VNC since at least 2018 . It has always worked OK, using the iGPU on my Z170-AR motherboard and i5-6600k CPU. No performance issue. I just want to be able to continue to use it under Ubuntu 24. While I have had a 10 Gbps LAN for that long also, I think it would likely work just fine on 1 Gbps LAN also, which would be easy to verify by forcing the NIC down to 1 Gbps temporarily.

I experimented with Ubuntu 24 under Virtualbox 7.1.4 on a Windows host, but was not able to get it to work properly. It always ends up corrupting itself in some way. The VM extensions seem to not work properly. I never got far enough that I could setup VNC to test it again. I may try again under VMWare instead.

It doesn’t matter how fast the GPU or ethernet connection is, when the bottleneck is at a different position. Debian and Ubuntu disable hardware acceleration in headless sessions here. It doesn’t matter how fast the GPU is, when it cannot be used. The DRM render node is here not available, meaning no application (that includes GNOME Remote Desktop and GNOME Shell here) in the headless session is able to use the GPU.

See also Bug #2077538 “gnome-remote-desktop uses software rendering” : Bugs : gnome-remote-desktop package : Ubuntu here.

Fedora and Arch are not affected by this issue here.

RDP works fine at 4K resolution between all my wired Windows hosts.

That is a complete different situation. Microsoft has lots of people working on the RDP parts, as part of their work time, and their solution exists for some decades already. GNOME Remote Desktop, the RDP server here, only has 1 person, that is doing that in their free time.