Operating System - HP-UX
1820299 Members
2975 Online
109622 Solutions
New Discussion юеВ

DISPLAY problems with ReflectionX

 
Samo_2
Occasional Advisor

DISPLAY problems with ReflectionX

Hi,
This is my problem.When I connect from my PC to HP-UX through ReflectionX and when I type export | grep DISPLAY, I get IP from my PC, and I can start GUI without any problems.But when I login from this hp-ux to another hp-ux, and when I type export | grep DISPLAY, I get the name of the hp-ux and I can not start GUI.How can I setup in the .profile to export DISPLAY="IP of PC I am connecting through ReflectionX":0.0
I can not just type in the IP because I am not the only one using this hp boxes.Is there a way to get IP from PC.Thanks for your answers.
Samo
18 REPLIES 18
Jerome Baron
Respected Contributor

Re: DISPLAY problems with ReflectionX

Hi,

# who am i -R command give you your remote IP.

Regards,
Jerome
Robert-Jan Goossens
Honored Contributor

Re: DISPLAY problems with ReflectionX

Hi Samo,

add the lines to you $HOME/.profile

# -- Do trick to set the display in case of remote login
HOST=`who am i -R |awk '{print $NF}' | sed "s/(\(.*\))/\1/"`
if [ "$HOST" != "" ] && [ "$HOST" != ":0" ] && [ "$HOST" != ":0.0" ];
then
if [ "$HOST" = `who am i -R |awk '{print $NF}' | sed "s/(\(.*\))/\1/"` ]
then
HOST=$HOST:0.0
fi
echo " +--<<"
echo " | Remote login detected, setting DISPLAY to $HOST"
echo " +-->>"
DISPLAY=$HOST
export DISPLAY
fi

Robert-Jan.
CCIL
Frequent Advisor

Re: DISPLAY problems with ReflectionX

Hi
You must be invoking the Reflection X client from your PC to HP server , from there you are telneting into the other HP unix box ? if yes the you wont get the GUI , if any applicxation you want to invoke like glance which is GUI based on the other HP server , then just export DISPLAY , the dispaly will be your HP server IP from where you telneted .

Amit Vichare
Steve Steel
Honored Contributor

Re: DISPLAY problems with ReflectionX

Hi

Indeed it is on your original login only.

Either when you login to reflection the first time you need to save a file in your .dtprofile which contains your current display.

Or on the second machine


echo $(remsh firstmachine who -uR|grep -v old|grep $LOGNAME|tail -n 1)|read line
set $(echo $line)
export DISPLAY=$8":0.0"
echo $DISPLAY

Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Samo_2
Occasional Advisor

Re: DISPLAY problems with ReflectionX

Hi "Robert-Jan Goossens",
I have copyed you answer and tried it but it does not work because DISPLAY is still exporting to machine to which I connect with ReflectionX. DISPLAY at least I think so should be pointing to my PC.If I type export DISPLAY="IP_of_my_PC":0.0 then it works.
Robert-Jan Goossens
Honored Contributor

Re: DISPLAY problems with ReflectionX

Hi Samo,

Just reread your question, think you are logging in from your PC to UNIX (this working good) DISPLAY is set to you PC, but if you logging in to another UNIX host your DISPLAY has been set to the first HPUX host.

If This is the case then you have to set your DISPLAY manualy export DISPLAY=PCipadress:0.0

Hope it helps,

Robert-Jan.
Samo_2
Occasional Advisor

Re: DISPLAY problems with ReflectionX

Hi Steve,
Thanks for your answer, I tryed what you wrote but this does not work because command who -uR does not sort it's output by last access.So when I use "tail -n 1" the output I get is not necessary the right one.But thanks anyway.
Samo_2
Occasional Advisor

Re: DISPLAY problems with ReflectionX

Manually setting I know but the problem is that I am not the only one using this so everybody else in the company will have to type this and if it is possible I would like to avoid this.The only "solution" I know is to configure Reflection on every PC so they have this command "export DISPLAY=IP:0.0" maped to one button(example F1).But that is a lot of work for me.
Robert-Jan Goossens
Honored Contributor

Re: DISPLAY problems with ReflectionX

Samo,

What conf do you use on your PC's to get an ipadress (dhcp,dns ??) ?
Bill Hassell
Honored Contributor

Re: DISPLAY problems with ReflectionX

The DISPLAY variable must always match the IP address of your display device (ie, your PC). Change the who options to:

who -muR

and then extract the last field, something like this:

export DISPLAY="$(/usr/bin/who -muR | awk '{print $NF}'):0.0"

