Monday, December 7, 2009

Use PuTTY and XMing to see Linux graphics via SSH on your Windows computer

Do you use SSH to connect to a remote Linux machine from your local Windows computer?  Ever needed to run a program on that Linux machine that displays graphical output, or uses a GUI? I was in this position last week trying to make figures using ggplot2 in R of results from an analysis of GWAS data which required using a 64-bit Linux machine with more RAM than my 32-bit windows machine can see.

You try plotting something in R on a Linux machine in an SSH session you'll get this nasty error message:

Error in function (display = "", width, height, pointsize, gamma, bg,: 
X11 I/O error while opening X11 connection to 'localhost:10.0'

Turns out there's a very easy way to see graphical output over your SSH terminal.  First, if you're not already using PuTTY for SSH, download putty.exe from here.  Next, download, install, and run Xming.  While Xming is running in your system tray, log into the Linux server as you normally would using PuTTY.  Then type this command at the terminal to log into the linux server of your choice (here, pepperjack), with the -X (uppercase) to enable X11 forwarding.

ssh -X

If all goes well you should now be able to use programs that utilize graphical output or interfaces, which are running on the remote Linux machine rather than your local windows computer.

Xming - PC X Server

Xming download link on SourceForge


  1. Hi,

    I recommend this site:

    to see another way to use Xming with Putty.


    Federico Antico
    PhD Student

    1. thanks for sharing it .. it worked perfectly

    2. Not able to access the link.
      Can you please update..

  2. I have been trying to find a workaround for this problem for ages and never realized just how simple the solution was. Thank you for this.

  3. It is certainly very useful to be able to send a graphical output to a remote Linux machine. Many thanks for this one guys.

  4. "ssh -X server" is not necessary after enabling putty forwarding X11.

  5. Thanks a lot!!

    and thanks to also!

  6. This comment has been removed by the author.

  7. Thanks for the post. It helped a lot. Keep up the good work.

    The link holds an easier fix to this problem ..

  8. How can I save R images generated using putty (linux server) in Xming view ?

  9. thanks.
    Also the following page has very detailed steps about using xming, xshell, putty, tightvnc to display linux gui on windows desktop (x11 forwarding when behind firewall)

    1. Looks like you forgot to add the link.

    2. Sorry, the page is at


Creative Commons License
Getting Genetics Done by Stephen Turner is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License.