LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 09-19-2005, 01:20 AM   #1
shadkong
Member
 
Registered: Apr 2005
Location: Guangzhou, China
Distribution: Slackware 10.2
Posts: 114

Rep: Reputation: 15
How to run GUI program as root


In Slackware 10.1, I do it as follow:
$ xhost +<host name>
$ su
# <run it>
But now in Slackware 10.2, I found this way does not work, it says: cannot connect to xxx server. Who can tell me why?
Thanks!
 
Old 09-19-2005, 01:22 AM   #2
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 51
I'm not sure why that's broken but assuming you're using KDE you can just run:
Code:
kdesu command
You can do the same thing by going menu->Run Command and under 'Options' setting 'Run as a different user'
 
Old 09-19-2005, 01:27 AM   #3
shadkong
Member
 
Registered: Apr 2005
Location: Guangzhou, China
Distribution: Slackware 10.2
Posts: 114

Original Poster
Rep: Reputation: 15
I use KDE, but the GUI program that I want to run is not a KDE program, will it work?
 
Old 09-19-2005, 01:39 AM   #4
davidsrsb
Member
 
Registered: Oct 2003
Location: Kuala Lumpur, Malaysia
Distribution: Slackware 13.37 current
Posts: 770

Rep: Reputation: 33
Just tried it and the answer is YES.
Ethereal is one example of a gui program that needs root rights.
 
Old 09-19-2005, 03:28 AM   #5
shadkong
Member
 
Registered: Apr 2005
Location: Guangzhou, China
Distribution: Slackware 10.2
Posts: 114

Original Poster
Rep: Reputation: 15
Yes, it works!
But if I don't use KDE, will it work? If not, what can I do?
 
Old 09-19-2005, 03:47 AM   #6
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 51
Quote:
But if I don't use KDE, will it work?
Yes it will work as long as you have KDE installed - I just tried it then in GNOME.

Also have you tried:
Code:
su -
<run application>
It works on my system (Mandriva 2005LE). The - option means to create a login shell, ie. a shell with all the environment variables set as though you'd logged in as root.
 
Old 09-19-2005, 10:55 PM   #7
shadkong
Member
 
Registered: Apr 2005
Location: Guangzhou, China
Distribution: Slackware 10.2
Posts: 114

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by tkedwards
Also have you tried:
Code:
su -
<run application>
It works on my system (Mandriva 2005LE). The - option means to create a login shell, ie. a shell with all the environment variables set as though you'd logged in as root.
When I use Red Hat 7.2 and Red Hat 9, this method used to work, but it doesn't work in Slackware.
 
Old 09-19-2005, 11:08 PM   #8
Vgui
Member
 
Registered: Apr 2005
Location: Canada
Distribution: Slackware
Posts: 496

Rep: Reputation: 31
Hmm, what window manager are you running? If I do a "su root" it allows me to run X applications. Maybe try "su -c command".

EDIT: This is using Windowmaker 0.9.2 and Slackware 10.2 btw.
 
Old 09-20-2005, 02:24 PM   #9
maginotjr
Member
 
Registered: Aug 2004
Location: BR - Floripa
Distribution: Ubuntu 9.10 - 2.6.x.x
Posts: 661

Rep: Reputation: 34
here I can run any app with any user just login the user in the terminal and them typing the app I want to run.

You can open GTK app on KDE if you have the GTK libraries and KDE app on Gnome if you have the QT libraries, is just a matter of the right libs and files.

if I type:
$su
#./runLime.sh

it runs on KDE without problems

or even
$su
#kview

it runs on Gnome without noproblems too ...

or I can just short the command line with a
$su -c "kview"

[ ]īs
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Can't run gui (X) programs as root user nazdrowie Linux - General 25 12-02-2008 01:24 AM
Unable to run a GUI app as root using su? vharishankar Linux - General 7 05-25-2005 08:08 AM
I can't open gui program in KDE as root shadkong Slackware 5 04-20-2005 12:52 PM
Can't run gui applications as root vdogvictor Linux - General 26 08-19-2004 08:24 PM
Run a program from the GUI k.03 Linux - Newbie 3 04-09-2003 08:44 AM


All times are GMT -5. The time now is 11:53 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration