LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   simple X question (https://www.linuxquestions.org/questions/linux-software-2/simple-x-question-43931/)

Bran6don 02-03-2003 03:07 PM

simple X question
 
This should be a fairly simple question.

When I type "emacs test &" from my regular username, a new emacs windows opens up and everything works fine.

When I type the same thing fromt the root account, I get:

Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
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.

I tried to run xhost, but I get the same error.

The display env variable for each account is :0.0

Anyone know what's up?

jdc2048 02-03-2003 06:12 PM

How are you using the xhost command? Just running "xhost" will not change anything, it only displays which hosts are allowed to connect.

If you are logged in as a standard user, then using su to get root access, then trying to open an X window on your desktop then you will get this.

The way to get around it is to run "xhost +<hostname>"
not literally of course, you need to sub in your hostname for <hostname> or use "localhost" if you are doing this on the same machine.

Some might tell you to just use "xhost +", which is bad form, you should always specify the name of the host you wish to allow access to.


All times are GMT -5. The time now is 11:34 PM.