2

I think I do not understand what X11 forwarding setting in PuTTY does...

When SSH->X11 setting is unticked, but I specify the remote command "export DISPLAY=192.168.32.106:0.0; xterm" under SSH setting, then I can get remote windows displayed on my PC.

If I remove remote command and tick SSH->X11 checkbox and specify 192.168.32.106:0.0 as display location, nothing works. After connection is established:

$ echo $DISPLAY

localhost:10.168

What do I do or understand wrong?

2 Answers 2

7

I should not be necessary to set the DISPLAY environment variable at all, provided the SSH server has defined X11DisplayOffset. Since you're seeing localhost:10.168 (which is bogus) it appears that the SSH server has 10 for that setting, which is a typical default.

Simply tick the SSH > X11 box and establish a connection. Verify the $DISPLAY value on the remote machine, and it should look like this:

$ echo $DISPLAY
localhost:10.0

The display is localhost from the remote machine's point of view because SSH is intercepting that display and forwarding it back over your tunnel to your local machine. Assuming you have an X server running on your local machine, launch an xterm or something on the remote machine and it should pop right up on your local display.

4

PuTTY X11 forwarding wires an SSH tunnel so that X connections at server's localhost:10 are piped to your PC.

  1. The remote X software connects to localhost:10 (localhost at the server)
  2. Server sshd listens to server's localhost:10 and forwards to putty through SSH tunnel
  3. PuTTY forwards X connection from server to localhost:0 (at your PC)

Normally X forwarding just works. Things to check:

  • Is PuTTY allowed to access local X server through :0?
  • Does putty know which X-server to forward to? Can PuTTY see DISPLAY=:0 environment variable?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .