LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 06-08-2007, 12:23 AM   #1
wongdg
Member
 
Registered: May 2006
Location: Kuching, Malaysia
Distribution: Debian 2.4 & 2.6
Posts: 42

Rep: Reputation: 16
Programs refused to run on Xlib error


dg-it-aid-debian:/home/wongdg/downloads/stable i386# wireshark
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified


(wireshark:4927): Gtk-WARNING **: cannot open display:
dg-it-aid-debian:/home/wongdg/downloads/stable i386# karpski
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified


Gtk-WARNING **: cannot open display: :0

Could anyone tell me what is going on here?

Thanks,
Wilson
 
Old 06-08-2007, 01:23 AM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
From what I can see there:
Your running as root; did you su to root? If so, that will not work as the screen is owned by the user that logged in.
So either login in GUI as root (not always permitted) or use xhost +; I saw that command somewhere related to a similar question; never used it however so not sure how to use it.
 
Old 06-08-2007, 08:38 PM   #3
wongdg
Member
 
Registered: May 2006
Location: Kuching, Malaysia
Distribution: Debian 2.4 & 2.6
Posts: 42

Original Poster
Rep: Reputation: 16
tried with virtual terminal 1

I don't know whether both wireshark and karpski are gui based or not. So tried them both in virtual terminal 1 logged in as root.

They returned fewer errors without the Xlib problem:
error Gtk WARNING **: cannot open display

I also tried apt-cache search for xhost but couldn't locate any.

Any advice?
 
Old 06-09-2007, 10:55 AM   #4
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
They more than likely are as they refer to GTK. What do you mean by a virtual terminal; the console when you use i.e. <ctrl><alt><F1>?

PS
xhost should already be there; check man xhost; if it's there, xhost is also there.

Last edited by Wim Sturkenboom; 06-09-2007 at 10:56 AM.
 
Old 06-09-2007, 12:24 PM   #5
dawkcid
Member
 
Registered: May 2007
Location: UK
Distribution: LFS,Slackware,Slamd64,NetBSD
Posts: 102

Rep: Reputation: 15
xhost + is dangerous, it allows ANYONE to access the display. Better to use xhost +localhost.
 
Old 11-19-2007, 06:19 PM   #6
thyrsus
LQ Newbie
 
Registered: May 2006
Posts: 3

Rep: Reputation: 0
Lightbulb XAUTHORITY and sudo

Unless you've given blanket permission to a host (with xhost +hostname),
the X server refuses access to processes that can't provide the secret
credentials. For a normal user, the name of the file with the secret
credentials is held in the XAUTHORITY environment variable, which usually
looks something like this:

[sps@thyrsus-laptop ~]$ echo $XAUTHORITY
/tmp/.gdmB2TZKV

In Fedora 7, the XAUTHORITY environment variable is not normally
preserved by sudo(1), so commands run under sudo don't know where to find the credentials. You can use visudo(8) to edit /etc/sudoers to pass the XAUTHORITY environment variable to the commands it runs. Look for the
setting

Defaults env_keep = .......

Normally only the original user and root can read the $XAUTHORITY file; if
you're trying to do so from some other account, or the file is on a
root_squash NFS file system, you'll have to take other measure to allow
access to the file contents.
 
  


Reply

Tags
sudoers, xauthority, xlib


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
Xlib: connection to ":0.0" refused by server Xlib: No protocol specified eyalkz Linux - Newbie 10 02-07-2014 01:53 AM
error: cannot run C compiled programs. terry.trent Linux - Newbie 6 08-06-2004 12:07 AM
Xlib: connection to ":0.0" refused by server Xlib: No protocol specified eyalkz Programming 1 03-02-2004 09:22 AM
Wine not working. Xlib: connection to ":0.0" refused by server Xerop Linux - General 1 02-18-2004 10:37 PM
Mplayer: [Xlib: connection to ":0.0" refused by server] elluva Slackware 2 12-18-2003 07:12 AM


All times are GMT -5. The time now is 10:18 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration