Xlib: connection to ":0.0" refused by server Xlib: No protocol specified


Results 1 to 7 of 7

Thread: Xlib: connection to ":0.0" refused by server Xlib: No protocol specified

  1. #1
    Join Date
    Feb 2002
    Posts
    1,074

    Xlib: connection to ":0.0" refused by server Xlib: No protocol specified

    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.

  2. #2
    Join Date
    Dec 2003
    Location
    Phoenix, AZ
    Posts
    647
    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.
    "There's a big difference between "copy" and "use". It's exatcly the same
    issue whether it's music or code. You can't re-distribute other peoples
    music (becuase it's _their_ copyright), but they shouldn't put limits on
    how you personally _use_ it (because it's _your_ life)."

    --Linus Torvalds

  3. #3
    Join Date
    Feb 2002
    Posts
    1,074
    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

  4. #4
    Join Date
    Oct 2000
    Location
    Calgary, Alberta, Canada
    Posts
    8,116
    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...

  5. #5
    Join Date
    Feb 2002
    Posts
    1,074
    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?

  6. #6
    Join Date
    May 2013
    Posts
    1

    Please help with this

    Hi
    While trying the above one I got error like this


    xauth: error in locking authority file /home/user/.Xauthority


    Thank you

  7. #7
    Join Date
    Jul 2014
    Posts
    1
    I am trying to connect the Cygwin X on Window 7 machine through putty; However I am getting the below error message:

    Xlib: connection to "MachineIPAddress:0.0" refused by server
    Xlib: No protocol specified

    Error: Can't open display: 151.149.171.82:0

    Below are the steps I followed:

    1. Launch the 64 bit Cygwin X.
    2. It starts the Cygwin X and shows its symbol on right corner.
    3. Then I started the xterm and start the xclock which is required to start the Xmenu through putty.
    4. After that I have used the below commands to access the X display windows:
    export DISPLAY=IPaddress:0.0
    xhost +
    5. Here I am getting that error. I am not able to open the required screen as well.
    6. I tried to add the IP in host file but still getting the same error.
    7. I have also tried xauth list $DISPLAY but it didn't show me the display list

    Can you please help me out to get the solution of this so that I can use the cygwinX on Window 7?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •