Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 05-15-2005, 12:44 PM   #1
Registered: Oct 2004
Distribution: Gentoo/FBSD/Slack
Posts: 65

Rep: Reputation: 15
Post xhost issues and the fix

Ever since I switched to slackware (BTW I'm a slack die hard now) I've been having issues w/ being able to start some apps as root. Let me give you a basic layout of my system first.

OS: Slackware 10.1
Kernel: 2.4.29
GUI: XFCE 4.2.1 (compiled from src not the preinstalled binaries from the slack dist cd (as they do not include everything)

Now I start XFCE from the "/usr/local/bin/startxfce" cmd as a user (in my case thats "xaero")
xaero@biggeek #: /usr/local/bin/startxfce &
xaero@biggeek #:
XFCE will start normally and attach itself to *:0.0 as expected.

Once XFCE starts I would start an "xterm" session that looked like this

if I tried to start a user space app it would start and wait till I exited the app and return the prompt to me. On some occasions I would need to start an app w/ root privileges it would fail and give me an error msg such as this:

root@biggeek: ~# Terminal

(Terminal:9416): Gtk-WARNING **: cannont open display:
to fix this I did the following

1. I created a file called xhost1 and put it in /home/xaero/bin
2 I added this to my /root/.profile
export DISPLAY=0:0

the contents of /home/xaero/bin/xhost1 is:
xhost +localhost
xhost +biggeek
xhost +
xhost +

So now all I need to do is su - to root and run the cmd I want and it will work.

Hopefully this will solve anyone's issues w/ xhost issues in the future
Old 05-15-2005, 12:55 PM   #2
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 245Reputation: 245Reputation: 245
My question would be, why are you needing to run applications in X as root to begin with? On a more secure note and I have a fetish with people who login with su - root since your still using root's password to login, users should just setup and use sudo and if they really need to launch an X program as root, instead of specifying a list of hosts that are all the same host, just do a "xhost +" and that allows all to launch the application when logged into X as one user and launching the application as another.



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
Redhat Mail issues- Transport filter process failed -Will Pay$$ for fix. rixride00 Linux - Software 1 07-20-2005 07:10 AM
cpu load problem. Some issues to fix it? gottin Linux - General 4 09-04-2004 05:26 PM
FC2 MBR Fix issues -- strange sfdisk output Alterscape Fedora - Installation 0 07-16-2004 11:04 AM
News: LG Issues Fix to Revive Dead LG Drives kilgoretrout Mandriva 0 11-13-2003 09:05 AM
[NOT REALLY LINUX RELATED] How do i fix loopback issues? vbp6us Linux - General 3 04-20-2003 01:55 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:46 PM.

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