Click to See Complete Forum and Search --> : Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
bandwidth_pig
12-04-2003, 08:40 PM
I know this is not a rare problem. I've read the threads here regarding this for the most part and the advice I have picked up hasn't helped. I often get this message when trying to run apps in KDE as root:
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
I have tried xhost + and xhost + localhost and it doesn't seem to do anything. Of course, if I log in as root rather than just su to root I don't have this problem. So it is obviously a permissions issue. Does anybody know how to fix this? I haven't had this problem until I had to reinstall recently. Suggestions most appreciated.
BTW I run Debian. Thank you again.
voidinit
12-04-2003, 09:07 PM
There's a couple things you need to do. First become root and from a command prompt. Type:
root@yourhost#>echo $DISPLAY
If you don't get :0.0 for output, we need to make it that way. So type
root@yourhost#>export DISPLAY=:0
That takes care of the first part. Now I assume you are logging into the box with your user account, starting x if it's not already started, then su -ing to root. If this is the case, you need the MIT Magic Cookie!
Run these commands substituting your non-root username for 'user'.
root@yourhost:~>cd /root/ (in case you weren't there)
root@yourhost:~>xauth -f /home/user/.Xauthority extract ./xcookie :0.0
(if the above command complains that :0.0 isn't found, try it again with :0 or 0:0, most likely :0.0 will work though)
root@yourhost~>xauth merge ./xcookie
What you just did is pulled a copy of the MIT-Magic-cookie thing from your user account's Xauthority and put it in yours.
bandwidth_pig
12-14-2003, 10:41 AM
I just wanted to say thank you. Your directions worked flawlessly. I saw that you replied previously and just tried it out today. Thanks again :D
wouldn't this be easier?
xhost +localhost
su
<enter root password>
execute whatever app
exit
xhost -localhost (optional)
OR, just add xhost +localhost to whatever startup script runs when you load your X environment...
bandwidth_pig
12-21-2003, 10:08 PM
Hi Hayl. Thank you for your reply as well. I later found that the previous method while effective, is only temprorary. Once I shutdown X I had to issue the command again (although still appreciative for the suggestion).
So I tried the method you had described and it did not work for me at all. I have seen the method you have described offered as advice several times...but it never works for me. I don't know why:
me@Debian:~$ xhost +localhost
localhost being added to access control list
me@Debian:~$ su
Password:
Debian:/home/me# synaptic
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
What am I doing wrong here?