LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 06-04-2005, 12:14 PM   #1
sw67
Member
 
Registered: Oct 2004
Location: Here
Distribution: Slackware 12, openSuSE 11.0, XP
Posts: 76

Rep: Reputation: 15
Question Root can't open display, but normal user can?


Hi,
I'm using Slackware 10.1 with a 2.6.10 kernel.
If I load up Fluxbox (or KDE, whichever GUI it doesn't matter), load up a terminal and run something like xine, it works perfectly in my user.
However, if I go su and then try and run xine (or anything that tries to use X) I get an error message:

Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Cannot open display

Any ideas? I need to be able to run programs as root in the GUI really.
Thanks
 
Old 06-04-2005, 12:17 PM   #2
vharishankar
Senior Member
 
Registered: Dec 2003
Posts: 3,142
Blog Entries: 4

Rep: Reputation: 121Reputation: 121
Had this problem in debian as well.

The best solution would be to use sux (su in X) or su-to-root (or any other graphical su like gksu, kdesu and so on).

Last edited by vharishankar; 06-04-2005 at 12:20 PM.
 
Old 06-04-2005, 12:27 PM   #3
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 52
you can also type " xhost + " in a console as user.
that gives others permission to use the graphics.

egag
 
Old 06-04-2005, 12:31 PM   #4
vharishankar
Senior Member
 
Registered: Dec 2003
Posts: 3,142
Blog Entries: 4

Rep: Reputation: 121Reputation: 121
Quote:
you can also type " xhost + " in a console as user.
that gives others permission to use the graphics.
Yes. But I don't think it's quite as clean a solution as using a graphical su program to launch GUI apps.

But both methods should work well for you.

Just remember to run the xhost + every time you reboot or save this in your bootup script in /etc/rc.d.
 
Old 06-05-2005, 10:25 PM   #5
slackwh0re
LQ Newbie
 
Registered: Oct 2003
Posts: 16

Rep: Reputation: 0
kde already has a "run as root" GUI interface.

but yeah, basically i would normally do the xhost command mentioned above as it can be tedious typing the root password many times.
 
Old 06-05-2005, 11:20 PM   #6
aaa
Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 46
Or this better way:

export DISPLAY=:0 #assuming it wasn't set already
xauth merge ~user_in_x/.Xauthority

Also "xhost +local:" is better than just "xhost +", but not as good as the above. The above xauth command only allows root to use X, "xhost +local:" allows anyone locally at the computer, "xhost +" allows anyone who can connect to your computer. And the xauth usually only works as root and the xhost only works as the user currently in X.
 
Old 06-06-2005, 12:48 AM   #7
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 51
Just wanted to add, I'm sure you must know this, but just in case, you can startx as root. And if you've display 0 running with your user, you can use startx -- :1 to open another X server (can access it with CTRL+ALT+F8).
 
  


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
Can't su into root as normal user darin3200 Linux - General 13 03-18-2010 12:03 PM
cant open firefox as normal user silverstormboy Debian 2 01-09-2005 08:58 AM
Games runs slow as normal user, but fast as root user mcore Linux - Software 2 06-08-2004 12:11 AM
Root and normal user Smooth Linux - Newbie 4 05-27-2003 11:15 AM
root user can't open display chr15t0 Linux - General 7 01-28-2003 08:34 AM


All times are GMT -5. The time now is 03:44 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration