LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 04-18-2005, 02:41 PM   #1
dicou
Member
 
Registered: Apr 2004
Location: Paris
Posts: 44

Rep: Reputation: 15
Can't open display as root


Hello everybody,
i have a debian (stable) (installed from the knoppix live cd 3.7),
when i am on my user account, everything is allright,
but when i use the super user account,
i can't open anything that use X,
it's a bit annoying, so if anybody can help me, it'll great!
Thx a lot!
 
Old 04-18-2005, 02:47 PM   #2
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: SuSE, Ubuntu
Posts: 3,513

Rep: Reputation: 58
In kde, try to use 'kdesu <command>'. Otherwise you'll need to use the xhost command and export the display (sorry, I don't know the exact procedure).
 
Old 04-18-2005, 02:50 PM   #3
dicou
Member
 
Registered: Apr 2004
Location: Paris
Posts: 44

Original Poster
Rep: Reputation: 15
thks for your reply,
but i dont want to use kde,
im actually with fluxbox,
thks
 
Old 04-18-2005, 02:59 PM   #4
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: SuSE, Ubuntu
Posts: 3,513

Rep: Reputation: 58
You could use ssh: ssh -X -l root localhost
This should allow root to use the X-server. Otherwise it would look something like
Code:
xhost +localhost
su
<password>
export DISPLAY=localhost:0
<start x application>
If you still get display export errors, you may need to change /etc/X11/xdm/Xservers:
remove '-nolisten tcp' from the display you would like to use.
 
Old 04-18-2005, 03:09 PM   #5
dicou
Member
 
Registered: Apr 2004
Location: Paris
Posts: 44

Original Poster
Rep: Reputation: 15
dicou@home:~$ xhost +localhost
xhost: unable to open display ""

I think its because 2 days ago i did a : export DISPLAY=10.0.0.4 then i did unset DISPLAY,
but when i do 'env' it write :
HZ=100
SHELL=/bin/bash
TERM=xterm
USER=root
MAIL=/var/mail/root
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin:/usr/games
PWD=/home/dicou
LANG=C
SHLVL=7
HOME=/root
LANGUAGE=us
LOGNAME=root
_=/usr/bin/env

so DISPLAY is not set to nothin "", i do not understand.

Then,

dicou@home:~$ ssh -X -l root localhost
ssh: connect to host localhost port 22: Connection refused



But thks anyway
 
Old 04-18-2005, 03:18 PM   #6
pevelius
Member
 
Registered: Mar 2004
Location: Tampere, Finland
Distribution: Debian, Familiar, OS X
Posts: 145

Rep: Reputation: 16
as far as i know, root cannot use gui in default install of debian. but i am newb too. anyway, if i am correct, someone should know how to enable it.
you should post your question in debian forum.
 
Old 04-18-2005, 03:19 PM   #7
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: SuSE, Ubuntu
Posts: 3,513

Rep: Reputation: 58
As long as you don't export the DISPLAY variable in /etc/profile or ~/.bashrc, the setting will not be permanent.

I guess ~$ is a root-prompt? You need run xhost as user. I wasn't successful with the above procedure myself. The following worked:
Code:
user@linux:~>xhost +
access control disabled, clients can connect from any host
user@linux:~>su
<password>
linux:/home/user # export DISPLAY=:0.0
linux:/home/user # <whatever>
 
Old 04-18-2005, 03:25 PM   #8
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
markus@mrk-fujibox:~$ echo $DISPLAY
:0.0
markus@mrk-fujibox:~$ xhost +local:
non-network local connections being added to access control list
markus@mrk-fujibox:~$ su
Password:
root@mrk-fujibox:/home/markus# export DISPLAY=:0.0

I have in ~/.kde/Autostart/kufbootstuff.sh the following:
xhost local:
If you don't use KDE you can put it in .bashrc or .xsession or where ever.

And in roots ~/.profile:
export DISPLAY=:0.0
 
  


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
cannot open display as root tethysgods Linux - Software 14 12-10-2010 04:16 PM
only root can open the display for mplayer shobhit Linux - Software 5 06-16-2005 04:34 PM
root cannot open display m_yates Linux - Software 7 03-14-2004 11:49 PM
bashrc not read by root, can't open display SerfurJ Slackware 6 12-05-2003 11:54 PM
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 04:28 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration