LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-09-2003, 03:23 AM   #1
Celorfin
LQ Newbie
 
Registered: Jul 2003
Distribution: Debian sid
Posts: 5

Rep: Reputation: 0
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
 
Old 10-09-2003, 05:15 AM   #2
iainr
Member
 
Registered: Nov 2002
Location: England
Distribution: Ubuntu 9.04
Posts: 631

Rep: Reputation: 30
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.
 
Old 10-09-2003, 11:29 AM   #3
Celorfin
LQ Newbie
 
Registered: Jul 2003
Distribution: Debian sid
Posts: 5

Original Poster
Rep: Reputation: 0
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?
 
Old 10-09-2003, 03:25 PM   #4
iainr
Member
 
Registered: Nov 2002
Location: England
Distribution: Ubuntu 9.04
Posts: 631

Rep: Reputation: 30
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot connect to X server gmh04 SUSE / openSUSE 3 03-25-2005 12:57 AM
Why i can,t connect to X server little_ball Slackware 2 05-25-2004 02:33 PM
Suddenly unable to connect to my web server and my ftp server. HELP! Silly22 Linux - Software 4 05-23-2004 05:42 PM
Cannot connect to X server nickellis Debian 2 02-27-2004 06:34 PM
Is samba required to connect to a Windows Advanced server from RedHat 8.0 server? NemesisStar Linux - Hardware 1 10-20-2003 01:32 AM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration