System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with export DISPLAY between hosts. How to troubleshoot it?

 
SOLVED
Go to solution
mar_q
Occasional Advisor

Problem with export DISPLAY between hosts. How to troubleshoot it?

Hello.

I've faced problem to open an application.

I usually didn't have this sort of problem in different systems.

Now.

I have unix machine down in the lab (let's assume IP like 1.2.3.4.)

I connect to it from my Windows PC using X client software  -  to emulate unix environment (so to be as if I am on the console).

I'm logged in and have common desktop view of the machine. Fine.

I'm doing test. I fire xclock command. It works for me fine. I see graphical clock immediately.

Now.

I do command

xhost + 2.3.4.5 #where 2.3.4.5 is next unix machine

and now I connect to second unix machine ( 2.3.4.5) using telnet.

I do export of display (to the unix machine which I emulate on my PC) command like

export DISPLAY=1.2.3.4:0.0

 The connection looks like:

( myPC(Xclient)  -> connection to -> unix1.2.3.4 -> telnet to unix -> 2.3.4.5 )

 

I fire xclock command and it takes a while and after that I receive message

 

Error: Can't open display: 1.2.3.4:0.0
Error: Couldn't find per display information

 

What's wrong in that? How I can troubleshoot it.

 


 

Thanks for any help.

3 REPLIES
Steven Schweda
Honored Contributor
Solution

Re: Problem with export DISPLAY between hosts. How to troubleshoot it?

> [...] from my Windows PC using X client software [...]

      echo $DISPLAY

So, that shows the name or IP address of your Windows system?

> export DISPLAY=1.2.3.4:0.0

   But the display (X server) is your Windows system, not the "unix
machine down in the lab".  If you want things displayed on the X server
on your Windows system, then DISPLAY should specify _that_ X server, not
anything on any other system.

   If, instead of Telnet, you were using SSH with X tunneling, then this
would not be true, but in that case, DISPLAY should be set
automatically, and so you wouldn't need to set DISPLAY at all.

Matti_Kurkela
Honored Contributor

Re: Problem with export DISPLAY between hosts. How to troubleshoot it?

Unlike Windows Remote Desktop, an X display is not controlling the remote system's console display - it's more like setting up a completely separate display and GUI environment for you. Also, there is no need to have any specific service running on the remote system for X connections: each X application will individually make a connection to your display (the Xclient software on your PC).

 

When you run "xhost + 2.3.4.5", the xhost command on 1.2.3.4 communicates with the Xclient software on your PC and tells it to allow connections from 2.3.4.5. This is possible because connections from 1.2.3.4 are already allowed.

 

When you telnet to system 2.3.4.5 and set DISPLAY=1.2.3.4:0.0, you're telling 2.3.4.5 to send the xclock display to the console of 1.2.3.4, not to your PC.

 

Perhaps 1.2.3.4 is not running a GUI on its local console, or is not allowing remote windows to be projected on its console, or a network firewall blocks connections from 2.3.4.5 to port 6000/TCP on 1.2.3.4.

 

You should determine the value of the DISPLAY variable on 1.2.3.4, with e.g. "echo $DISPLAY". Then, after telnetting to 2.3.4.5, you should set DISPLAY to the same value it had on 1.2.3.4. The value should include the name or IP address of your PC, so the X applications on 2.3.4.5 will contact Xclient on your PC directly, without going through 1.2.3.4 at all.

 

If direct connections from 2.3.4.5 to port 6000/TCP of your PC are not possible, you would need something that can act as a X proxy. The simplest solution would probably be to use SSH: if 2.3.4.5 has a sshd daemon running (and configured to allow X forwarding, which is usually the default), and 1.2.3.4 has a SSH client available, you could run "ssh -Y username@2.3.4.5" (or "ssh -X username@2.3.4.5" on older SSH versions) on 1.2.3.4 and have the X connection forwarded automatically. As an added benefit, the connection between 1.2.3.4 and 2.3.4.5 would be encrypted for maximum security - including the X traffic.

MK
mar_q
Occasional Advisor

Re: Problem with export DISPLAY between hosts. How to troubleshoot it?

Hello Guys.

Thank you very much for hint.

You both were right.

If I do hop from my PC to 3th server (via another server) I need to set display of PC anyway or my x client.

I confused things a little bit.

Thank you again!