LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-10-2004, 07:32 AM   #1
nyk
Member
 
Registered: Jan 2004
Location: Berne, Switzerland
Distribution: FC4, Gentoo
Posts: 112

Rep: Reputation: 15
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!
 
Old 02-10-2004, 07:58 AM   #2
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
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
 
Old 02-10-2004, 09:08 AM   #3
nyk
Member
 
Registered: Jan 2004
Location: Berne, Switzerland
Distribution: FC4, Gentoo
Posts: 112

Original Poster
Rep: Reputation: 15
thanks, but there's still the same error message....
 
Old 02-10-2004, 09:16 AM   #4
doralsoral
Member
 
Registered: Aug 2003
Location: raleigh
Distribution: Gentoo 2005.1 x86_64
Posts: 931

Rep: Reputation: 31
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
 
Old 02-10-2004, 09:19 AM   #5
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
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.
 
Old 02-10-2004, 09:39 AM   #6
nyk
Member
 
Registered: Jan 2004
Location: Berne, Switzerland
Distribution: FC4, Gentoo
Posts: 112

Original Poster
Rep: Reputation: 15
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..
 
Old 02-10-2004, 11:23 AM   #7
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
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.
 
Old 02-10-2004, 06:46 PM   #8
nyk
Member
 
Registered: Jan 2004
Location: Berne, Switzerland
Distribution: FC4, Gentoo
Posts: 112

Original Poster
Rep: Reputation: 15
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...
 
  


Reply



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
program console output using C xrado Programming 5 04-04-2005 02:48 PM
Can only start program from console, link doesn't work. longblock454 Linux - Newbie 12 02-02-2005 07:18 PM
using console after launching a program off it Lechium Linux - Newbie 3 08-07-2004 02:37 AM
Start program at boot as non-root ImpactDNI Linux - Newbie 4 07-18-2004 12:44 PM
Getting a program to start with root privileges when a user logs in. joeking Linux - Security 4 10-24-2003 11:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:38 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
Open Source Consulting | Domain Registration