LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 09-17-2007, 06:57 PM   #1
JohnE1
Member
 
Registered: Jun 2007
Location: Houston, TX
Distribution: Fedora, CentOS, Ubuntu
Posts: 66

Rep: Reputation: 16
Question DISPLAY var troubles running GUI apps remotely


Machine: Sun Ultra SPARC III
O/S: Solaris 9

When SSH'ing into Solaris 9 I am able to run most gui apps.
However, some of the really important apps we need to run from client workstations require the DISPLAY var be set.

sshd_config is using the defaults.

I've tried:

Hostname:0.0
Hostname:1.0
localhost:1.0

and various other combinations of the hostname and localhost with various screen settings.

Any suggestions?

Thanks!

John
 
Old 09-18-2007, 12:49 AM   #2
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
This is confusing. If you run GUI applications, you DISPLAY variable is already set.
 
Old 09-18-2007, 09:12 AM   #3
juergen
Member
 
Registered: Sep 2001
Posts: 40

Rep: Reputation: 16
At the very least, you'll need X11Forwarding set to yes in your sshd_config. Also, you need to either set ForwardX11 to yes in your ssh_config or use the corresponding switch when running ssh (typically -X).

That ought to set your DISPLAY automatically.
 
Old 09-18-2007, 09:37 PM   #4
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
What they said. You shouldn't have to be messing around with setting the display. If you make the ssh connection with the option to tunnel X11 back, and you have the configuration on the Solaris side set to permit this, then, when you launch an app, it should just send the display back to you.

However, you have to have your client side set up appropriately as well. For example, if I am doing it from Mac OS X, I cannot do it from the terminal application. It doesn't support it. I have to launch X11, open an xterm window, and make the ssh connection from xterm.

Similarly, in Windows, you have to have an X11 environment from which to make the ssh connection. A commercial example is Hummingbird.

From Linux it ought to be more natural, but I haven't done it, so I can't tell you exactly.

Anyway, your ssh command has to be `ssh -X servername` to set up the tunneling.

On the Solaris 9 server, you have to find the line in /etc/ssh/sshd-config that has X11Forwarding and make sure it is uncommented and =yes. Remember to HUP sshd so that it picks up the change.

And, finally, there was a bug in sshd on Solaris 9 that caused it to core dump if you connected with a request to do X11Forwarding. If you are totally up on recommended patches, that won't happen. If it does, you won't be able to connect, and you will find the core dump error in the /var/adm/messages log. Then you will have to go get the appropriate patch. If that is the case, and you can't find it, post again and I will search my records for it.
 
Old 09-18-2007, 09:51 PM   #5
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
hmm. Looking back at your post, you say that most gui apps work. This would imply you have everything set up right, but that you have some apps that are abnormal and don't really follow the rules.

You wouldn't be talking about the Oracle installation and admin gui would you? I'm recalling that that was a pain in the butt. One would think it should be 0.0, but did you try just plain 0? It's altogether possible that the way Oracle has done it messes up the forwarding.

further hmm. http://orafaq.com/wiki/Setting_up_X_forwarding_over_SSH

yeah, I know, you never said Oracle was the one that was causing you trouble. But it's a good example of weirdness and doing things differently.
 
Old 09-19-2007, 01:52 PM   #6
JohnE1
Member
 
Registered: Jun 2007
Location: Houston, TX
Distribution: Fedora, CentOS, Ubuntu
Posts: 66

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by jlliagre View Post
This is confusing. If you run GUI applications, you DISPLAY variable is already set.
Maybe this will help clear up some confusion.

When I issue: echo $DISPLAY
it returns nothing, indicating the DISPLAY var is not set.

All I can figure is that some apps are explicitly attempting to read the DISPLAY var and since it's not found, they issue a warning and abort. Other apps, just run and their GUI interface pops right up.

Last edited by JohnE1; 09-19-2007 at 01:54 PM.
 
Old 09-19-2007, 03:17 PM   #7
JohnE1
Member
 
Registered: Jun 2007
Location: Houston, TX
Distribution: Fedora, CentOS, Ubuntu
Posts: 66

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by choogendyk View Post
hmm. Looking back at your post, you say that most gui apps work. This would imply you have everything set up right, but that you have some apps that are abnormal and don't really follow the rules.

You wouldn't be talking about the Oracle installation and admin gui would you? I'm recalling that that was a pain in the butt. One would think it should be 0.0, but did you try just plain 0? It's altogether possible that the way Oracle has done it messes up the forwarding.

further hmm. http://orafaq.com/wiki/Setting_up_X_forwarding_over_SSH

yeah, I know, you never said Oracle was the one that was causing you trouble. But it's a good example of weirdness and doing things differently.
FYI, the app is not Oracle. The app is the latest Synopsys installer. The old installer never had this problem, but to install the latest Synopsys packages I have to run the latest installer. Further digging revealed that installer is actually a C shell script and that's where the DISPLAY var is being checked and that's where the DISPLAY warning message is hard-coded.

I took a look at that link you pasted above and that info is about a UNIX SSH client. In my scenario, Solaris 9 is the SSH Server and a Windows XP machine running PuTTY and Xming is the SSH client.

Speaking of weirdness, I have narrowed down the problem. Just for the heck of it I tried to run the installer as a regular user. Lo and behold, it ran and up came the GUI.

