Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cannot run GUI aplications as root from console [SOLVED]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
vladobos
n00b
n00b


Joined: 15 Aug 2005
Posts: 7
Location: Macedonia

PostPosted: Thu Sep 22, 2005 9:38 pm    Post subject: Cannot run GUI aplications as root from console [SOLVED] Reply with quote

When I'm logged as normal user, and when I try to open as root in console some GUI aplication I got error messages. For example with gaim, I got:
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified


(gaim:9834): Gdk-CRITICAL **: gdk_display_get_name: assertion `GDK_IS_DISPLAY (display)' failed

** (gaim:9834): WARNING **: cannot open display: unset
Or with oowriter:
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

/opt/OpenOffice.org/program/soffice.bin X11 error: Can't open display: :0.0
Set DISPLAY environment variable, use -display option
or check permissions of your X-Server
(See "man X" resp. "man xhost" for details)

Obviously it's something with X permisions. Any hints?


Last edited by vladobos on Fri Sep 23, 2005 9:41 pm; edited 1 time in total
Back to top
View user's profile Send private message
Bonkie
Guru
Guru


Joined: 28 Oct 2002
Posts: 501
Location: Antwerpen, Belgium

PostPosted: Thu Sep 22, 2005 9:57 pm    Post subject: Reply with quote

you can only start X apps from the same user, unless you do something linke

Code:
xhost +


this will allow all users (even on network) to start X apps from console

Code:
xhost -


disables that.

ps: not very wise to run x apps as root
_________________
"I would say we have a 50% chance of survival, but I consider myself an optimist so I'll give us 50,5% ..."
~ Arthur C. Clarke [Physics PHD,SF Writer], when asked about the chances of the human race's survival
Back to top
View user's profile Send private message
cklimt
n00b
n00b


Joined: 10 Aug 2004
Posts: 39

PostPosted: Thu Sep 22, 2005 11:47 pm    Post subject: Reply with quote

Hi vladobos,

If you use KDE, there is an easy way to launch GUI applications as root: using kdesu. For example, typing this within a console (without being logged as a root) will launch gaim as a root
Code:
$kdesu gaim

After this a window will appear asking for your root password.
_________________
"The aim of computing is insight not numbers"
Back to top
View user's profile Send private message
vladobos
n00b
n00b


Joined: 15 Aug 2005
Posts: 7
Location: Macedonia

PostPosted: Fri Sep 23, 2005 9:40 pm    Post subject: Reply with quote

Thank you both!
Back to top
View user's profile Send private message
Vortex375
Veteran
Veteran


Joined: 03 Mar 2005
Posts: 1739
Location: Deutschland

PostPosted: Fri Sep 23, 2005 10:17 pm    Post subject: Reply with quote

Quick question:
xhost + returns the following for me:

Code:
xhost +
access control disabled, clients can connect from any host



I'm quite happy with this setting but where can I change it (just in case)?
Back to top
View user's profile Send private message
crudh
l33t
l33t


Joined: 12 May 2005
Posts: 696
Location: Sundbyberg, Sweden

PostPosted: Fri Sep 23, 2005 11:36 pm    Post subject: Reply with quote

If you're using the xhost solution, use:

Code:
xhost +localhost


instead. This only allows users from the same machine starting X applications.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum