On the web there are many manuals showing how to connect from Windows to Linux and get an X session window but do not indicate otherwise, that's my concern: How to view linux Windows programs with Protocol X [X window server]?

Sorry for my poor English ...


There are several ways:

  1. VNC

    • Install a VNC server on the Windows machine. You can use TightVNC for example. Make sure you configured it to listen on a non-loopback IP address and it is not blocked by a Firewall.
    • Install a VNC client on the Linux machine. If you use Debian or Ubuntu, you can do it with the following command in a terminal:

      $ sudo apt-get install xtightvncviewer
    • Connect to the Windows box (assume the IP address of the Windows machine is is

      $ xtightvncviewer
  2. RDP

    The standard Windows Remote Desktop Protocol. At usual it does not require any special configuration on the Windows side except setting Allow users to connect remotely to this computer checkbox in System Properties and adding a user to Remote Desktop Users group.

    On the Linux side you got to:

    • Install the rdesktop client. For Ubuntu or Debian you can use the following command:

      $ sudo apt-get install rdesktop
    • Connect to the Windows machine (assume its IP address is

      $ rdesktop
  3. X11

    If you run an X11 server on a Windows machine (Cygwin/X or 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 runs an application and the Linux box (say 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="" 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).

    The 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 +

    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 openssh from 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 sshd_config.

    Now, how it looks like. On a Linux box you run:

        $ ssh -X user@ 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 PuTTY, choose ssh, fill login and 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.

  • Hey vdmit11, please explain me a little more the last step (step 3), I use Xming X terminal but can not find it anywhere ...... – chimpaburro Nov 17 '12 at 23:16
  • I can not find the X terminal... – chimpaburro Nov 17 '12 at 23:30
  • OK All is clear now, but.. in the moment: ssh -X user@ xterm (changed the ip and the user for the my) return error = xterm: not found... – chimpaburro Nov 18 '12 at 0:20
  • It is not found because it is not installed on your windows machine. You can't run a non-X application over the X protocol. You can't run explorer.exe for example, but you can install xterm or any other X application. I actually have no Windows machine right now so I can't install Xming to check what applications are there. You better to try in opposite direction: connect through ssh to a linux machine, run xterm there, but display it on the forwarded Xming. – Dmitry Nov 18 '12 at 0:23
  • Ok, thank you very much I will continue my search and you gave me a way. – chimpaburro Nov 18 '12 at 0:42

Windows does not support the X protocol. What I would do is look for something that talks Windows RDP (remote desktop protocol). An example, not personally verified, might be rdesktop.

  • thanks but no single protocol that starts some unwanted programs and not all the Desktop – chimpaburro Nov 17 '12 at 21:15
  • Unfortunately, RDP is what it is. – Nicole Hamilton Nov 17 '12 at 21:23
  • RDP does have a single-program-per-connection mode. – user1686 Nov 17 '12 at 23:03
  • yes grawity, and this is my need – chimpaburro Nov 17 '12 at 23:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.