No protocol specified couldn't connect to display ":0.0"
Hi!
I'm trying to run a script as root, which should make a window pop up, and I think it uses another terminal as the log. At present I only have one terminal open. It worked a while ago, and now it doesn't. From similar threads I see that other people also said that it fluctuated, but that's all help that I got. Code:
[root@gnlserv01 scripts]# ./oscar_wizard Code:
[root@gnlserv01 ~]# xhost root Thanks! |
xhost has to be run by the user who owns the X session, not root, because you're giving permission for root to access the display. Also, I don't think xhost can accept "root" as an entry. Try "xhost +localhost".
The program also has to know which display to use. If "echo $DISPLAY" in the root terminal doesn't show the correct display number, you'll have to set the environment variable: DISPLAY=":0.0" (or else set it individually for each command, usually with a "--display=0" option or something similar. |
Hi!
I tried doing what you suggested, but it doesn't seem to work, or else I'm not using the write syntax. Code:
[compchem@gnlserv01 ~]$ xhost +localhost :0.0 [root@gnlserv01 ~]# /opt/oscar/scripts/oscar_wizard No protocol specified couldn't connect to display ":0.0" at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/Tk/MainWindow.pm line 55. MainWindow->new() at /opt/oscar/scripts/oscar_wizard line 155 /CODE] Thanks for your help so far! |
[Solved] - Sort of.
Hi !
I closed the terminal, reopened it, checked that the $DISPLAY was set correctly, and then it worked. This solves my immediate problem, but I don't know why the problem is actually solved. Thanks anyway! |
Thank you for explaining this!!
Quote:
It was really annoying that I previously couldn't run any programs requiring root. Now I can launch my Slackware package manager (GSlapt) from the mc console. Thank you!! Xavian-Anderson Macpherson Shingoshi |
I have a question which might help others also...
Is there a way to set either "init 4" or the user login to X to automatically perform the "xhost +localhost" at the beginning of every session? It would be nice if I don't have to do this every time I log into the X window. Where in /etc/X11 would this have to be done to make the change permanent?
Xavian-Anderson Macpherson Shingoshi |
All times are GMT -5. The time now is 06:42 PM. |