How to Install and Troubleshoot TigerVNC on Ubuntu 24.04.1

Last Updated on August 21, 2025 by Freddy Reyes

Running a graphical desktop remotely with VNC is a common need for sysadmins, developers, and tinkerers. On Ubuntu 24.04.1, TigerVNC is a solid choice — but the setup can be tricky.
This guide walks you through installation, configuration, and troubleshooting until you finally see your desktop over VNC.

Step 1: Install TigerVNC

sudo apt update
sudo apt install tigervnc-standalone-server tigervnc-common tigervnc-viewer -y

Then set your VNC password:

vncpasswd


Step 2: First Start

vncserver :1 -geometry 1280×800 -depth 24

Expected output:

New Xtigervnc server ‘hostname:1 (user)’ on port 5901 for display :1.

If you see an error like:

Session startup via ‘/home/username/.vnc/xstartup’ cleanly exited too early (< 3 seconds)!

That means you need to configure a desktop environment.


Step 3: Configure the Desktop Environment

Option A: XFCE (lightweight & reliable)

sudo apt install xfce4 xfce4-terminal -y

Edit the startup script:

nano ~/.vnc/xstartup

Replace with:

#!/bin/sh
xrdb $HOME/.Xresources
startxfce4 &

Make it executable:

chmod +x ~/.vnc/xstartup


Option B: GNOME (Ubuntu default)

Ubuntu uses Wayland by default, which won’t run inside VNC.
Instead, install and use GNOME Flashback (X11-based):

sudo apt install gnome-session gnome-terminal gnome-panel gnome-flashback -y

Edit ~/.vnc/xstartup:

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
unset WAYLAND_DISPLAY
export XDG_SESSION_TYPE=x11
export GNOME_SHELL_SESSION_MODE=classic

xrdb $HOME/.Xresources
exec gnome-session –session=gnome-flashback-metacity

Make it executable:

chmod +x ~/.vnc/xstartup


Step 4: Restart VNC Server

Kill any running server and restart:

vncserver -kill :1
vncserver :1 -geometry 1280×800 -depth 24

Check if it’s running:

ss -ltnp | grep 5901

If nothing shows, inspect the log:

cat ~/.vnc/hostname:1.log


Step 5: Connect with a Viewer

From your client machine:
• Direct: connect to server-ip:5901
• Secure (recommended): create an SSH tunnel:

ssh -L 5901:localhost:5901 user@server-ip

Then connect your VNC viewer to localhost:5901.


Step 6: Troubleshooting
• Xstartup exits too early → Fix ~/.vnc/xstartup
• No process on port 5901 → The server isn’t running; check logs
• libEGL warning: failed to open /dev/dri/card1 → Harmless
• Keyboard warnings (xkbcomp) → Not fatal
• GNOME crashes → Use gnome-flashback (X11)

Final Notes
a• XFCE is stable and lightweight for VNC
• GNOME works too, but only with X11 (Flashback)
• Logs live in ~/.vnc — always check them if something fails

Once set up, TigerVNC gives you a stable remote desktop experience on Ubuntu 24.04.1.