LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-02-2004, 08:06 AM   #1
eyalkz
LQ Newbie
 
Registered: Mar 2004
Posts: 3

Rep: Reputation: 0
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

Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 03-02-2004, 10:38 AM   #2
guygriffiths
Member
 
Registered: Jun 2003
Location: Reading, UK
Distribution: Debian 3.0, LFS
Posts: 524

Rep: Reputation: 35
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.
 
Old 10-02-2008, 11:38 AM   #3
yodasoda
LQ Newbie
 
Registered: Sep 2008
Posts: 2

Rep: Reputation: 0
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
 
Old 08-04-2009, 03:49 AM   #4
mike.rose
LQ Newbie
 
Registered: Aug 2009
Posts: 2

Rep: Reputation: 2
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
 
2 members found this post helpful.
Old 09-02-2009, 01:26 AM   #5
vigi
Member
 
Registered: May 2009
Location: australia
Distribution: slackware
Posts: 177

Rep: Reputation: 27
Thumbs up 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?
 
Old 05-20-2010, 09:31 AM   #6
rgahockey
LQ Newbie
 
Registered: May 2010
Posts: 1

Rep: Reputation: 0
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.
 
Old 05-24-2010, 03:02 AM   #7
mike.rose
LQ Newbie
 
Registered: Aug 2009
Posts: 2

Rep: Reputation: 2
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/
 
Old 09-01-2010, 10:07 AM   #8
anthalamus
LQ Newbie
 
Registered: Sep 2010
Posts: 4

Rep: Reputation: 0
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 heard sux does a good job at this as well, haven't tried though
 
Old 12-21-2011, 07:52 PM   #9
creative
LQ Newbie
 
Registered: Dec 2011
Posts: 3

Rep: Reputation: Disabled
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 !
 
Old 04-18-2012, 03:41 PM   #10
funkyworklehead
LQ Newbie
 
Registered: Apr 2012
Posts: 2

Rep: Reputation: Disabled
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:
xauth $DISPLAY .
That worked for me.
 
Old 02-07-2014, 12:53 AM   #11
adithyagokhale
LQ Newbie
 
Registered: Jul 2012
Posts: 1

Rep: Reputation: 0
Thumbs up Thanks guys.. :)

This solution helped me too. thanks a lot mike.rose ..
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XERROR: 'Xlib: connection to ":0.0" refused by server' tsiMental Debian 11 02-16-2007 07:30 PM
Xlib: connection to ":0.0" refused by server Xlib: No protocol specified eyalkz Programming 1 03-02-2004 08:22 AM
Wine not working. Xlib: connection to ":0.0" refused by server Xerop Linux - General 1 02-18-2004 09:37 PM
What is "Xlib: connection to ":0.0" refused by server " rack201 Linux - Software 1 02-04-2004 07:49 AM
Mplayer: [Xlib: connection to ":0.0" refused by server] elluva Slackware 2 12-18-2003 06:12 AM


All times are GMT -5. The time now is 06:41 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration