Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am setting up a test environment, made up of various Linux boxes, and I have the need to launch an instance of Firefox on a remote machine via ssh.

The remote machine has Ubuntu Desktop (11) and Firefox installed.

The source machine is a Continuous Integration server and it creates an ssh session to the remote machine from a non-GUI environment. It then runs a script, which tries to launch Firefox on the remote machine.

However, since the ssh session is a from a non-GUI environment, there is no display.

Is it possible to have a headless X-windows display? i.e. a virtual display in the remote environment for Firefox to run in? What options do I have?

share|improve this question
add comment

3 Answers

You need a gui for firefox. But you have a couple of options:

1) Run Xorg on your host and display firefox here (ssh -Y user@remotehost)

2) Start vncserver on remote hosts, and run firefox in there

3) If xorg is already running on remote hosts, just allow local Xorg connections (xhost +127.0.0.1) on remote hosts, and start firefox with one of the following commands (first one should work, if not, try the second one):

DISPLAY=":0" firefox 
DISPLAY=":0" firefox -no-remote
share|improve this answer
    
+1 for the vncserver suggestion. I have not yet tried the xorg option –  Vihung Jul 9 '12 at 15:07
add comment

X virtual framebuffer will solve this problem.

sudo apt-get install xvfb
Xvfb :1 &

Then to launch firefox:

ssh HOST 'export DISPLAY=:1; firefox"
share|improve this answer
add comment

There are ssh clients/X11 server bundles out there, something like this.

Just ensure your $DISPLAY points back to where you are connecting to and lauch firefox in your console.

share|improve this answer
add comment

Your Answer

 
discard

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.