I recently needed to run an application that was GUI only on a remote, headless server. After I messed with X-Forwarding for long enough to get really frustrated (which wasn’t long) I figured out how to get a desktop running running that I could log into and run the app.
sudo apt-get install tightvncserver xfce4 xfce4-goodies
This will install a lot of dependencies (~750) so be prepared for a few extra packages to get installed!
Next, this file,
~/.vnc/xstartup, needs the following contents:
#!/bin/bash xrdb $HOME/.Xresources startxfce4 &
Then, start the VNC server:
Supply the login password when prompted and you’re all ready to log in.
I’ve had a lot of luck with the Remmina remote desktop client. Install it on your local system, choose VNC as the protocol and then set IP:5901 as the server to log into.