Operating System - HP-UX
1820390 Members
3407 Online
109623 Solutions
New Discussion юеВ

Re: Export DISPLAY from PC to Unix Boxs

 
ooi
Advisor

Export DISPLAY from PC to Unix Boxs

Hello,

I have this problem:

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.
10 REPLIES 10
Lee Huei
Regular Advisor

Re: Export DISPLAY from PC to Unix Boxs

How did you export the display ? can you try the commands below?

xhost +hostname
export DISPLAY=hostname:0.0

If the PC IP and the hpux machine in different subnet, can you ping from PC to hpux box ? if it can means it can create a connection over to hpux subnet.

Mark Grant
Honored Contributor

Re: Export DISPLAY from PC to Unix Boxs

Your DISPLAY needs to be set to your PC's address for you to see it because that is where your X server is. If host 2 cannot see your PC then you can't run an X application from it.

if the "xhost +" is not set correctly you will get an error message saying "can not open display". If "sam" is just not appearing, that shows that the DISPLAY is not set correctly.
Never preceed any demonstration with anything more predictive than "watch this"
ooi
Advisor

Re: Export DISPLAY from PC to Unix Boxs

Dear Mico,

Thank you for your generous reply. My PC and the HPUX boxes are in different subnet. That's why I need to telnet to HPUX Box1 and and from there telnet to the HPUX Box2. I tried this commands:

export DISPLAY=PC_IP:0.0

from the HPUX Box1 and GUI works fine.

I tried this again from HPUX Box2 (telnet from HPUX Box1):

xhost +HPUX_BOX1
received message: unable to open display ""

I think the problem starts here. Please advise how to resolve this. Thanks.
ooi
Advisor

Re: Export DISPLAY from PC to Unix Boxs

So can I conclude that, as long as your PC and the UNIX boxe are not in the same subnet, you will not be able to run X-application?

I heard NAT can play the routing role? I have an NAT system setup (LINUX) in the same subnet as the HPUX boxes. I telnet to the NAT, telnet again to the HPUX boxe but still cannot access the GUI. Please confirm. ThYu.
Robert-Jan Goossens
Honored Contributor

Re: Export DISPLAY from PC to Unix Boxs

HI Ooi,

If you can login from your PC HP should see your PC.

# who am i -uH
NAME LINE TIME IDLE PID COMMENTS
gorj pts/ta Nov 27 09:56 . 27004 145.x.xx.147

Regards,
Robert-Jan
Mark Grant
Honored Contributor

Re: Export DISPLAY from PC to Unix Boxs

Well, sorry but no, the HP box needs to see your PC.

With regards to NAT, I'm not sure if this is going to help you. Changing the source address through NAT happens after routing. However, if you have a Linux PC that can see both machines and both machines can see it, then you could set up the Linux box as a bridge/gateway so that packets from one subnet can be routed through to the other. If you so this, everything will work fine and it will put a smile on your face.
Never preceed any demonstration with anything more predictive than "watch this"
Mark Grant
Honored Contributor

Re: Export DISPLAY from PC to Unix Boxs

Robert, just so as to not confuse the issue here, I think the questioner can't see host 2 from the PC which is why they log on to host 1 first.

I could be wrong though but that's how I read it.

regards
Never preceed any demonstration with anything more predictive than "watch this"
ooi
Advisor

Re: Export DISPLAY from PC to Unix Boxs

No, I telnet to the HPUX box (2) through another HPUX Box (1). It only can see the HPUX Box (1). The cmd shows the fact. My PC and the HPUX Box (2) are in different subnet. They won't be able to see each other.
Robert-Jan Goossens
Honored Contributor

Re: Export DISPLAY from PC to Unix Boxs

Thanks Mark + sorry Ooi
Elmar P. Kolkman
Honored Contributor

Re: Export DISPLAY from PC to Unix Boxs

There is another way: tunneling. You can use ssh with X-tunneling to login from box1 to box2 and run X-windows applications on box2 with your PC as the display environment.

For this, you have to edit the sshd_config file to support X11forwarding and run the ssh client on box1 with the -X option. And of course the correct DISPLAY setting on box2, depending on the settings in sshd_config.
Every problem has at least one solution. Only some solutions are harder to find.