The scripts in this gist will start an Xvnc server with a basic window manager (IceWM). This is intended to use in a virtual machine, where we can need to start a browser to run a test suite.
All commands have to be run as root
apt-get install icewm vnc4server
wget -O /etc/init.d/xvnc https://gist.github.com/albertohm/7310483/raw/5342e9e1705041939aa3e3e417de09c3d16131b1/xvnc.sh
wget -O /etc/init.d/icewm https://gist.github.com/albertohm/7310483/raw/b6ab30fb47dfdd5d4eccd64c540f1424db13b8d7/icewm.sh
chmod +x /etc/init.d/xvnc /etc/init.d/icewm
update-rc.d xvnc defaults
update-rc.d icewm defaults
Then, in your user, type
echo 'export DISPLAY=:0' >> ~/.bashrc