X11 Forwarding using XMing and SSH Client
Xming (http://freedesktop.org/wiki/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 *nix servers and therefore see these applications windows on your MS Windows desktop. Xming is very simple and easy to use. You can download its distribution archive from the project’s page on SourceForge: XMing @ SourceForge (http://sourceforge.net/projects/xming).
This article explains on how to use Xming to run graphical applications on remote *nix servers and see the output on your windows desktop
- Linux server with X11 applications
- Xming – http://sourceforge.net/projects/xming
- Putty (SSH Client) – http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Installation of Xming
- Download and run the current setup executable available from http://sourceforge.net/projects/xming/files/Xming-mesa/188.8.131.52/Xming-mesa-6-9-0-31-setup.exe/download. You will see the following intro screen. Click [Next].
- The default installation location is recommended. Click [Next].
- The following installation components should be fine for most users. Also, we recommend installing PuTTY separately. Click [Next].
- The Start Menu folder is simply the name of the sub directory under which your Xming shortcuts will be located. The default value should be fine. Click [Next].
- Additional tasks include creating shortcuts in various locations to make the Xming server easier to access. The following option set is reasonable. XLaunch provides a graphical launcher with easy access to more advanced features of Xming. Most users will not need to use these advanced features and can leave the XLaunch options unchecked (the shortcuts will still exist in the Start Menu). Click [Next].
- The installer will verify the settings. The one to be certain to verify is the destination location. Using any installation directory other than the default will make font installation and use slightly more complicated. Click [Install].
- Following a brief installation status screen, you should see the following dialog indicating successful installation of Xming. You are now equipped to view X11-based graphical applications remotely. Click [Finish].
Installing Additional Fonts
- It is recommended to install the additional fonts for Xming(http://sourceforge.net/project/downloading.php). The “Xming-fonts” package can be downloaded from http://sourceforge.net/project/downloading.php. Installation is identical to that of above, with the exception of the “Select Components” phase. Make sure to select all available fonts as shown below.
- For the fonts package, make sure the installation directory matches that of Xming itself (this should be “C:Program FilesXming” unless you changed this location in the Xming installation process). **NOTE: There may be an error alert that the installation already exists. If this happens, simply select “OK” or “Continue”
- You should now have an Xming icon on your desktop. Double-clicking this will start the X11 server and allow you to use X11.
- When the X11 server is running, you will see an “X” icon in your taskbar (near your clock). If you see this, you are ready to use X11-based applications.
Configure X11 Forwarding in Putty SSH Client
In the PuTTY configuration window, select “Connection->SSH->X11” and make sure the “Enable X11 forwarding box is checked, then return to the Session category and click [Open] when you are ready to connect to the specified machine:
For information on installing PuTTY SSH, please visit the page at http://rcc.its.psu.edu/hpc/guides/putty/.
Configuring a Xlaunch file
- Go to Start -> Programs -> Xming > Xlaunch
- On the first screen, select “Multiple Windows.” This will make the remote application forwarding more like a normal windows application.
On the next screen, it will ask how to start Xming. Select the “start a program” radio button, and click next.
- Where it says “Start Program”, type the name of the program you wish to start when you select the Xlaunch icon. If you wish to use this as a generic starting point for remote applications on the cluster, you may want to use xterm, as executing commands from within it will automatically forward those window as well. Other applications can be choosen as per requirement.
- In the dialog that says “Run Remote”, select “Using PuTTY (plink.exe)”. This will allow integration with the Portable Putty utility set you previously installed.
- In the box that says “Connect to computer”, type the hostname of the server you wish to connect to. See Connecting to Circe for login details for the Circe cluster.
- In the box that says “Login as user”, enter your username.
- Leave the password box blank, and click next.Click next on the next screen.
- Click the “Save Configuration” button on the next screen, and save the Xlaunch shortcut in an easily accessable location (such as your Desktop).
- You should be able to double-click on the created .xlaunch file to connect to the system. You’ll need to provide your password when you log in.
Configure SSHd for X11 forwarding
On the Linux machine, we have to alter the ssh daemon config file: /etc/ssh/sshd_config. Just ensure that it has the following:
# X11 tunneling options
If you already have similar parameters, don’t do anything. But if you had changed the config file, you have to restart ssh:
user@desktop:~$ sudo /etc/init.d/ssh restart
Running X11 Applications on Linux Server from Windows machine
Click the .xlaunch config created during the “Configuring a xlaunch file” phase and use the X11 applications from the windows machine.
The following is a screenshot of running xterm as default command and running a set applications like xeyes. xclock, firefox and gvim from xterm.