Xlib: connection to ":0.0" refused by server Xlib: No protocol specified
hi all,
I'm new here. I have similar problem with running a C project that uses GLUT/OpenGL graphics... every run result with the two lines: Xlib: connection to ":0.0" refused by server Xlib: No protocol specified sometimes the graphics works ok sometimes there is an infinite loop, but every execution result with the two lines above. what is the meaning of these 2 lines? Is it an Error or Warning? How can I fix the code? My guess is that there is a fundamental problem with the graphics Glut Library...Or that I didn't write the MakeFile OK Please help me, I would extremly appriciate it. Jonathan:newbie: Xlib: connection to ":0.0" refused by server Xlib: No protocol specified |
Sounds like you are trying to access X as a non-authorised user.
The only time I ever see those lines is when I have done "su" in a shell and then attempt to run a program. If this is the problem, then make sure you are the correct user (i.e. the one you originally did startx with or logged in on a graphical login manager with) If not, then try "xhost +" first. |
Well first off with:
Xlib: connection to ":0.0" refused by server to the left of the ':' is suppose to be the address of the windows client that is going to connect to linux Xserver. In my case I had to set an environment variable to it like this setenv DISPLAY 10.2.55.8:0 this is prolly not what you need but you are definitly missing an ip address |
Getting X11 forwarding through ssh working after running su
X authentication is based on cookies -- secret little pieces of random data that only you and the X server know... So, you need to let the other user in on what your cookie is. One way to do this is as follows:
Before you issue the su or sudo (but after having ssh'ed into the remote system if you are using ssh), request the cookie for the current DISPLAY that's connecting to your X server: $ xauth list $DISPLAY You'll get something like somehost.somedomain:10 mit-magic-cookie-1 4d22408a71a55b41ccd1657d377923ae Then, after having done su, tell the new user what the cookie is: $ xauth add somehost.somedomain:10 MIT-MAGIC-COOKIE-1 4d22408a71a55b41ccd1657d377923ae (just copy and paste the output of the above 'xauth list' onto 'xauth add') That's it. Now, you should be able to start any X application. A good one to try is: xclock xhost # bad xhost + # very bad |
no protocol specified?
[QUOTE=mike.rose;3630530]X authentication is based on cookies -- secret little pieces of random data that only you and the X server know... So, you need to let the other user in on what your cookie is. One way to do this is as follows:
--------------------------------------------------------------- Thank you very much. It was annoying to have to change to root rather than access root through the x-terminal. This worked for me - but how the hell did you figure it out? |
best explanation so far...
Hi,
I just wanted to thank mike.rose for the short but accurate description of how to overcome the problem withe X windows 'refused by server' error. It not only worked, but it now makes more sense. Thanks, Russ. |
reference to the answer
Thanks for the thanks. I should have included the reference to the answer I found and posted here:
http://www.debian-administration.org/articles/494 The other reference is my "yoda" Michael Rutter who taught me about X11 and cookies: http://www.tcm.phy.cam.ac.uk/~mjr/ |
Of course a lazy way to get around this is to use ssh -X... for instance:
Code:
ssh your_user_that_wants_to_use_x@localhost -X |
I have a sort of similar problem.
I have VNCed to a machine, when logged in as the default user I am able to start xwindows, but as soon as I login as root.. export DISPLAY and try to open a xwindow I get this error: [root@patton:/] xclock Xlib: connection to "patton:6.0" refused by server Xlib: No protocol specified Error: Can't open display: patton:6 when I ssh from my local windows machine to the same host and use Cygwin for xWindow to connect to it.I am able to start the x-window on my local machine as a root, ON VNC I tried above suggested command when logged in as a default user xauth list $DISPLAY but it returns nothing to me. Appreciate your help ! |
Hi creative,
I had the same symptoms as you -- not seeing any entries from `xauth list $DISPLAY`. From the xauth man page it looks like you can do this to generate an xauth key for your display: Quote:
|
Thanks guys.. :)
This solution helped me too. thanks a lot mike.rose ..:)
|
Was having an issue with this and LinuxQuestions saves the day again.
thanks |
Mike Rose, i coming from near future and your post rule in this year. Thanks for your help i coming early to home.
|
All times are GMT -5. The time now is 08:14 AM. |