Skip to content

Ubuntu Server Desktop with XFCE and VNC

Feodor Fitsner edited this page Jan 21, 2026 · 1 revision

🖥️ Ubuntu Server Desktop with XFCE + VNC (Cloud-Friendly Guide)

This guide shows how to install a lightweight desktop environment (XFCE) on Ubuntu Server and access it securely via TigerVNC, optimized for cloud VMs (GCP, AWS, etc).


Why XFCE + VNC?

✔ Lightweight (perfect for cloud VMs)
✔ Stable & simple
✔ No GNOME/Chrome Remote Desktop issues
✔ Works great over SSH tunnels
✔ Low RAM/CPU usage


1. Install XFCE Desktop

sudo apt update
sudo apt install -y xfce4 xfce4-goodies

2. Install TigerVNC Server

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

3. Set VNC Password

Run as your normal user:

vncpasswd

This is the password used when connecting via VNC.


4. Configure VNC to Start XFCE

mkdir -p ~/.vnc
nano ~/.vnc/xstartup

Paste:

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS

xrdb $HOME/.Xresources 2>/dev/null
xsetroot -solid grey

exec startxfce4

Then:

chmod +x ~/.vnc/xstartup

5. Start VNC Server

vncserver -localhost

6. Configure SSH Keys for Secure Access

Generate a new SSH key (on your local machine)

ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -C "yourname@cloud"

Press Enter to accept defaults.

Copy your public key to the server

If you can already SSH:

ssh-copy-id -i ~/.ssh/id_ed25519.pub youruser@your_vm_ip

Or manually add:

cat ~/.ssh/id_ed25519.pub

Paste into server:

nano ~/.ssh/authorized_keys

Ensure permissions:

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

7. Connect Securely via SSH Tunnel

On your local machine:

ssh -i ~/.ssh/id_ed25519 -N -L 5901:localhost:5901 youruser@your_vm_ip

Then connect VNC client to:

localhost:5901

8. Stop / Restart VNC

vncserver -kill :1
vncserver -localhost

Optional: Auto-start VNC on Boot

mkdir -p ~/.config/systemd/user
nano ~/.config/systemd/user/vnc.service
[Unit]
Description=TigerVNC Server

[Service]
Type=forking
ExecStart=/usr/bin/vncserver -localhost
ExecStop=/usr/bin/vncserver -kill :1
Restart=always
RestartSec=5

[Install]
WantedBy=default.target

Enable:

systemctl --user enable vnc
systemctl --user start vnc
sudo loginctl enable-linger $USER

Client Downloads


Summary

Best cloud desktop combo:

Ubuntu Server + XFCE + TigerVNC + SSH Tunnel