LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-06-2004, 07:58 AM   #1
mmail75
LQ Newbie
 
Registered: Nov 2003
Distribution: Fedora Core
Posts: 20

Rep: Reputation: 0
can't use x apps when i do "su -"


When I become superuser in my user account (for this, i type "su -"), i can't use any program that use X server.
I get different errors, depending on the program I try to run.
For example:

lykos:~ # kwrite
kwrite: cannot connect to X server

but if I do the same not being superuser, I can open kwrite (the same happens with every program, with similar error messages). The "funny" part is that when i type kwrite in su, i do it on X, not in text-only mode, i mean, i do it in my console.

I'm on a laptop and SUSE (fresh install, performed several times) can't autodetect my monitor, but I selected LCD 1024x768@60Hz.

Also, if i login to root (normally, at login screen, not by doing su -) it loads X with no aparent problems.

Thank you everyone for your help!!! :-)
 
Old 10-06-2004, 09:02 AM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Try running:

$ kdesu kwrite
 
Old 10-06-2004, 09:20 AM   #3
mmail75
LQ Newbie
 
Registered: Nov 2003
Distribution: Fedora Core
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks! I'm going to try it now.
 
Old 10-06-2004, 10:54 AM   #4
mmail75
LQ Newbie
 
Registered: Nov 2003
Distribution: Fedora Core
Posts: 20

Original Poster
Rep: Reputation: 0
Thank you very much! It worked for me.
Although I prefer to use "su -", this workaround is great.

Thanks again!
 
Old 10-06-2004, 09:24 PM   #5
IBall
Senior Member
 
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088

Rep: Reputation: 62
As root, try running the command
Code:
/usr/X11/bin/xhost +
This will allow your root user to connect to the X server. You will have to do this every time though...

--Ian
 
Old 10-07-2004, 08:37 AM   #6
mmail75
LQ Newbie
 
Registered: Nov 2003
Distribution: Fedora Core
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks IBall, I'll try this tonight.

Just one question, is there any way of running this command automatically at startup?

Hope it will be the solution!

:-)
 
Old 10-07-2004, 02:23 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally posted by IBall
As root, try running the command
Code:
/usr/X11/bin/xhost +
This will allow your root user to connect to the X server. You will have to do this every time though...

--Ian
You're wrong here mate ... the user who runs the
xsession needs to do the xhost + , not the one that
wants to gain access to the display... but it's not
really good practice in the first place.

And he'd still have to export DISPLAY=:0.0 to
be able to get the app to connect to the local
display ...

The kdesu is a pretty good way of doing it.



Cheers,
Tink
 
Old 10-07-2004, 03:22 PM   #8
mmail75
LQ Newbie
 
Registered: Nov 2003
Distribution: Fedora Core
Posts: 20

Original Poster
Rep: Reputation: 0
IBall, you solution hasn't worked for me :-(

By the moment I can only do that with kdesu, but Tinkster, what can I do to try your solution?

I'm a old-newbie, not a lot of linux knowledge...

Thanks!
 
Old 10-07-2004, 03:38 PM   #9
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Again: you SHOULDN'T :)

For the normal user:
xhost +localhost
You can a) put that in a script and stick it in your
WMs/DEs autostart or b) create a ~/.xsession and
add that line before starting the actual WM to automate
the process...

For root (after su -):
export DISPLAY=:0.0 ...



Cheers,
Tink
 
Old 10-07-2004, 05:05 PM   #10
dave_starsky
Member
 
Registered: Oct 2003
Location: UK, Manchester
Distribution: Gentoo (2.6.10-r4) & Ubuntu
Posts: 145

Rep: Reputation: 16
rather than using "su -" you can use "sux -" and this will let you use X programs
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Telling people to use "Google," to "RTFM," or "Use the search feature" Ausar General 77 03-21-2010 11:26 AM
"Xlib: extension "XFree86-DRI" missing on display ":0.0"." zaps Linux - Games 9 05-14-2007 03:07 PM
Error launching gnome apps as root: " Failed to contact configuration server" Kropotkin Fedora 1 12-16-2005 11:11 AM
Installing Oracle Apps 11i in Redhat 9 - Linux "bad interpreter" error msoares Linux - Newbie 4 07-14-2004 09:45 PM
"no available viewer/app" message despite apps being there neo_bane Linux - Newbie 1 08-08-2003 10:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:27 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