LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Xlib errors (https://www.linuxquestions.org/questions/linux-general-1/xlib-errors-323581/)

zchoyt 05-14-2005 09:38 PM

Xlib errors
 
I log into my box as nonroot.
I type gvim or firefox in the command line and it launches OK. Here is where it gets strange. I log in as root for a while, then switch back to the nonroot account. I type gvim again, and comes up with the errors:

Code:

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

E233: cannot open displayXlib: connection to ":0.0" refused by server
Xlib: No protocol specified

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

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

If I type firefox, the command line will act like it launched OK (which it shouldn't do without the "&". It just prompts me again and firefox never comes up.

Then if I switch to root again and try to launch either one, they'll work.


Any ideas? This has to be a common problem because this happens on my home machine, my laptop, and my work PC (unless I am configuring something wrong, and thinking I am doing it right).


thx,

axobeauvi 05-15-2005 09:52 AM

that is strange
what login manager do you use kdm,gdm .... try another one
check the permissions and ownership of .Xauhority
hope this helps a bit

derrickhackman 05-16-2005 06:56 AM

I ran into similar issues and found that it had to do with the environment of the root user being different that the non-root user. I believe the fix was to export the DISPLAY environment variable. I was having issues when pulling up emacs as root and it not finding xlib, I had to use:
Code:

emacs -nw <myfile>
so that it did not force an x session.

mlavannis 04-15-2006 05:33 PM

Xlib: connection to ":2.0" refused by server
 
You may not have permission to the Xauthority file locatd in your home directory. Do this to check:
> ls -l ~/.Xauthoriy

Make sure you have rw permissions

Next:
> xauth list

Make sure you have an entry in there for DISPLAY :2
(or whichever DISPLAY number interests you)

If not:

> xauth add <hostname:2> <protocol> <HEX magicnumber>
(you can also use> xauth add <hostname:2> . `mcookie`

You can google to find out other ways to generate a HEX magic number for xauth - there are many solutions out there.


All times are GMT -5. The time now is 03:07 PM.