Xlib: connection to ":0.0" refused by server - X

This is a discussion on Xlib: connection to ":0.0" refused by server - X ; 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 ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: Xlib: connection to ":0.0" refused by server

  1. Xlib: connection to ":0.0" refused by server

    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



  2. Re: Xlib: connection to ":0.0" refused by server

    On Wed, 15 Dec 2004 15:31:38 +0100, Helix wrote:

    > 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


    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.


  3. Re: Xlib: connection to ":0.0" refused by server

    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

  4. Re: Xlib: connection to ":0.0" refused by server

    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



  5. Re: Xlib: connection to ":0.0" refused by server

    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.

    --
    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

  6. Re: Xlib: connection to ":0.0" refused by server

    > 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



  7. Re: Xlib: connection to ":0.0" refused by server

    SOLVED:

    There was a file missing:
    /etc/termcap

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



  8. Re: Xlib: connection to ":0.0" refused by server

    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....

    --
    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

  9. Re: Xlib: connection to ":0.0" refused by server

    On Wed, 15 Dec 2004 17:18:43 +0100,
    Helix , in
    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.

+ Reply to Thread