Using PuTTY and Xming for X11 Forwarding
The X Window System, or X11, is the window server for Linux. If you’ve used a desktop Linux distribution like Fedora or Ubuntu, you’ve used X11. Desktops like GNOME and KDE are displayed by X11. Programs that you open on a Linux desktop are displayed by X11.
Usually, when you want to connect to your Linux computer from a remote location, you do so with SSH (Secure Shell). SSH lets you make a secure terminal connection to your Linux computer and use the command line. But, wouldn’t it be cool to connect to your remote Linux computer and use its fancy graphical interface? This tutorial will show you how to connect to a remote Linux computer from Windows and use the X11 graphical interface using two free programs, PuTTY and Xming.
PuTTY is a free SSH client that allows you to connect to a remote Linux computer and use the command line. PuTTY can also be used to forward secure data over SSH to other programs. This is called tunneling. We’re going to be taking advantage of PuTTY’s ability to tunnel X11 data. To do that, we first need to install PuTTY.
- Download putty.exe to your Windows desktop from the following address:
- There is no installer. Putty.exe is a self-contained executable program. Put it someplace you can easily find it, and make a desktop shortcut to it if you like. I usually put it in C:\Program Files.
Creating a PuTTY Session to Connect to Your Remote Linux Computer
When you connect to your remote Linux computer, you will need to set several connection settings to make everything work correctly. PuTTY lets you save these settings in a session so you can reuse them the next time you connect. We’ll make a session that allows PuTTY to forward your Linux computer’s X11 graphical interface over SSH.
- Open PuTTY on your Windows desktop.
- PuTTY will open and display the Session panel.
- In the Host Name field, type the hostname or IP address of your Linux computer.
- In the field underneath the Saved Sessions label, type a name for your saved session.
- Under the Connection category, expand SSH and choose X11.
- Click the Enable X11 Forwarding checkbox.
- Go back to the Session category and click Save to save your session connection settings.
Xming is a free X Window server for the Windows desktop. With Xming, you can display graphical applications from your remote Linux computer on your Windows desktop. To take advantage of Xming’s capabilities, we’ll need to first install it.
- Download the Xming installer to your Windows desktop from the following address:
- Look for the Xming link under Public Domain Releases.
- Run the Xming setup program on your Windows desktop. When selecting components to install, make sure the following are selected:
- XLaunch Wizard (selected by default)
- Normal PuTTY Link SSH Client (selected by default)
The makers of Xming have provided a simple utility called Xlaunch that allows you to configure Xming easily, and also save your configuration for future use. To run Xming, open XLaunch and select the configuration you wish to use. We’ll use the configuration that follows.
- Open XLaunch from the program menu.
- Select Multiple Windows and click Next. This tells Xming to open each remote Linux application in a new window.
- Select Start No Client and click Next. This tells Xming to launch and wait for commands from another program (like PuTTY).
- Make sure that Clipboard is selected and click Next. This tells Xming to enable your remote Linux applications to share a unified clipboard.
- Click the Finish button to launch Xming.
Launching Graphical Applications from your Remote Linux Computer
Now that Xming is running, you can open your PuTTY session and launch a graphical application. My Linux computer is running Fedora 12 with the Gnome desktop. I’m going to launch my remote Linux computer’s calculator on my Windows desktop through the SSH connection using X11 forwarding.
- Open PuTTY.
- Double-click on the saved session you created earlier. PuTTY will create an SSH connection to your remote Linux computer.
- Login to your Linux computer.
- Type gcalctool at the command prompt and hit enter.
- If everything worked correctly, your remote Linux computer’s calculator should appear on your desktop. Cool, huh?
If you have any questions, please feel free to ask in the comments section below.