LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 07-29-2008, 05:23 AM   #1
noir911
Member
 
Registered: Apr 2004
Posts: 682

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, 06:33 AM   #2
crisostomo_enrico
Member
 
Registered: Dec 2005
Location: Madrid
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547

Rep: Reputation: 36
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, 01:17 AM   #3
noir911
Member
 
Registered: Apr 2004
Posts: 682

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, 02:51 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
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, 12:52 AM   #5
noir911
Member
 
Registered: Apr 2004
Posts: 682

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


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

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

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