Wednesday, May 1, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 820  / 1 Year ago, thu, may 4, 2023, 8:42:03

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

More From » bash

 Answers
7

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'

[#31833] Thursday, May 4, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tionverflow

Total Points: 500
Total Questions: 115
Total Answers: 120

Location: Northern Ireland
Member since Mon, Nov 14, 2022
1 Year ago
;