Running Selenium Headless
First, install Xvfb:
$ sudo apt-get install xvfb xfonts-100dpi xfonts-75dpi xfonts-cyrillic xorg dbus-x11
Run Xvfb on this display, with access control off1:
# Xvfb :99 -ac
Now you need to ensure that your display is set to 99 before running the Selenium server (which itself launches the browser).
$ export DISPLAY=:99
$ firefox