Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
add comment

migrated from stackoverflow.com Jul 21 '11 at 19:53

This question came from our site for professional and enthusiast programmers.

2 Answers

up vote 7 down vote accepted

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.

share|improve this answer
add comment

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?
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.