LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   cant start x programs when under root (https://www.linuxquestions.org/questions/linux-software-2/cant-start-x-programs-when-under-root-222263/)

hylke 08-25-2004 12:28 PM

cant start x programs when under root
 
Hello
I cant start x programs under root.
This is what i get when i wanna start xcdroast to configure it:
Quote:

hylke@hylke:~$ su
Password:
root@hylke:/home/hylke# xcdroast
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified


Gtk-WARNING **: cannot open display: :0.0
Does anybody knows how to fix that?
Thanx Hylke

slackie1000 08-25-2004 12:33 PM

hi there...

you need to export the DISPLAY variable..


Code:

setenv DISPLAY $HOSTNAME:0.0

should to the trick..


regards

slackie1000

hylke 08-25-2004 12:50 PM

Quote:

Originally posted by slackie1000
hi there...

you need to export the DISPLAY variable..


Code:

setenv DISPLAY $HOSTNAME:0.0

should to the trick..


regards

slackie1000

It says:
root@hylke:/home/hylke# setenv DISPLAY $HOSTNAME:0.0
bash: setenv: command not found

slackie1000 08-25-2004 01:49 PM

my mistake!!
i didn't read that you use a bash terminal :cool:
you need...

Code:

set DISPLAY=$HOSTNAME:.0.0
hope it is correct now..
$HOSTNAME => you should give your machine name..

regards

slackie1000

hylke 08-26-2004 07:14 AM

It still doesn't works:
Quote:

hylke@hylke:~$ su
Password:
root@hylke:/home/hylke# set DISPLAY=hylke:.0.0
root@hylke:/home/hylke# xcdroast
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified


Gtk-WARNING **: cannot open display: :0.0
root@hylke:/home/hylke# hostname
hylke
Hylke

slackie1000 08-26-2004 08:17 AM

trying again...

i am sorry for the delay... no experience with bash...
i tested now... :D

Code:

env DISPLAY=$HOSTNAME
regards

slackie1000

ps. you can test your environment variables in "bash" typing "env". You should see the DISPLAY corrected assigned.

hylke 08-26-2004 11:49 AM

Still doesn't work, but the display mode is (i gues) correctly set.
bash:
Quote:

root@hylke:/home/hylke/Desktop/Teacher Killer# xcdroast
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified


Gtk-WARNING **: cannot open display: :0.0
root@hylke:/home/hylke/Desktop/Teacher Killer# env
CPLUS_INCLUDE_PATH=/usr/lib/qt/include:/usr/lib/qt/include
MANPATH=/usr/local/man:/usr/man:/usr/X11R6/man:/usr/lib/java/man:/usr/lib/qt/doc/man:/usr/share/texmf/man
KDE_MULTIHEAD=false
HOSTNAME=hylke.digitaldevil.com
TERM=xterm
XDM_MANAGED=/var/run/xdmctl/xdmctl-:0,maysd,mayfn,sched,method=classic
WINDOW_MANAGER=metacity
GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/hylke/.gtkrc-2.0:/home/hylke/.kde/share/config/gtkrc
GS_LIB=/home/hylke/.fonts
GTK_RC_FILES=/etc/gtk/gtkrc:/home/hylke/.gtkrc:/home/hylke/.kde/share/config/gtkrc
WINDOWID=33554437
QTDIR=/usr/lib/qt
KDE_FULL_SESSION=true
USER=hylke
LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01; 32:*.bat=01;32:*.BAT=01;32:*.btm=01;32:*.BTM=01;32:*.cmd=01;32:*.CMD=01;32:*.com=01;32:*.COM=01;32:* .dll=01;32:*.DLL=01;32:*.exe=01;32:*.EXE=01;32:*.arj=01;31:*.bz2=01;31:*.deb=01;31:*.gz=01;31:*.lzh= 01;31:*.rpm=01;31:*.tar=01;31:*.taz=01;31:*.tb2=01;31:*.tbz2=01;31:*.tbz=01;31:*.tgz=01;31:*.tz2=01; 31:*.z=01;31:*.Z=01;31:*.zip=01;31:*.ZIP=01;31:*.zoo=01;31:*.asf=01;35:*.ASF=01;35:*.avi=01;35:*.AVI =01;35:*.bmp=01;35:*.BMP=01;35:*.flac=01;35:*.FLAC=01;35:*.gif=01;35:*.GIF=01;35:*.jpg=01;35:*.JPG=0 1;35:*.jpeg=01;35:*.JPEG=01;35:*.m2a=01;35:*.M2a=01;35:*.m2v=01;35:*.M2V=01;35:*.mov=01;35:*.MOV=01; 35:*.mp3=01;35:*.MP3=01;35:*.mpeg=01;35:*.MPEG=01;35:*.mpg=01;35:*.MPG=01;35:*.ogg=01;35:*.OGG=01;35 :*.ppm=01;35:*.rm=01;35:*.RM=01;35:*.tga=01;35:*.TGA=01;35:*.tif=01;35:*.TIF=01;35:*.wav=01;35:*.WAV =01;35:*.wmv=01;35:*.WMV=01;35:*.xbm=01;35:*.xpm=01;35:
XCURSOR_SIZE=
KDEDIR=/opt/kde
SESSION_MANAGER=local/hylke:/tmp/.ICE-unix/1273
T1LIB_CONFIG=/usr/share/t1lib/t1lib.config
MINICOM=-c on
KONSOLE_DCOP=DCOPRef(konsole-1311,konsole)
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin
DESKTOP_SESSION=kde
LC_COLLATE=C
PWD=/home/hylke/Desktop/Teacher Killer
INPUTRC=/etc/inputrc
KONSOLE_DCOP_SESSION=DCOPRef(konsole-1311,session-2)
JAVA_HOME=/usr/lib/java
LANG=en_US
PS1=\u@\h:\w\$
PS2=>
HOME=/root
SHLVL=3
LS_OPTIONS= --color=auto -F -b -T 0
XCURSOR_THEME=default
LOGNAME=hylke
LESS=-M
LESSOPEN=|lesspipe.sh %s
DISPLAY=:0.0
COLORTERM=
_=/usr/bin/env
Hylke

slackie1000 08-26-2004 02:21 PM

Quote:

Originally posted by hylke
Still doesn't work, but the display mode is (i gues) correctly set.
bash:


Hylke


i give up... sorry .... no idea how to solve this... hope some of the gurus around can help you...

regards

slackie1000

idaho 08-26-2004 11:45 PM

You are getting refused by the server. Try invoking
xhost +
to allow foreign connections to your X server before switching to root user.

After switching to root, you can set your $DISPLAY variable, if necessary, under bash by invoking:
export DISPLAY=hostname:0.0

hylke 08-27-2004 10:07 AM

Thanx
That xhost + did the trick.
Hylke


All times are GMT -5. The time now is 08:19 AM.