HOW-TO: X11 forwarding using ssh, putty and Xming

I’ve been using this combination on a daily basis for more than a year now, and I can’t stress enough how really useful it is. I use it both at home and at work, and everything is very easy and – most importantly – absolutely free.

X11 forwarding with SSH

X11 Forwarding with ssh is a wonderful feature which allows you get windows of a remotely started applications shown on your own desktop. For Windows, there are lots of pretty good albeit expensive products like Citrix, GoGlobal and XWin32, which allow you access your remote Unix desktop sessions. But in reality, if you don’t need any sessions but only want to remotely start an application and get a window from it on your desktop, you won’t need any of these expensive products – the easiest will be to use X11 forwarding and Xming.


Xming is an X Windows port for Microsoft Windows. Essentially it’s an X-server which starts transparently on top of your MS Windows desktop. It allows you to redirect graphical output of applications you run on remote Unix servers and therefore see these applications windows on your MS Windows desktop.

Xming is very simple and easy to use. All you have to do is download its distribution archive from the project’s page on SourceForge: XMing @ SourceForge.

After you install it, I recommend you have a quickstart panel shortcut created for it, and have your command line altered to something like this:

"C:Program FilesXmingXming.exe" :0 -clipboard -multiwindow

Configure SSHd for X11 forwarding

Now that you have Xming installed, start it and it’s time to take care of the ssh side of things. We have to alter the ssh daemon config file: /etc/ssh/sshd_config. Just ensure that it has the following:

# X11 tunneling options
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

If you already have similar parameters, don’t do anything. But if you had to change the config file, it’s time to restart ssh:

solaris# svcadm restart svc:/network/ssh

All that’s left now is to download the wonderful free Putty client, that is if you’re not using it yet. You can get it here:
Putty: a free telnet/ssh client.

I won’t go into all the Putty configuration details, I’ll only mention that for X11 forwarding, you have to do the following: in the main configuration window of Putty (you get it when you start Putty), select Connection section, then SSH, then X11, and make sure you tick the Enable X11 Forwarding option.

That’s it, you’re good to go! Good luck!


  1. Laszlo Meszaros says:

    Putty 0.60 doesn’t have tickbox for x11.

    • Hi Laszlo, can you confirm where you’re searching for it? I have x11 and it’s 0.60 I use, so you should have it there as well – Connections, SSH, X11 forwarding.

  2. I have stopped using vnc ever since this blog.

  3. wes parham says:

    I find it (somewhat buried) under
    |+ Connection
    in the configuration for puTTY ( 0.60, too ) when you start a new session.

  4. wes parham says:

    oops! Duplicated Gleb’s answer! Thanks to the author here for the info!

  5. In the Putty Configuration panel, look at the item:
    (Connection | SSH | X11) “Enable X11 forwarding” Checkbox.

  6. I tried to connect Xming to get gradsc through Putty (by checking Enable X11 forward, and typing “xlocalhost:0.0” or “” at X display location. I received the following message:
    GX Package Initialization: Size = 11 8.5
    X connection to localhost:11.0 broken (explicit kill or server shutdown).

    Can you tell me how to fix it?
    Thanks. Happy New Year.


  7. Putty 6.0 have.

    Putty doesn`t show tickbox for X11 in case connection is established and you choose “Change Settings…”

    But it is there after puuty is started and before connection is established.

    • NavyFlyer1325 says:

      As Yurijs says, the PuTTY 0.65 “Change Settings” dialogue shows the tickbox for X11 after PuTTY is started, but before the remote connection is established, and, only if Xming is already running on my Win7 Host.

      But you must also enter the IP address or hostname of the VM or host you want to connect to in the “Session” dialogue, before executing the “SSH/X11” dialogue, or the “SSH/X11” dialogue will not save your configuration entries, nor open the connection to your host. The window just sits there and beeps at you.

      I fought this for a good while before I realized that “Open” in the “SSH/X11” dialogue meant “open the connection to the VM”, and I realized that I had not supplied the IP address yet.

      Everything now seems to be up and running well, now, except for Komodo-Edit not being a standard part of the Ubuntu repository.

  8. Just wanted to say thanks for this. Couldn’t get it working until I found your article here.
    Used this same process on openSUSE 11.1
    To restart SSH I used the command
    /etc/init.d/sshd restart


  9. This is great stuff. I have it working nicely from my windows machine. Do you have a solution where if I put my startup icon for xming {xlaunch.config} on a citrix server and allow 3 people access to the same Icon that hardcodes Display 0; does xming have a feature where it will increment Display value from 0 to the next available port so the next person executing it on citrix will get the xwindows display to their client. I’ve been racking my brain on this one.

  10. Loren Osborn says:

    Or the more modern accepted practice (running as a normal user with sudo access):

    sudo /sbin/service sshd restart

    it really does exactly the same thing as above:
    sudo elevates your privileges to root for one command only.
    “service” is simply a script to manage all the scripts in /etc/rd.d/init.d, but as it’s not in the path of normal users (and, as root, it’s safer to be explicit) you use /sbin/service
    All the scripts in /etc/rd.d/init.d generally respond to the four possible commands: start stop restart status. These scripts are each responsible for knowing how to safely shutdown and startup their respective daemons.

  11. Works perfectly with Putty on Win7 and Ubuntu Server. Didn’t even have to edit sshd_config.

  12. Hello.

    I was wondering if anybody has succeeded with running “ssh -X” command from the windows command prompt instead of using etc Putty.? I can’t get it to work. The session complains on the display not being correct.

  13. How to configure Xming in windows XP(client) to view SOlaris 9 sparc

  14. Rich ElHombre says:

    Thanks for this! very clear. If I am not a Linux admin, is there another way to get SSH tunneling and forwarding set up, maybe just for my ID?

  15. Thanks this was great help today!

  16. Perfect!!!
    But i have a Solaris9? Are you have a step by step to configure x11 in Solaris 9?

  17. Ketakatata says:

    I have a problem  with xming …it was working on win7 …but now I am  trying to log in using my setting but i fail every time .. i do not know what might happened?

  18. OK that works.
    But how do you configure Xming to NOT listen on network interfaces and use X11 Forwarding via SSH tunnel only?

  19. hardik soni says:

    hey i end up with error “Gtk: Warning **window **: cannot open display” how to solve this ?

  20. hey i end up with error “Gtk: Warning **: cannot open display” how to solve this ?


  1. […] HOW-TO: X11 forwarding using ssh, putty and Xming | Solaris Blog – November 10th ( tags: x11 ssh linux putty howto windows forwarding security xming ) […]

Speak Your Mind