LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cannot connect to X server :0.0 (https://www.linuxquestions.org/questions/linux-newbie-8/cannot-connect-to-x-server-0-0-a-101957/)

Celorfin 10-09-2003 02:23 AM

Cannot connect to X server :0.0
 
I am a Linux newbie and just installed Debian Woody few days ago. When I tried to run some programs and typed the command in the shell, I got some error messages saying that connection to ":0.0" refused by server. The following is what I get when I try to run emacs and synaptic. What should I do to make them work?

# emacs
Xlib: connection to ":0.0" refused by server
Xlib: Client is not authorized to connect to Server
emacs: Cannot connect to X server :0.0.
Check the DISPLAY environment variable or use `-d'.
Also use the `xhost' program to verify that it is set to permit
connections from your machine.

# xhost
Xlib: connection to ":0.0" refused by server
Xlib: Client is not authorized to connect to Server
xhost: unable to open display ":0.0"

# synaptic
Xlib: connection to ":0.0" refused by server
Xlib: Client is not authorized to connect to Server
synaptic:could not open display

iainr 10-09-2003 04:15 AM

I'm not sure what the problem is here but there's a couple of things you can try.

1. Are you running the program as a different user to the one you logged on as? If so, you may need to set the DISPLAY variable for the new user (e.g. root) and allow access. In this case the procedure would be.
i) As your own user, open a terminal window and type xhost +
ii) su to the other account
iii) Type export DISPLAY=<hostname>:0
iv) Launch the app.

(Note xhost + is not good for security. Use it to check the issue, then read the xhost man page to find a better version of the command if it works).

2. If you are running as your own user then something is wrong, since launching apps should work. However, there's a good chance that using the method above - xhost + and export DISPLAY - will still work.

Iain.

Celorfin 10-09-2003 10:29 AM

Thanks for the respond.

I typed xhost + myusername and things work. But now xhost says that

access control disabled, clients can connect from any host
INET:my.domain.name

Is this good?

iainr 10-09-2003 02:25 PM

It isn't good, but if you type "xhost -", this restricts connections to those you have specified (i.e. your own host).

You can then enter xhost on its own to check.

xhost is never great for security, but if you are using it on a standalone PC rather than a shared server and you're behind a firewall, I doubt the end of the world will follow.

Iain.


All times are GMT -5. The time now is 04:31 PM.