1. Introduction:

The X Window System (or shortened to simply X) is an architecture-independent windowing system that provides the framework for a graphical user interfaces environment over a network connection. X is client-server architecture where a X server is typically the provider of graphics resources and keyboard/mouse events to X client applications. The X server is usually running on the computer in front of a human user. X clients are applications running anywhere on the network and communicate with the user's computer to request the rendering of graphics content and receive events from input devices including keyboards and mice. A Linux desktop basically is a combination of running the X server and a collection of X client applications such as file manager, email program and etc. in the same time underneath a inter-connected network.

This article is a howto of exploring the X Window to access remote Linux server over secure SSH connection to run both Linux commands or graphical programs (aka X clients) in a computer running Windows desktop. This proposal is different to typical VNC or X2Go approach in that it is very light weight on consuming very little resources in both remote and local computers.  To do that two software are needed to install to the local Windows computer. First is SSH client application which is PuTTY  a well known free SSH client implementation for Windows, and the X server.  Implementation of X server for Windows are available both in commercial sector and as free software. Here, we use the VcXsrv X server for Windows which is free.  Downloads them and simply runs their installers to install to your Windows desktop. 

If you don't have access right on any remote Linux servers and want to try this solution,  we compile a VirtualBox Linux virtual machine which running Ubuntu 14.04.  You can download it [here].  You run it in the same network of  you local Windows desktop computer.  It can act as the remote Linux server.  After downloaded, runs VirtualBox and selects the File menu and choose Import Appliance to integrate it to your VirtualBox run-time. As it is for learning purpose, you should use it strictly in private network and without given access from the Internet.  

There is a  couple of sections to follow. They are tried in Windows 10.  Section 2 is SSH connection setup, you only need to do once unless you have other remote Linux servers to access.  Section 3 and 4 probably are the most of time you will engage.

This solution is best to use with SSHFS to share files in remote Linux server and local Windows desktop as X Window does not have ability to share files, checkout our SSHFS setup guide to see howto. As files being shared, you can use local Windows application such as Acrobat Reader, Microsoft Office, Adobe Photo Shop and etc. to access them. So that you can take advantages on both platform applications.


2. Setup SSH Connection:

Click the PuTTY icon on menu or your desktop where ever you find it after installation.



 As below figure, at step 2 put your login user name



As below figure, at step 2 put the /usr/bin/Thunar. Thunar is X client file manager to start when the ssh connection is established. It is absolutely fine to replace it by other X client applications such as terminal program likes /usr/bin/gnome-terminal and /usr/bin/xfce4-terminal .

For this article we demo how to explore Thunar to start running X terminal application and a text editor for programming purpose. Thunar is part of XFCE4 desktop.  You may ask your remote Linux server administrator to install it if it is not there. In Ubuntu Linux, a simple command likes "sudo apt-get install thunar" will install it.







As below figure, at step 2 put your remote server domain name, at step 3 give a name of this session, finally at step 4 to save it so you can recall this session to open again.  That's it. You have done SSH connection setup.



3. Running X Server 

This procedure is most of time you will engage when you want to access remote Linux server. First step is run a instance of X server. Click the VcXsrv icon on start menu, Windows desktop or  where ever you find it after the installation. It will be convenience if you put VcXsrc program shortcut in Windows Startup so that it will run automatically every time you have Windows desktop boot up.


If VcXsrv is running, you should see it's icon in the task icon tray. You just need one VcXsrv instance running even you will have multiple PuTTY SSH connection sessions.  



4. Starting SSH Connection to Run X Client Remotely

Second step, run PuTTY  and load the session you saved in the SSH connection setup procedure. Clicking Open button will initiate the connection. If you have more remote Linux servers to access just repeat this step for them.


If connection is successfully established, you will see a screen similar as below figure. If not, check again steps in SSH connection setup procedure specifically you put the right user name and if input correct password when prompted. Don't close this Window (you may minimize it) otherwise the SSH connection will be closed and all X clients you running in remote Linux servers will be terminated.



In couples of seconds, Thunar file manege running in remote Linux server will appear in your local Windows computer display, and listing all files in your home directory in remote Linux server.



Clicks the mouse right button on empty area in Thunar will show pop up menu, a menu item "Open Terminal Here" will allow you run a terminal.



Below is terminal window shown on your Windows desktop. In terminal windows, you can run other X client programs such as Firefox, OpenOffice, Thunderbird and etc. They will all be shown in your computer screen.



Move the mouse pointer to a program source file and click the mouse right button a pop menu will show and suggesting the editor to use on the first menu item. 


 Below, it is opened C++ source code with with gedit X client program.