-
Notifications
You must be signed in to change notification settings - Fork 653
Ubuntu Server Desktop with XFCE and VNC
Feodor Fitsner edited this page Jan 21, 2026
·
1 revision
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).
✔ Lightweight (perfect for cloud VMs)
✔ Stable & simple
✔ No GNOME/Chrome Remote Desktop issues
✔ Works great over SSH tunnels
✔ Low RAM/CPU usage
sudo apt update
sudo apt install -y xfce4 xfce4-goodiessudo apt install -y tigervnc-standalone-server tigervnc-commonRun as your normal user:
vncpasswdThis is the password used when connecting via VNC.
mkdir -p ~/.vnc
nano ~/.vnc/xstartupPaste:
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
xrdb $HOME/.Xresources 2>/dev/null
xsetroot -solid grey
exec startxfce4Then:
chmod +x ~/.vnc/xstartupvncserver -localhostssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -C "yourname@cloud"Press Enter to accept defaults.
If you can already SSH:
ssh-copy-id -i ~/.ssh/id_ed25519.pub youruser@your_vm_ipOr manually add:
cat ~/.ssh/id_ed25519.pubPaste into server:
nano ~/.ssh/authorized_keysEnsure permissions:
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keysOn your local machine:
ssh -i ~/.ssh/id_ed25519 -N -L 5901:localhost:5901 youruser@your_vm_ipThen connect VNC client to:
localhost:5901
vncserver -kill :1
vncserver -localhostmkdir -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.targetEnable:
systemctl --user enable vnc
systemctl --user start vnc
sudo loginctl enable-linger $USER- TigerVNC Viewer: https://tigervnc.org/
- RealVNC Viewer: https://www.realvnc.com/en/connect/download/viewer/
Best cloud desktop combo:
Ubuntu Server + XFCE + TigerVNC + SSH Tunnel