LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Can't start program using X in root console! (https://www.linuxquestions.org/questions/linux-software-2/cant-start-program-using-x-in-root-console-144403/)

nyk 02-10-2004 07:32 AM

Can't start program using X in root console!
 
When starting a program that uses X as user from the console everything works perfectly. But when I become root with su and then try to strart the same program, it fails with this message:
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Error: Can't open display: :0.0

I am using Suse 9.0 AMD64 with a nvidia card and driver. This problem appears for example when I want to use the graphical installer of crossover-office, to install into another directory than the home.
Thank for any help!

HappyTux 02-10-2004 07:58 AM

Re: Can't start program using X in root console!
 
Quote:

Originally posted by nyk
When starting a program that uses X as user from the console everything works perfectly. But when I become root with su and then try to strart the same program, it fails with this message:
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Error: Can't open display: :0.0

I am using Suse 9.0 AMD64 with a nvidia card and driver. This problem appears for example when I want to use the graphical installer of crossover-office, to install into another directory than the home.
Thank for any help!

Try in the console window either export Display=0.0 or export Display 0.0 I think is is the first one that is the correct syntax

nyk 02-10-2004 09:08 AM

thanks, but there's still the same error message....

doralsoral 02-10-2004 09:16 AM

your problem is that your loggin in the X server as user so root cant access it. im not sure if theres a way around it. maybe xnest although im not sure exactly what it does because ive never used it

Hangdog42 02-10-2004 09:19 AM

You need to use the xhost command to allow root access to X. Check out man xhost for the fine details on how to do it.

nyk 02-10-2004 09:39 AM

cool, thanks verry much!

just had to type

xhost local:root

as user... and now it seems to work!!

but it was a stange problem... ;) maybe caused by trying to install some different graphic cards, like ATI and nvidia..

Hangdog42 02-10-2004 11:23 AM

Actually, I don't believe it is a strange problem. I think this is X working as designed. I know I had to add a line like that to my .xinitrc file so I could run graphical apps as root if I needed to. And it certainly doesn't have anything to do with your graphics card.

Glad you got it running.

nyk 02-10-2004 06:46 PM

So maybe it's configured like this in suse (and other distributions), but I was used to Redhat where this is already set in some script probably...


All times are GMT -5. The time now is 05:12 PM.