LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-20-2003, 01:51 PM   #1
chr15t0
Member
 
Registered: Jun 2002
Location: London
Distribution: Slackware
Posts: 201

Rep: Reputation: 30
root user can't open display


I have been having problems with this for ages now...ane never figured out what's going on. The problem is that I can't run Gnome applications as root. Here is an example of what happens when the root user tries to run galeon:

bash-2.05a# galeon &
[1] 17824
bash-2.05a# Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

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

[1]+ Exit 1 galeon


okay, so I don't need to run galeon as root anyway, but some apps such as ethereal do require superuser status.

Does anyone know what's going on here?

christo
 
Old 01-20-2003, 01:57 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
run "xhost +localhost"
 
Old 01-20-2003, 02:42 PM   #3
chr15t0
Member
 
Registered: Jun 2002
Location: London
Distribution: Slackware
Posts: 201

Original Poster
Rep: Reputation: 30
thanks chris

chris
 
Old 01-23-2003, 01:27 PM   #4
desbyleo
Member
 
Registered: Feb 2002
Location: Erie, CO
Distribution: Red Hat 7.1
Posts: 94

Rep: Reputation: 15
Hey chris...what if when I do xhost + and I get "xhost: not found"? I'm trying to start the VNC server on my box and when I start it, the log (../hostname:1.log) says, "xhost: unable to open display hostname:1"
 
Old 01-23-2003, 01:37 PM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well if that's a file not found error, mine is in /usr/X11R6/bin/xhost, so check you've nto got a path issue, assuming it's there somewhere - use whereis, find or locate.
 
Old 01-23-2003, 01:57 PM   #6
desbyleo
Member
 
Registered: Feb 2002
Location: Erie, CO
Distribution: Red Hat 7.1
Posts: 94

Rep: Reputation: 15
Sorry about the double post...

Anyhow, I found xhost (/usr/X/bin), but when I issue the command:

xhost +myhostname

I get:

/usr/X/bin/xhost: unable to open display ""
 
Old 01-23-2003, 07:51 PM   #7
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
Quote:
Originally posted by desbyleo
Sorry about the double post...

Anyhow, I found xhost (/usr/X/bin), but when I issue the command:

xhost +myhostname

I get:

/usr/X/bin/xhost: unable to open display ""
Try doing it as the user who runs the X server from within an xterm. You should be able to put it in your .xinitrc too, if one exists.

Or if you're running 'su -' to become root and running your app within the root shell,
export XAUTHORITY=~<xuser here>/.Xauthority
before your run your app. Put it in root's .profile if you want it to stick.
 
Old 01-28-2003, 07:34 AM   #8
Xi9
LQ Newbie
 
Registered: Jan 2003
Distribution: Debian / Gentoo
Posts: 1

Rep: Reputation: 0
root user can't open display

edit your /etc/X11/gdm/gdm.conf
You'll find a line which start your X :
X -a-lot-of-options
add "-ac" to this line.

Restart your gdm
/etc/init.d/gdm stop
/etc/init.d/gdm start

log as normal user. Su as root
export your display :
export DISPLAY=:0

try with xterm.

JG.D.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot open display as root tethysgods Linux - Software 14 12-10-2010 03:16 PM
only root can open the display for mplayer shobhit Linux - Software 5 06-16-2005 03:34 PM
Root can't open display, but normal user can? sw67 Slackware 6 06-05-2005 11:48 PM
Can't open display as root dicou Linux - Newbie 7 04-18-2005 02:25 PM
root cannot open display m_yates Linux - Software 7 03-14-2004 10:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:35 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
Open Source Consulting | Domain Registration