Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to run Firefox from the terminal on a server using a centos operating system. Whenever I type in the command:

  ssh - X hostname firefox 

I can get firefox to successfully open, but I can not ssh on to the server remotely and open firefox. I get the following error message after specifying export DISPLAY=:0 and typing in "firefox"

No protocol specified
No protocol specified
Error: cannot open display: :0

There are many forums for this problem online and the only useful suggestions I have tried:

export XAUTHORITY=/home/<user>/.Xauthority

Although I need firefox to open under a specific user it will also not open under root.

share|improve this question

migrated from stackoverflow.com Jan 21 '13 at 16:29

This question came from our site for professional and enthusiast programmers.

Try it with the -Y switch also. –  Keith Jan 21 '13 at 11:19
yep, that also opens a Firefox browser. –  Saz92 Jan 21 '13 at 11:22
Oh, SSH doesn't use display 0. Try DISPLAY=:10.0 –  Keith Jan 21 '13 at 11:25
thanks for your suggestions, but I'm now getting Error: cannot open display: :10.0. –  Saz92 Jan 21 '13 at 11:29
In that case why do you need it opening on your local machine? The problems you are experiencing are related to opening a GUI program from a remote server and asking it to display on your local machine. If you want to run the tests on the server, none of what you describe sjould be a problem. Perhaps you need to clarify your question? –  terdon Jan 21 '13 at 17:43

1 Answer 1

Try lowercase x !? Also make sure you don't have a space between the '-' and 'x'

ssh -x hostname firefox

An alternative to try out (more wordy method but might give you a different error message that is more helpfull):

originalhost > ssh remotehost remotehost > setenv DISPLAY originalhost:0

originalhost > xhost + remotehost > firefox

share|improve this answer

Your Answer


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