LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices



Reply
 
Search this Thread
Old 07-29-2008, 06:23 AM   #1
noir911
Member
 
Registered: Apr 2004
Location: Baltimore, MD
Posts: 681

Rep: Reputation: Disabled
Running GUI app as root (via SSH)


I ssh -X username@server to a Solaris 9 box as a normal user and su - to root and run /path/to/program and it says "Error: Can't open display:"

Does anyone know what I need to do to be able to run this program? Thanks.
 
Old 07-29-2008, 07:33 AM   #2
crisostomo_enrico
Member
 
Registered: Dec 2005
Location: Madrid
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547

Rep: Reputation: 35
If you su to root I think that the variable DISPLAY will not be set, while it will be set in the environment of the user which connects via ssh (you can try an
Code:
echo $DISPLAY
to check it). If that's the case, you should set it to whatever it should be, such as:
Code:
DISPLAY=youmachine:yourscreen
for example
Code:
DISPLAY=192.168.1.1:0
Hope this helps,
Enrico
 
Old 07-30-2008, 02:17 AM   #3
noir911
Member
 
Registered: Apr 2004
Location: Baltimore, MD
Posts: 681

Original Poster
Rep: Reputation: Disabled
Thanks for your help. As normal user when I do echo $DISPLAY
I get localhost:14.0. I su - to root and do export DISPLAY=localhost:14.0
and when I run the GUI app it says -

X11 connection rejected because of wrong authentication.
X connection to localhost:14.0 broken (explicit kill or server shutdown).

My local machine's echo DISPLAY is set to ":0.0" and tried to set the DISPLAY on the server as export DISPLAY=/my-local-machine's IP:0.0/ and run my GUI app again and it hangs in there - I don't see anything.

Running the GUI app as a normal user still works fine.

Any further help would be much appreciated. Thanks.
 
Old 07-30-2008, 03:51 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,523

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
The behaviour you observe is expected. The X server thinks root is trying to hijack your user's X session.
Try using "su" not "su -" to keep your environment.
 
Old 07-31-2008, 01:52 AM   #5
noir911
Member
 
Registered: Apr 2004
Location: Baltimore, MD
Posts: 681

Original Poster
Rep: Reputation: Disabled
Thanks all for your help. I can now get the GUI.
 
  


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
Strange X errors when running any app with a GUI bruno321 Ubuntu 3 03-12-2007 10:29 AM
Asking for root privileges in a GUI app sleeping Programming 4 09-07-2006 01:57 PM
Problems mounting on boot | running app as root Ephracis Mandriva 0 07-12-2005 07:18 AM
Unable to run a GUI app as root using su? vharishankar Linux - General 7 05-25-2005 09:08 AM
Running more than one app at once from SSH DaDdY SnEb Linux - General 4 11-09-2002 07:28 PM


All times are GMT -5. The time now is 04:39 PM.

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