Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Xlib: connection to ":0.0" refused by server

21 views
Skip to first unread message

Helix

unread,
Dec 15, 2004, 9:31:38 AM12/15/04
to
Hello,
I can't run any x program

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

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

I wonder if do I need some ethernet interface activated like lo or something
else
What can I do ?
TIA


Craig Bergren

unread,
Dec 15, 2004, 9:37:33 AM12/15/04
to

This just started happening to me recently. I was messing around with the
name server. What I did was to clean out the xauth tokens. I zapped them
all and restarted X. It hasn't occurred since.

Dances With Crows

unread,
Dec 15, 2004, 9:49:38 AM12/15/04
to
On Wed, 15 Dec 2004 15:31:38 +0100, Helix staggered into the Black Sun and said:
> I can't run any x program
> xterm
> Xlib: connection to ":0.0" refused by server
> xeyes
> Xlib: connection to ":0.0" refused by server
>
> I wonder if do I need some ethernet interface activated like lo or
> something else. What can I do ?

Provide more information. How are you starting these X clients? Did
you log in via kdm/xdm/gdm or startx? Are you running these X clients
as the same user who logged into X? You need to be; look:

user@host:~$ xeyes &
(xeyes starts)
user@host:~$ su -
root@host:~# xeyes &


Xlib: connection to :0.0 refused by server

...root cannot run X clients because only user has the magic cookie.
user can give permission for any user on the local machine to run an X
client by doing "xhost +localhost".

If you're not sure whether the loopback interface is enabled, just
execute "ifconfig". It should show "lo" with an address of 127.0.0.1 .

--
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin / mail: TRAP + SPAN don't belong
http://www.brainbench.com / Hire me!
-----------------------------/ http://crow202.dyndns.org/~mhgraham/resume

Helix

unread,
Dec 15, 2004, 9:59:45 AM12/15/04
to
Thank you

> Provide more information. How are you starting these X clients? Did
> you log in via kdm/xdm/gdm or startx? Are you running these X clients
> as the same user who logged into X? You need to be; look:
>
> user@host:~$ xeyes &
> (xeyes starts)
> user@host:~$ su -
> root@host:~# xeyes &
> Xlib: connection to :0.0 refused by server

I login as root
I launch startx as root
I launch xeyes as root

# xeyes


Xlib: connection to :0.0 refused by server

Xlib: no protocol specified


>
> ...root cannot run X clients because only user has the magic cookie.
> user can give permission for any user on the local machine to run an X
> client by doing "xhost +localhost".

# xhost +localhost


Xlib: connection to :0.0 refused by server

Xlib: no protocol specified

> If you're not sure whether the loopback interface is enabled, just
> execute "ifconfig". It should show "lo" with an address of 127.0.0.1

Added
# ifconfig lo 127.0.0.1


Dances With Crows

unread,
Dec 15, 2004, 10:33:19 AM12/15/04
to
On Wed, 15 Dec 2004 15:59:45 +0100, Helix staggered into the Black Sun
and said:
>> Provide more information. How are you starting these X clients? Did
>> you log in via kdm/xdm/gdm or startx?
> I login as root
> I launch startx as root

Don't do that. Running X as root is not recommended and could lead to
security problems. Modern desktop environments like KDE provide things
like "kdesu", which allows you to run X applications as root while X
itself runs as a user. It's possible (but unlikely) that the distro
you're using is preventing root from launching X clients directly.
Which version of which distro are you using, anyway?

> # xeyes
> Xlib: connection to :0.0 refused by server

Hm. Could old .Xauthority and .xauth* files in /root be confusing X?
Exit X, then "rm -f ~/.Xauthority ~/.xauth*" and try again.

> # ifconfig lo 127.0.0.1

If loopback isn't up, you'd see other problems besides X not working
properly. If you can do "startx" and have it work, loopback is almost
certainly up.

Helix

unread,
Dec 15, 2004, 11:18:43 AM12/15/04
to
> Don't do that. Running X as root is not recommended and could lead to
> security problems. Modern desktop environments like KDE provide things
> like "kdesu", which allows you to run X applications as root while X
> itself runs as a user. It's possible (but unlikely) that the distro
> you're using is preventing root from launching X clients directly.
> Which version of which distro are you using, anyway?

Kernel: 2.4.26
Distro: from scratch

I need to run everything as root

>
> > # xeyes
> > Xlib: connection to :0.0 refused by server
>
> Hm. Could old .Xauthority and .xauth* files in /root be confusing X?
> Exit X, then "rm -f ~/.Xauthority ~/.xauth*" and try again.

I deleted /root/.Xauthority
Now I am unable to rebuild it using xauth

# xauth -b -v generate 0
xauth: creating new authority file /root/.Xauthority
xauth: (argv):1: unable to open display "0".


> > # ifconfig lo 127.0.0.1
>
> If loopback isn't up, you'd see other problems besides X not working
> properly. If you can do "startx" and have it work, loopback is almost
> certainly up.

startx is working also without device lo is up
however now I launched # ifconfig lo 127.0.0.1


Helix

unread,
Dec 15, 2004, 11:49:55 AM12/15/04
to
SOLVED:

There was a file missing:
/etc/termcap

I can't understand why this file is so important?!?!?!


Dances With Crows

unread,
Dec 15, 2004, 1:02:40 PM12/15/04
to
On Wed, 15 Dec 2004 17:49:55 +0100, Helix staggered into the Black Sun
and said:
[ problems with starting X applications ; they all gave a "cannot open
display" message when started. Distro is built from scratch, using a
2.4.26 kernel. ]

> SOLVED:
> There was a file missing: /etc/termcap
> I can't understand why this file is so important?!?!?!

/etc/termcap describes the capabilities of all the terminals that exist.
I don't know why a client like xeyes would require termcap--running
"strace xeyes > strace.log 2>&1" doesn't show any attempts to open()
/etc/termcap or /etc/terminfo/ on my system. Maybe it's one of the
libraries.

A missing /etc/termcap should've caused problems long before X was
running. Practically every text editor (except /bin/ed) and pager
(more, less, most...) will say something like "terminal is not fully
functional" if termcap or terminfo isn't there. Well, when you decide
to build a distro from scratch, you will find all kinds of new and
interesting ways to screw up. Hope it's a good learning experience....

I R A Darth Aggie

unread,
Dec 16, 2004, 12:36:33 PM12/16/04
to
On Wed, 15 Dec 2004 17:18:43 +0100,
Helix <b...@nospam.nospam>, in
<cppo51$dgj$1...@newsread.albacom.net> wrote:

>+ I need to run everything as root

You have bigger issues than X not running. Don't run as root. sudo
(and allies) are your friends.

James
--
Consulting Minister for Consultants, DNRC
I can please only one person per day. Today is not your day. Tomorrow
isn't looking good, either.
I am BOFH. Resistance is futile. Your network will be assimilated.

0 new messages