remoting into headless ubuntu box

Yeah, I know, back to basics with Ubuntu. This took me longer than it ever should have, so I’m just posting my travails here. I wanted to make my Ubuntu server essentially headless where I don’t have a keyboard, mouse, or monitor hooked up to it. Obviously this means remote desktop capabilities.

Sadly, the obvious and most often-used tools to accomplish this either require me to remote logon with my Ubuntu laptop (yuck!) or require a session to already be logged on the server locally (yuck!). Well, I want to be able to remote in, even at the logon window after a reboot! Here are my steps.

sudo apt-get x11vnc vnc-common
sudo x11vnc -storepassword password /etc/x11vnc.pass
sudo gedit /etc/X11/gdm/Init/Default
add this at the bottom just above exit 0:
/usr/bin/x11vnc -rfbauth /etc/x11vnc.pass -o /tmp/x11vnc.log -forever -bg -rfbport 5900
sudo gedit /etc/X11/gdm/gdm.conf
change #KillInitClients=true to KillInitClients=false

I’ll probably end up changing this all up once I decide to wrap this inside SSH, but since this will always be local (unless I VPN in remotely), I’m not as concerned about this setup. I might just tunnel it through SSH just to make sure I can do so with this setup.

3 thoughts on “remoting into headless ubuntu box

  1. Here is how you do it.
    Stop remote connections (systems->administration->remote desktop (uncheck)
    install vnc4server
    run vnc4server (add password)
    reboot your box
    ssh to your box
    start vnc4server (port is most likely 5902 but check the log)
    vnc to that box with the port number found, enter password
    Wow you have a ugly grey screen… welcome 🙂
    OK now type “gnome-session &” redirect output to dev/null if you want
    guess what you have it running now.
    email if this works for you. This worked on ubuntu gutsy running gnome.

  2. /etc/X11/gdm does not exist on xubuntu! Where would I find the Init/Default file for a xubuntu installation (Intrepid Ibex)?

Comments are closed.