Not able to run firefox in a head-less Ubuntu server 9.10

5,524

Solution 1

You may try my way of starting up selenium and Xvfb. I create a bash script and save it as selenium.sh


#!/bin/sh

Xvfb :0 -screen 0 1024x768x24 2>&1 >/dev/null &
export DISPLAY=:0
java -jar /opt/selenium/selenium-server-1.0.3/selenium-server.jar -log /tmp/selenium.log

Then I run it the way I normal run bash scripts

$ sh selenium.sh

By the way, don't forget to include firefox on your PATH variable

Solution 2

I've resolved the problem. Apparently all the warnings and errors that Xvfb was throwing doesn't seem to have any importance.

I'd configured wrong the selenium tests launch process and the socket timeout came from that problem.

Now all it's running properly.

Thanks to every body for trying.

Share:
5,524

Related videos on Youtube

Julio J.
Author by

Julio J.

Love working in Agile teams. Experience setting up continuous integration environments for testing and deploy. Knowledge in TDD, pair programming and other Extreme Programming techniques.

Updated on September 17, 2022

Comments

  • Julio J.
    Julio J. over 1 year

    I need to run Firefox in my server in order to execute some Selenium tests from Hudson. I would love no to have to install a complete gui. So I installed Xvfb in order to fake the Gui (I understand it this way correct me if my assumptions are wrong).

    After some time trying to make it work, I'm stuck with the next situation:

    $ sudo Xvfb -ac :99 &
    [dix] Could not init font path element /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType, removing from list!
    (EE) config/hal: NewInputDeviceRequest failed (2)
    (EE) config/hal: NewInputDeviceRequest failed (2)
    (EE) config/hal: NewInputDeviceRequest failed (2)
    (EE) config/hal: NewInputDeviceRequest failed (2)
    (EE) config/hal: NewInputDeviceRequest failed (2)
    
    $ firefox
    [dix] Could not init font path element /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType, removing from list!
    [config/dbus] couldn't register object path
    (EE) config/hal: NewInputDeviceRequest failed (2)
    (EE) config/hal: NewInputDeviceRequest failed (2)
    (EE) config/hal: NewInputDeviceRequest failed (2)
    (EE) config/hal: NewInputDeviceRequest failed (2)
    (EE) config/hal: NewInputDeviceRequest failed (2)
    Xlib:  extension "RANDR" missing on display ":99.0".
    GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: /bin/dbus-launch terminated abnormally without any error message)
    

    I'm runnig firefox without installing it from the repositories. And I'm getting a socket timeout when I try to run the selenium tests, so I guess the problem is in Firefox and Xvfb.

    I have installed already the nex package:

    i   gconf-defaults-service                                                 - GNOME configuration database system (system defaults service) 
    

    That in some forums suggest to be a fix, that in my case doesn't work.

    Any explanation about the problem and ways of solving it without installing a full gui, will be very helpful.

    • Warner
      Warner about 14 years
      My mistake, I misunderstood your question. Does Firefox have to operate or be available? You could have it be a script that returns the proper exit code.
    • Julio J.
      Julio J. about 14 years
      I think it should operate, the requirements are given by Selenium RC which is the one that is going to use it. I'm going to check it anyway.
    • Julio J.
      Julio J. about 14 years
      What I understand from here seleniumhq.org/docs/05_selenium_rc.html is that it should work completely.
    • Admin
      Admin almost 12 years
      I have "Xvfb -ac -screen 0 1024x768x24" and experiencing the same problem under hudson. How did you fix the problem? Could you please share the solution?
  • Julio J.
    Julio J. almost 14 years
    Thanks, but I'm running Selenium from hudson with the Selenium Plugin for Hudson.
  • Pierre D
    Pierre D over 11 years
    can you explain a little more about your solution i am stuck at the same problem