LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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-07-2007, 11:23 PM   #1
wongdg
Member
 
Registered: May 2006
Location: Kuching, Malaysia
Distribution: Debian 2.4 & 2.6
Posts: 44

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, 12:23 AM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

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, 07:38 PM   #3
wongdg
Member
 
Registered: May 2006
Location: Kuching, Malaysia
Distribution: Debian 2.4 & 2.6
Posts: 44

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, 09:55 AM   #4
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

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 09:56 AM.
 
Old 06-09-2007, 11:24 AM   #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, 05:19 PM   #6
thyrsus
LQ Newbie
 
Registered: May 2006
Posts: 7

Rep: Reputation: 5
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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
Open Source Consulting | Domain Registration