Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3248
  • Last Modified:

emacs: Cannot connect to X server :0.0.

I am using Red hat 9 which has been newly installed.I am having problem evoking "emacs" as the user.I tried through root and it worked fine.
 Whenever I start it as the user it gives me the following message :-

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.
 
Any help in this regards will be appreciated
0
bibinbhanu
Asked:
bibinbhanu
1 Solution
 
jlevieCommented:
Is the user that is trying to start emacs the logged in user, or have you logged in as one user and 'su'd to another? The logged in user should be able to start emacs.
0
 
bibinbhanuAuthor Commented:
i have logged in as the user , i.e. the user that is trying to start emacs is the logged in user.
0
 
GnsCommented:
Yep. If you'd like all "local users" to be able to write to the X display, you could do "xhost + localhost" as the user who started the X session (root in all probability;-), then the user should have no problem:-).

-- Glenn
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
GnsCommented:
Ah, semi-crossing posts.

Could you quote the output from
xhost
here?

-- Glenn
0
 
GnsCommented:
And could you also quote the content of /etc/hosts here? Might be that you've done something silly to the "loopback address":-)

-- Glenn
0
 
bibinbhanuAuthor Commented:
Thanks for the help Glenn, the emacs editor is working now.
:)
0
 
michelandreCommented:
I have the same problem
But it will work if I use from the start menu: "Run Command"
You don't have to be root but sometimes it helps, so do the following if you have to use root:
When the windows appears click "Options" and enter the user: "root" and his "password"
You have to give the full path to the command

Hope it will partially help

Michel-André
0
 
GnsCommented:
Has top do with the credentials you have michelandre,,, Since when you "Run..." you always do that as the user that started X, it'll always work like that;-).
The xhost + ... bit would help, but should only be performed in situations where you are comfortable with the local security/users;-);-)

-- Glenn
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now