I want to connect to a Linux server from my Windows 7 desktop. I can successfully ssh in, but I want the equivalent of "ssh -X", so that I can open GUI programs and actually see them.

migrated from stackoverflow.com Jun 19 '11 at 9:12

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

You can enable X11 Forwarding in Putty's configuration. In the menu on the left, find the Connection tree. In SSH, expand it and you will see Tunnels window. Click "Enable X11 forwarding". It is setting the default to X display at "localhost:0".

Of course, the server you are connecting to also needs to be properly configured.

Hope this helps and good luck.

  • 5
    Of course, you also need an X11 server running on the computer with putty, so the remote programs have a way to display their GUIs. – Ben Voigt Jun 19 '11 at 1:58

you will need a xserver like xming running as well.

Personally i just tend to use mobaxterm and ssh-x in that cause its a fair bit simpler

  1. Install a Xserver. Your free options are Xming, XSRV and Cygwin/X. Personally I use the free version of Xming, because I primarily work in the command line, and my needs for intensive graphics is not too much, and I know Xming works. The version of Xming I use is from 2007, and while Xming is still being actively developed, the latest version 7.7 is no longer available without paying a donation to the author. XSRV and Cygwin/X is more well maintained, but I havent used it.

  2. In Putty, under SSH>X11, you need to make sure that you "Enable X forwarding" and set the display to the server "X display location := localhost:0". You can also check that everything is working by doing "echo $DISPLAY" once you log in through SSH. If the graphics is being forward correctly to the Xserver, then it should read the variable DISPLAY should have the value :10 or :0. The values can vary somewhat, depending on how many X sessions you have running: https://unix.stackexchange.com/questions/10121/open-a-window-on-a-remote-x-display-why-cannot-open-display

  3. Try the program "xeyes" or "xclock", which will display a GUI, for testing purposes.

I think you are much better off by installing cygwin with the xserver and openssh, otherwise installing the x server can be too much of a hassle.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.