If you run an X11 server on a Windows machine (
Xming for example) then the communication is pretty straightforward as the X window system was designed to be network-transparent. The main thing that we touch is an application can be executed and displayed on different machines. You run an application locally, but specify a DISPLAY where the application is shown.
In your case the Windows box (say
192.168.1.10) runs an application and the Linux box (say
192.168.1.11) displays the application. In fact, the windows machine does not require to run an X server to run the application - it simply can display it on a remote Linux box:
$ DISPLAY="192.168.1.11:0" xterm
When you run the command on a Windows machine it will run
xterm locally, but display it on a remote X server which runs on a separate machine. When you run the command on a Windows machine you should see the terminal window openned on a Linux machine (remotely).
DISPLAY is an environment variable that holds an address and number of the current display. Every X application looks into this variable to know where to render itself. The important thing to understand is the
xterm (for example) does not distinguish whether it displays itself to a local X server or a remote X server. It is network transparent. For example, if you run
xterm and just say:
$ echo $DISPLAY
It will print a current
DISPLAY to which all applications display itself. By overriding this variable you tell the application to display itself somewhere else. I hope the concept is clear now.
Note that it is likely your Linux X Server rejects all incoming connections for security reason. To allow connections from your Windows box run the following command:
$ xhost +192.168.1.10
Actually this way is a bit insecure, because everybody who assigns this IP address to itself may connect to the X server.
Fortunately, there is a great and secure way. Since the X server just listen a TCP port - we can forward it to a local machine over an encrypted channel using
ssh which has this awesome feature. You will need an ssh daemon running on the Windows machine. You can use
cygwin - it is easy, just set up the
cygwin with selecting the
openssh package and then open a terminal and run
ssh-host-config, but don't forget to set
X11Forwarding yes in
Now, how it looks like. On a Linux box you run:
$ ssh -X email@example.com xterm
And after entering the password you should see the
xterm window which is executed on a Windows machine but displayed on a Linux machine. After authorization
ssh binds to a port on a Windows machine where it listens for connections and forwards packets over the established channel to a local port on a Linux machine (usually 6000 for display 0). Then it runs the
xterm with setting
DISPLAY to the bound port allowing
xterm to display itself on a remote X server over an encrypted channel. In this case you don't need to run
xhost since the X server does not need to accept any external connections.
Now, how to run application on a Linux box and display it on a Windows box:
On a Windows machine you will need an X server (
Xming for example) and an SSH client (
PuTTY for example). First, ensure the
Xming running (there is a tray icon). Then, open
password boxes, also ensure the
X11 Forwarding in
SSH settings is checked. Then just click
connect and after that it will connect to the Linux box with opening a terminal window. You can run
xterm there and it will be displayed on a local
Xming server (since it is forwarded by
PuTTY to a remote machine). Also look at this guide - there are some screenshots.