5

I am trying to setup a headless firefox browser for my Ubuntu Server. I followed instructions on other posts but nothing seems to be working. I get this error when trying to startup firefox.

~(branch:master*) » firefox                                                                                                                                                                     jake@ubuntu
Error: no display specified
------------------------------------------------------------
~(branch:master*) » phpunit functional/SiteTest.php                                                                                                                                             jake@ubuntu
------------------------------------------------------------
~(branch:master*) » export DISPLAY=:10                                                                                                                                                          jake@ubuntu
------------------------------------------------------------
~(branch:master*) » firefox                                                                                                                                                                     jake@ubuntu
Error: cannot open display: :10

I am thinking it must be something with the display driver.

These are the instructions I am following.

http://www.installationpage.com/selenium/how-to-run-selenium-headless-firefox-in-ubuntu/

Let me know if you need more details.

jmarkmurphy
  • 11,030
  • 31
  • 59
Jacob Waller
  • 4,119
  • 3
  • 26
  • 32

2 Answers2

1

Install xvfb package:

sudo apt-get install xvfb

Then run firefox like this:

xvfb-run firefox
warvariuc
  • 57,116
  • 41
  • 173
  • 227
0

on a fresh Ubuntu 16.04.1, I installed firefox. This did not work with

Couldn't open libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory

I installdfed xvfb

sudo apt-get install xvfb

and started firefox

firefox

This worked. Be aware to ssh login with -X

ssh -X user@your_headless_box

and have something on your host that can display X applications. On Windows that would probably be Xming, on Mac XQuartz

Matthias Bloch
  • 303
  • 3
  • 6