However, the who command only reports on the incoming address, so if you telnet to cpu1 and then on to cpu2, cpu2 will return cpu1 as your DISPLAY, not your PC. There is no scriptable way to track back to your original PC.

BTW: telnetting through many machines is a really bad idea! The problem is that you may remove some files or perform some maintenance on the wrong machine. Initiate each system as a separate window and the DISPLAY will be set correctly.


Bill Hassell, sysadmin
Samo_2
Occasional Advisor

Re: DISPLAY problems with ReflectionX

We do not use dhcp, and we have static IP's
Samo_2
Occasional Advisor

Re: DISPLAY problems with ReflectionX

To Bill,
Is it possible, if you know to start two different Reflection sesions.Problem is that I MUST be logedin to both system and must run GUI on both.
Robert-Jan Goossens
Honored Contributor

Re: DISPLAY problems with ReflectionX

Hi Samo,

add the ipadress in the $HOME/.profile

export DISPLAY=pc-ipadress:0.0

Robert-Jan.
Steve Steel
Honored Contributor

Re: DISPLAY problems with ReflectionX

Hi

I am using reflection and I can only get 1 session at a time .

It will reset the current session otherwise.

You can do it with linux easily.

If before you telnet to another box you do

echo $DISPLAY > /tmp/$LOGNAME"newhostname"

export DISPLAY=$(cat /tmp/$LOGNAME$(hostname)

will always work


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Wodisch
Honored Contributor

Re: DISPLAY problems with ReflectionX

Hi Samo,

if you do not worry about NOT using your WRQ Reflection/X any more, why not go for the "CYGWIN" version of X?
It is free, it is stable, it is way more up to date than WRQ, and you can run multiple session s on your PC.
And of course there is an OpenSSH available (free, again) from CYGWIN, so that you can run your X sessions encrypted over SSH tunnels.
Each session on your PC gets another server number, so for the UN*Xs, one is using the DISPLAY on :0, the next on :1, and so on, but all on your PC.

FWIW,
Wodisch
Kellogg Unix Team
Trusted Contributor

Re: DISPLAY problems with ReflectionX

Samo,

You can open 2 xterm windows from your ReflectionX to 2 different hosts and the DISPLAY will be set to your PC automatically. Maybe you are opening CDE session on one server and then , are unable to open another session ofr 2nd host.

I use ReflectionX and use it in this way and can have 2 separate displays from 2 different machines (e.g. SAM from 2 servers on my PC)

HTH
...Manjeet
work is fun ! (my manager is standing behind me!!)
Bill Hassell
Honored Contributor

Re: DISPLAY problems with ReflectionX

The key in understanding Xwindows and multiple systems is that CDE (the fancy desktop manager) can only be run from one machine. Reflection/X defaults to starting the CDE desktop so starting another CDE session from another system doesn't make much sense. Now in CDE, when you pick a terminal window, that window is resident on the CDE host and you are interacting with the CDE host, just as if you ran a telnet session to that first machine.

However, when you then telnet from the host1 window over to host2, you are telling host1 to talk to host2 and host2 knows nothing about your PC. This can get REALLY confusing, so I recommend dumping the CDE desktop (it's a monster on the network) and simply using telnet to each box as needed (assuming you don't use any graphics programs. just text-based commands). The best way is to NOT use the PC's telnet (which usually defaults to a very dumb Hyperterminal) but to use Reflection/1 (aka, Reflection for HP). This is a different program from Reflection/X. It is strictly a terminal emulator and should be set to HP2392A, and telnet connection.

Now you can start as many sessions as you want--the PC handles each window separately and DISPLAY is no longer needed because the program is local. Reflection for HP has a very powerful (but easy to use) macro recorder that can create an auto-login for each machine. And once you've used HP smart terminals for SAM and swinstall, you'll never look back at dumb vt100 stuff again. WRQ emulation is at version 10 and includes OpenSSH as a standard feature. This is especially true for remote support via modems. If anyone wants some info on how to use Reflection/1 for HP in the HP-UX environment, write me at blhconsulting@mindspring.com


Bill Hassell, sysadmin
ooi
Advisor

Re: DISPLAY problems with ReflectionX

Hello,

I have the same question:

1. Reflex from my PC to a HPUX box1. GUI works fine.
2. Telnet/rlogin from the HPUX box1 to another HPUX box2. Export DISPLAY with HPUX box1 IP. Run "sam" but no display. I tried to run xhost + at HPUX box2 but cannot open display on HPUX box1.
3. I cannot export DISPLAY to my PC IP as the HPUX box2 cannot see my PC. In different subnet.

Please advise what shall I do? Thanks.