Overview
I have installed Ubuntu 24.04.1 LTS on a laptop in order to start doing some self-hosting. I immediately installed ‘ubuntu-gnome-desktop’ so there would be GUI, and I am attempting to VNC into it. However, I am having all kinds of issues, from X server errors to weird permissions stuff.
The machine from which I am able to successfully SSH via terminal into the Ubuntu server and from which I am attempting to VNC into the server is running Debian GNU/Linux 11 (bullseye).
Steps I Have Tried
I did a fresh install of the server software, and I set everything up according to the following article: https://www.cyberciti.biz/faq/install-and-configure-tigervnc-server-on-ubuntu-18-04.
Possible GDM Issue
Following the above article, I was able to install ‘ubuntu-gnome-desktop’. However (and this may be inconsequential), the ‘sudo systemctl enable gdm’ command returns an error:
The unit files have no installation config (WantedBy=, RequiredBy=, UpheldBy=, Also=, or Alias= settings in the [Install] section, and DefaultInstance= for template units). This means they are not meant to be enabled or disabled using systemctl.
Possible reasons for having these kinds of units are:
• A unit may be statically enabled by being symlinked from another unit’s .wants/, .requires/, or .upholds/ directory.
• A unit’s purpose may be to act as a helper for some other unit which has a requirement dependency on it.
• A unit may be started when needed via activation (socket, path, timer, D-Bus, udev, scripted systemctl call, …).
• In case of template units, the unit is meant to be enabled with some instance name specified.
With ‘sudo systemctl start gdm’, it returns no error and no output. It seems to start the ‘gdm’ service. Using ‘sudo systemctl status gdm’, I confirm that the ‘gdm’ service is ‘active’; however (and this may be inconsequential), there are a few errors in the ouput:
● gdm.service - GNOME Display Manager
Loaded: loaded (/usr/lib/systemd/system/gdm.service; static)
Active: active (running) since Thu 2025-01-09 00:49:49 UTC; 14min ago
Main PID: 2108 (gdm3)
Tasks: 4 (limit: 9074)
Memory: 6.1M (peak: 8.3M)
CPU: 318ms
CGroup: /system.slice/gdm.service
└─2108 /usr/sbin/gdm3Jan 09 00:49:49 overtime systemd[1]: Starting gdm.service - GNOME Display Manag>
Jan 09 00:49:49 overtime systemd[1]: Started gdm.service - GNOME Display Manage>
Jan 09 00:49:49 overtime gdm-launch-environment][2114]: pam_unix(gdm-launch-env>
Jan 09 00:53:21 overtime gdm-password][2626]: gkr-pam: unable to locate daemon >
Jan 09 00:53:21 overtime gdm-password][2626]: gkr-pam: stashed password to try >
Jan 09 00:53:22 overtime gdm-password][2626]: pam_unix(gdm-password:session): s>
Jan 09 00:53:32 overtime gdm3[2108]: Gdm: Child process -2143 was already dead.
Setting Up VNC
I have installed the following packages on the Ubuntu server: ‘tigervnc-standalone-server tigervnc-xorg-extension tigervnc-viewer’. I set a VNC password and created a file at ‘~/.vnc/xstartup’ per the instructions.
Running the VNC Server as Non-Root
When I run ‘vncserver :1’ I receive the following output:
A X11 server is already running for display :1 on machine overtime.
However, ‘vncserver -list’ executed as both root and non-root show no sessions. Both ‘vncserver -kill :1’ run as both root and non-root returns the following:
vncserver: No matching VNC server running for this user!
Executing ‘vncserver :2’ results in the following:
New Xtigervnc server ‘[server name]:2 ([username])’ on port 5902 for display :2.
Use xtigervncviewer -SecurityTypes VncAuth -passwd /tmp/tigervnc.GgsVre/passwd :2 to connect to the VNC server.=== tail /home/[username]/.vnc/[server name]:2.log ===
Session startup via ‘/home/[username]/.vnc/xstartup’ cleanly exited too early (< 3 seconds)!
Maybe try something simple first, e.g.,
tigervncserver -xstartup /usr/bin/xterm
The X session cleanly exited!
Killing Xtigervnc process ID 4474… success!
At this point, the ‘vncserver’ command has a weird habit of getting hung up. I will type ‘vncserver’ or ‘sudo vncserver’, and the terminal cursor will just blink at me indefinitely, and no output will ever be given. Strangely, if I run ‘vncserver -list’ I get an output, and then ‘vncserver’ produces an output again.
Running the VNC Server as Root
To test whether I could get the connection established at all, I ran ‘sudo vncserver :2’, which was ostensibly successful:
New Xtigervnc server ‘[server name]:2 (root)’ on port 5902 for display :2.
Use xtigervncviewer -SecurityTypes VncAuth -passwd /tmp/tigervnc.etwb9n/passwd :2 to connect to the VNC server.
An active session shows is listed for port 5902 when I run ‘sudo vncserver -list’.
On my Debian machine, I open Remmina Remote Desktop Client (because it allows connections over SSH easily). However entering [server IP]:5902 results in an error: ‘Unable to connect to VNC server’.
Following the above-linked article, I set up an SSH tunnel by running: ‘ssh [username]@[server IP] -L 5902:127.0.0.1:5902’, which succeeds. I have opened a new SSH tunnel to the Ubuntu server, and I am able to interact with it via the terminal of my Debian machine.
At this point, I try enter the following into Remmina: ‘127.0.0.1:5902’. Remmina then asks me for the VNC password. I enter the password I established earlier in the process, and the VNC server accepts it. However, at this point, I receive an error screen that is depicted below:
It reads: “Oh no! Something has gone wrong. A problem has occurred and the system can’t recover. All extensions have been disabled as a precaution.”
The only option I’m given is to log out. When i do so, the VNC server terminates. I can get it up and running again as root, but the outcome is always the same.
Possibly Irrelevant Side Note
Before the latest reinstall, which is described in the post’s body, I was able to VNC in successfully over SSH as root, but it was booting with a Debian desktop rather than Ubuntu. I chocked this up to the fact that I had installed so many desktops via ‘tasksel’ (which I did not use at all in the post above). I reinstalled to blank the slate and just work with ‘ubuntu-gnome-desktop’. However, I suspect that the VNC server is having trouble loading up the Ubuntu desktop… Maybe related to running the vnc as root?
Thanks for Your Time
Any help is appreciated!