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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
03-02-2004, 08:06 AM
|
#1
|
LQ Newbie
Registered: Mar 2004
Posts: 3
Rep:
|
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.
|
03-02-2004, 10:38 AM
|
#2
|
Member
Registered: Jun 2003
Location: Reading, UK
Distribution: Debian 3.0, LFS
Posts: 524
Rep:
|
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.
|
|
|
10-02-2008, 11:38 AM
|
#3
|
LQ Newbie
Registered: Sep 2008
Posts: 2
Rep:
|
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
|
|
|
08-04-2009, 03:49 AM
|
#4
|
LQ Newbie
Registered: Aug 2009
Posts: 2
Rep:
|
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.
|
09-02-2009, 01:26 AM
|
#5
|
Member
Registered: May 2009
Location: australia
Distribution: slackware
Posts: 187
Rep:
|
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?
|
|
|
05-20-2010, 09:31 AM
|
#6
|
LQ Newbie
Registered: May 2010
Posts: 1
Rep:
|
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.
|
|
|
09-01-2010, 10:07 AM
|
#8
|
LQ Newbie
Registered: Sep 2010
Posts: 4
Rep:
|
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
|
|
|
12-21-2011, 07:52 PM
|
#9
|
LQ Newbie
Registered: Dec 2011
Posts: 3
Rep:
|
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 !
|
|
|
04-18-2012, 03:41 PM
|
#10
|
LQ Newbie
Registered: Apr 2012
Posts: 2
Rep:
|
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:
That worked for me.
|
|
|
02-07-2014, 12:53 AM
|
#11
|
LQ Newbie
Registered: Jul 2012
Posts: 1
Rep:
|
Thanks guys.. :)
This solution helped me too. thanks a lot mike.rose ..
|
|
|
04-22-2015, 09:17 AM
|
#12
|
Senior Member
Registered: Jan 2004
Posts: 1,420
Rep:
|
Was having an issue with this and LinuxQuestions saves the day again.
thanks
|
|
|
11-27-2018, 01:30 PM
|
#13
|
LQ Newbie
Registered: Nov 2018
Posts: 1
Rep:
|
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:18 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|