However, no matter what I do to the login config (.profile) of the superuser (su -), I can not get the GUI app to display for me as superuser. I added DISPLAY= and export DISPLAY to the .profile in the machine's root directory (/). Now I don't get the DISPLAY var is not set error message, but depending on the value I assign to DISPLAY, the installer either runs and hangs, or it aborts right away with no error/warning messages.

I've done everything short of modifying sshd_config to allow for root logins. I have a hunch that if I were to login in directly as root, the installer would run and the GUI would come up. Of course, I don't want to open up the ssh server to root logins.

Conclusion: The installer script works, because it's able to bring up the installer GUI correctly for the user that logged in via the SSH connection. ONLY users on a secondary login via the su command:

su - # regular superuser
su - root # explicitly logging in as root via su
.
.
.
etc.

are having the problem!

Suggestions?

JohnE

Last edited by JohnE1; 09-19-2007 at 03:25 PM.
 
Old 09-19-2007, 08:37 PM   #8
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
Just to clarify one thing. You are working on a Unix system. It is only the initial ssh command that is occurring on your Windows machine. So the items in the link I posted earlier were relevant from that perspective.

When you say that `echo $DISPLAY` returns nothing, is that as the user you logged in as? Or is that as the root user after you su? Ah, you later say it fails only after su.

For whatever it's worth, I just did `ssh -X marlin` on my network. Then I did `/usr/ucb/printenv` and among the environment variables printed out was "DISPLAY=marlin:10.0". Then, when I did `su -` followed by `/usr/ucb/printenv`, I did not get DISPLAY.

So, as root after the su, I did the following:

# DISPLAY=marlin:10.0
# export DISPLAY
# /usr/openwin/bin/xclock

What I got was an error:

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

So, given this situation, I think your next best bet might be to try sudo. If you can get the application to run with sudo, then *maybe* it will send back the display. Otherwise, you may just have to open up X11 between the two machines and forget about trying to do X11 forwarding through ssh. You might be able to find some other way of securing or restricting X11.
 
Old 09-19-2007, 08:53 PM   #9
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
Wow. The power of the right idea and keyword in google.

I just googled "x11forwarding ssh after su", AND, the very top link was this:

http://www.debian-administration.org/articles/494

which explains about a "magic cookie" that carries the authentication information. Display that before `su -` so that you know what it is, then set it after `su -` and X11Forwarding "magically works." I didn't have to patience to try it, because xterm won't copy/paste for me, the delete key doesn't work when I make a typo, and the magic cookie is a huge long mess of random stuff. I almost never use xterm, so . . .

Anyway, there were other links as well that looked good. I did get as far as `/usr/openwin/bin/xauth list $DISPLAY` and it looked just like the link described.
 
Old 09-21-2007, 07:37 PM   #10
JohnE1
Member
 
Registered: Jun 2007
Location: Houston, TX
Distribution: Fedora, CentOS, Ubuntu
Posts: 66

Original Poster
Rep: Reputation: 16
Cool DISPLAY var X11 Troubles SOLVED!!!!!!!!

Quote:
Originally Posted by choogendyk View Post
Wow. The power of the right idea and keyword in google.

I just googled "x11forwarding ssh after su", AND, the very top link was this:

http://www.debian-administration.org/articles/494

which explains about a "magic cookie" that carries the authentication information. Display that before `su -` so that you know what it is, then set it after `su -` and X11Forwarding "magically works." I didn't have to patience to try it, because xterm won't copy/paste for me, the delete key doesn't work when I make a typo, and the magic cookie is a huge long mess of random stuff. I almost never use xterm, so . . .

Anyway, there were other links as well that looked good. I did get as far as `/usr/openwin/bin/xauth list $DISPLAY` and it looked just like the link described.
Thanks, choogendyk! You pointed me in the right direction. xauth was not found when I tried to run it, so I read quite aways down that Debian thread till I came across a real simple, yet effective solution.



Here are the instructions I followed below. The only thing extra I did was to make a backup of /.Xauthority before modifying it.

##### COPIED FROM DEBIAN LIST #####

ssh ip -X -l snot
echo $DISPLAY
copy the output
su -
cat /home/snot/.Xauthority >.Xauthority
export DISPLAY="paste the output of echo $DISPLAY here... without quotes"

##### END OF INSTRUCTIONS #####

This worked for me!!

Addendum: DISPLAY var settings
------------------------------
By default, Solaris sshd_config sets the X11DisplayOffset to 10
echo $DISPLAY of main login returned HOSTNAME:11.0

You rock, choogendyk--thanks for your help!!

John

Last edited by JohnE1; 09-22-2007 at 09:07 AM. Reason: Added DISPLAY var setting info
 
  


Reply

Tags
display, remote, solaris, ssh, x11, x11forwarding



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
problems running gtk apps remotely spuzzzzzzz Linux - Software 7 02-29-2008 08:46 PM
Can't start GUI in local zone, DISPLAY var problem? kebabbert Solaris / OpenSolaris 1 09-04-2007 10:01 AM
/var/log files deleted causing no GUI display for administration teacmalaysia Linux - Software 6 06-05-2006 10:33 AM
Can't figure out DISPLAY and GUI apps from remote console. bkeating Linux - Newbie 1 04-29-2004 02:18 PM
remotely running X apps JustinHoMi Linux - Networking 1 04-30-2001 02:39 PM

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

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