- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Bet you can't solve my $DISPLAY problem
Categories
Company
Local Language
Forums
Discussions
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2002 06:10 AM
08-21-2002 06:10 AM
Bet you can't solve my $DISPLAY problem
Machine2: HP-UX 10.20
Machine3: HP-UX 10.20
(User runs ksh)
PC1: Running XVision X-Terminal Emulator
Here's what I want to be able to do:
1) Log in to Machine1 at the console.
(DISPLAY=Machine1:0.0)
2) Log in to Machine1 at the console.
rlogin to Machine2
(DISPLAY=Machine1:0.0)
3) Log in to Machine1 at the console.
rlogin to Machine2
rlogin to Machine3
(DISPLAY=Machine1:0.0)
4) Log in to Machine1 from PC1.
(DISPLAY=PC1:0.0)
5) Log in to Machine1 from PC1.
rlogin to Machine2
(DISPLAY=PC1:0.0)
Note that the user may have more that one session running on any of the Unix machines e.g. 4) followed by 1) or vice versa.
I'd be very grateful to anyone that can come up with a solution to this problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2002 06:15 AM
08-21-2002 06:15 AM
Re: Bet you can't solve my $DISPLAY problem
What's the issue?
after logging into a machine do this:
export DISPLAY=display:0.0
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2002 06:16 AM
08-21-2002 06:16 AM
Re: Bet you can't solve my $DISPLAY problem
when you rlogin to a machine you pass the TERM variable.
the "trick" consists in modiying the TERM variable before the rlogin , then when you run your /etc/profile on the target machine you analyse your TERM variable (for specific format), reformat your TERM variable and your DISPLAY variable.
e.g
TERM=vt220
before your rlogin
TERM=vt220:$DISPLAY
in your /etc/profile
check for such TERM variable
Jean-Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2002 06:18 AM
08-21-2002 06:18 AM
Re: Bet you can't solve my $DISPLAY problem
remsh machineX /usr/bin/X11/xterm -sl 2000 -ls -sb -cr Wheat -T \`hostname\` -bg MidnightBlue -fg Wheat -fn 7x13 -fb 7x13B -display $DISPLAY &
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2002 06:20 AM
08-21-2002 06:20 AM
Re: Bet you can't solve my $DISPLAY problem
I'm not sure I understood where your problem lies, but if you are using rlogin, you can try this:
remsh $1 -n /usr/bin/X11/hpterm -display $DISPLAY -ls -title $1 -n $1 -sb -sl 500 &
where $1 is the name of the machine you want to go to.
HTH,
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2002 06:21 AM
08-21-2002 06:21 AM
Re: Bet you can't solve my $DISPLAY problem
i am confused with ur problem.
However from my workstation(PC1)
login to machine1
#export DISPLAY=PC1:0.0
works fine
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2002 06:23 AM
08-21-2002 06:23 AM
Re: Bet you can't solve my $DISPLAY problem
If so, you cant really do this, but can make separate ID's.
I.E.
user1
echo "DISPLAY=machine1:0.0 ; export DISPLAY" >>~user1/.profile
echo "setenv DISPLAY machine1:0.0" >>~user1/.cshrc
user2
echo "DISPLAY=pc1:0.0 ; export DISPLAY" >>~user2/.profile
echo "setenv DISPLAY pc1:0.0" >>~user2/.cshrc
Now as long as home directories are shared across the network, just login as user1 or user2. user1 would have the console as the display host, user2 would have the pc.
If home directories are not accross the network, you will have to add the lines above to all of their home dirs.
Regards,
Shannon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2002 06:28 AM
08-21-2002 06:28 AM
Re: Bet you can't solve my $DISPLAY problem
alternatively for setting it for any user anywhere you can do like this
A=`who -T| grep user name | awk'{print $9}'`
export DISPLAY=$A:0.0
this will export the display to whichever machine you log in
Manoj Srivastava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2002 06:34 AM
08-21-2002 06:34 AM
Re: Bet you can't solve my $DISPLAY problem
Shannon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2002 06:34 AM
08-21-2002 06:34 AM
Re: Bet you can't solve my $DISPLAY problem
how would it work when I login to a machine called vpart3 then rlogin to a machine called vpart6:
# who -T
root + console Aug 15 09:20 old 2184 system console
root - ttyp1 Aug 19 07:07 old 21189 10.2.181.64:0.0
root - ttyp2 Aug 21 10:03 0:13 19916 10.2.181.64:0.0
root - pts/0 Aug 21 10:17 . 20104 vpart3.paychex.com
# whoami
root
# tty
/dev/pts/0
# hostname
vpart6
#
4 users with the same name
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2002 06:48 AM
08-21-2002 06:48 AM
Re: Bet you can't solve my $DISPLAY problem
DEVICE=`tty | cut -d / -f3-4`
DISPLAY=`who -HT | grep $DEVICE | awk '{print $9}'`
export DISPLAY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2002 06:49 AM
08-21-2002 06:49 AM
Re: Bet you can't solve my $DISPLAY problem
Manoj Srivastava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2002 07:03 AM
08-21-2002 07:03 AM
Re: Bet you can't solve my $DISPLAY problem
Firstly, I do want to automate the process by putting the variable setup in .profile or something as some of my users don't have access to a shell prompt.
Also, the bit that is being forgotten is where I use my X-Terminal emulator and the DISPLAY variable is set to pc1:0.0, so I can't run remsh to get to my HP-UX box.
I guess looking at the problem closer, I could probably simplify it - the real problem at the moment is my users that don't have access to the shell prompt and who consequently don't do a rlogin to Machine2 or Machine3.
They fall into either scenario 1) or scenario 4) but could have both sessions active at the same time.
Hope this clarifies the problem somewhat.
Thanks again guys,
Gary
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2002 08:05 AM
08-21-2002 08:05 AM
Re: Bet you can't solve my $DISPLAY problem
what do you refer to with "log in from PC1" - which protocol: TELNET, RLOGIN, RSHELL, XDMCP, SSH???
Well, as long as your PC1's hostname appears as the comment on the output of "who am I -u" it should be fairly easy: put these lines into that user's "$HOME/.shrc" (and if you do not have one, create it, and point $ENV to it from that user's "$HOME/.profile"):
if [ -t 0 ]
then # interactive
set +u
who am i -u | read user tty month day time idle pid comment
case "$comment" in
*:*) display="$comment" ;; # already X11
*.*) display="$comment:0" ;; # FQDN, do X11
PC1) display="$comment:0" ;; # from PC1, do X11
*) unset display ;; # no FQDN, no X11
esac
if [ -s "$display" ]
then export DISPLAY=${DISPLAY:-$display}
else export DISPLAY=PC1:0.0 # default
fi
fi
HTH,
Wodisch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2002 01:18 PM
08-21-2002 01:18 PM
Re: Bet you can't solve my $DISPLAY problem
out of the variable REMOTEHOST. Otherwise,
you have to use one of the tricks mentioned by
the other posters.
At my installation we use a script I wrote
called magic_display (attached) which uses
"rusers" to get the value of DISPLAY.
Unfortunately "rusers" will have the same
limitation as "who -T" re: multiple logins.
The script is called from the .login file:
# Automagically set display
if (! $?DISPLAY) then
echo "Trying to determine your DISPLAY (Hit
if ($?REMOTEHOST) then
set DEFAULT_DISPLAY="$REMOTEHOST":0
else
which magic_display >& /dev/null
if ($status == 0) then
set DEFAULT_DISPLAY=`magic_display`
else
set DEFAULT_DISPLAY=none
endif
endif
echo "DISPLAY = ($DEFAULT_DISPLAY) \c"
setenv DISPLAY "$<"
if ("$DISPLAY" == "") setenv DISPLAY $DEFAULT_DISPLAY
if ("$DISPLAY" == "none") unsetenv DISPLAY
if ($?DISPLAY) then
echo "DISPLAY is set to $DISPLAY"
else
echo "DISPLAY is not set"
endif
unset DEFAULT_DISPLAY
endif
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2002 02:31 PM
08-21-2002 02:31 PM
Re: Bet you can't solve my $DISPLAY problem
See if this helps.
on machine 1 be sure you either
xhost + (to disable access list to all hosts)
Or xhost + (each system name to add them all)
on all Unix boxes
export DISPLAY=machine1:0.0 (like Harry mentioned)
Hopefully you can now open GUI's for each UNIX box on machine1.
I have never used XVision, but if it is anything like Reflection X be sure:
XDMCP is set to broadcast (or direct with the appropriate IP_addres set)
You have the proper entries in your equivalent of C:\winnt\system32\drivers\etc\hosts and C:\reflect\user\xhost
and that TCP is set for the system IP_address or auto detect
(Again these are assumably different for XVision, but should give you settings to look for.)
Good luck,
Kel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2002 10:30 PM
08-21-2002 10:30 PM
Re: Bet you can't solve my $DISPLAY problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2002 12:05 AM
08-22-2002 12:05 AM
Re: Bet you can't solve my $DISPLAY problem
Do a search using key word "xhost" you will get solution.
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x9dc579bffde7d4118fef0090279cd0f9,00.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2002 01:27 AM
08-22-2002 01:27 AM
Re: Bet you can't solve my $DISPLAY problem
I thought I'd cracked it there for a moment. The "who am i -u" command looked like it would allow me to do what I wanted to do. I tried it both from the Unix console and via my Xterm on my PC (XDMCP) and it looked fine. So, I changed my script and than it just wouldn't log me in at all!
It seems that the "who am i -u" works as root (how I first ran it), but not when run as a normal user. (It complains of the usage and lists the options).
Both root and user are using /usr/bin/who.
Any suggestions?
Thanks,
Gary
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2002 03:12 AM
08-22-2002 03:12 AM
Re: Bet you can't solve my $DISPLAY problem
I was starting to write this.(BELOW ->)..when I had a "moment"...:
I'm sorry, but how is xhost going to help set his DISPLAY variable? He's NOT having connection issues, he's having issues with getting the DISPLAY variable to work correctly....
(so ignore that paragraph and read on...)
So I flashed back to Gary's last comment about not being able to LOGIN. Boy this is something new. Why wasn't this part of the original issue?
Gary, you have a script to login to another machine? Could you kindly POST that script so that we can see what the hell is going on?
If you are using xterm on the remote host you can use the -display option to set the DISPLAY!!!
thanks,
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2002 03:43 AM
08-22-2002 03:43 AM
Re: Bet you can't solve my $DISPLAY problem
The terminal type specified by the current TERM environment variable
is propagated across the network and used to set the initial value of
your TERM environment variable on the remote host. Your terminal baud
rate is also propagated to the remote host, and is required by some
systems to set up the pseudo-terminal used by rlogind (see
rlogind(1M)).
SO LOOK AT THE FOLLOWING:
$> export TERM="iamcrazy"
$> rlogin HOST2
$>> echo $TERM
$>> iamcrazy
THIS IS POSSIBLE, BUT YOU NEED TO EDIT THE PROFILES.
So what you should do before the first rlogin:
export TERM=`who am i -u | awk '{print $8}'
Then, on all systems you should precede the TERM-settings in the /etc/profile and .profile (don't forget /etc/skel/profile for each new user):
change it to:
export DISPLAY=$TERM
TERM=""
..old set-term procedure..
I tested it and works just fine. And if you don't like to set each time the TERM value before each rlogin, then make your own rlogin:
PATH=/usr/local:/usr/bin
/usr/local/rlogin:
export TERM=`who am i -u | awk '{print $8}'
/usr/bin/rlogin $1
Regards,
Ceesjan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2002 04:11 AM
08-22-2002 04:11 AM
Re: Bet you can't solve my $DISPLAY problem
This is quite like my post yesterday !
Use the TERM variable to transport the necesary information.
Jean-Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2002 04:20 AM
08-22-2002 04:20 AM
Re: Bet you can't solve my $DISPLAY problem
But you and me both agree that this trick can be used. Now i just don't understand why you only got 3 points.. this solution not appriciated?
Greetings,
Ceesjan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2002 04:39 AM
08-22-2002 04:39 AM
Re: Bet you can't solve my $DISPLAY problem
Jean-Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2002 04:44 AM
08-22-2002 04:44 AM
Re: Bet you can't solve my $DISPLAY problem
I suspect that you are saying is correct when doing an rlogin (and my complete solution would ideally cope with this scenario as well), however, my main focus at the moment is for my users that don't (can't) do an rlogin. I.e. how to set up DISPLAY when XDMCP'ing from my PC/X-Term emulator and also when logging on at the console.
Thanks,
Gary