Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to install firefox packages to all my linux hosts remotely using a bash script. But when ever i execute the script i get the following error. How do i enable DISPLAY in bash script?

Error:

No protocol specified
Error: cannot open display: :0.0
No protocol specified
Error: cannot open display: :0.0
share|improve this question
    
Can you specify what you use to install firefox? If you use apt-get it should work without any problem... –  Salem Apr 9 '13 at 15:06
    
Can you provide the script? Also how do you execute it? Using SSH? –  Salem Apr 9 '13 at 15:38

2 Answers 2

up vote 1 down vote accepted

That is very odd: the error seems to be generated by firefox needing to access X functionalities (which is normal), but those export commands should be sufficient to make it work (if you have a running X session on the hosts).

The only tips I can give to you is to replace the export line like this (you should only need one):

#export DISPLAY=:0.0
export DISPLAY=:0

or try to explicitly set the display on each command:

su user1 -c 'DISPLAY=:0 firefox -no-remote -CreateProfile firefox18'
share|improve this answer

On the machine you want the firefox to appear on try running the command xhost -, this allows client windows to connect from any host. Once you've done running firefox you should probably run xhost + to keep secure.

share|improve this answer

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.