LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Xlib: connection to ":0.0" refused by server (https://www.linuxquestions.org/questions/linux-newbie-8/xlib-connection-to-0-0-refused-by-server-85529/)

zovres 08-25-2003 11:58 AM

Xlib: connection to ":0.0" refused by server
 
sometimes I get this error when I try to use mplayer or freecraft as a non-root user

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

I have this error since I've started using fluxbox
do you guys know a way to fix that?

MasterC 08-25-2003 12:10 PM

This usually only occurs when you are trying to run an X application from either a console or a terminal under an X session you didn't start as that user. Thoroughly confused?

If you logged in as root and typed:
startx
And then, opened up a terminal and typed:
su - username
And followed with:
xedit
You'd likely get that error as your user doesn't have permissions to run X applications in root's X session (same goes in reverse and parallel, nobody except the user who started the X session can execute X apps in it).

However, there is a workaround:

xhost+localhost

This should allow anyone on your local machine to run X apps in any X session, type that in before you 'startx' and it should render this ability available.

Another option is to startx as the user you are going to use to launch the app. If you don't want to close down the current X session:
CTRL ALT F2
to another console, login as the user, and type:
startx -- :1
This'll start an X session on tty8 and the old session'll be on tty7, to switch you type:
CTRL ALT F7/F8

This display is now known from the Xserver as 0:1

Cool

zovres 08-25-2003 12:45 PM

thx for that quick and complete reply ;)

MasterC 08-25-2003 12:48 PM

You're welcome, glad I could help ;)

Cool


All times are GMT -5. The time now is 12:40 PM.