Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am facing this exception when I run a Selenium test case using the Firefox driver on the AWS EC2 instance which is the headless server. I installed Firefox and all the necessary changes for it

org.openqa.selenium.WebDriverException: org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(/opt/firefox/firefox-bin) on port 7055; process output follows: �* e = [Exception... "Component returned failure code: 0x80570016 (NS_ERROR_XPC_GS_RETURNED_FAILURE) [nsIJSCID.getService]" nsresult: "0x80570016 (NS_ERROR_XPC_GS_RETURNED_FAILURE)" location: "JS frame :: chrome://browser/content/utilityOverlay.js :: getShellService :: line 339" data: no]

Please can anyone help me with this exception?

share|improve this question

First install xvfb which will allow you to run it with a "virtual screen".

sudo yum -y install xorg-x11-server-Xvfb 

Then you should check out this helpful post which will help you get firefox installed on amazon EC2. This is because you can't just do sudo yum install firefox on EC2. So, basically you create a file (I used this gist) on the EC2 instance that he provides and then run it to install firefox and all of it's dependancies.

When the script runs it will install firefox in


by default I believe.

Once it has installed you probably then need to add it to your path as the above link also explains. But you should also add the DISPLAY system variable though so do something like this...

cat << EOF >> ~/.bashrc
export PATH
export DISPLAY

Then you have to kick off xvfb for screen 99 so it will be able to run firefox on it's "virtual screen". Like so...

Xvfb :99 -screen 0 1024x768x16 &

Then hopefully when you re-run your selenium tests it will find firefox on the path and run it in the correct "virtualised" screen on that EC2 instance.

As a side note - I am not by any means an expert of any type in amazon linux so... Goodluck.

Alternatively, you could investigate running against selenium server which you could fire up on an amazon EC2 ubuntu micro instance, which you can easily setup to have a GUI.

share|improve this answer
how do you run your selenium tests? after doing everything thrice, I get this error: PuTTY X11 proxy: wrong authorisation protocol attemptedError: cannot open display: localhost:10.0 – Buffalo Sep 3 '15 at 14:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.