Using Cygwin for X11 Forwarding

From CS Support Wiki
Jump to: navigation, search


Cygwin can provide X11 support to make running GUI dependent Unix software easier in a Windows environment.

Install cygwin

  1. You can obtain cygwin from here: . Download and run the appropriate version for your Windows version, either 32- or 64-bit.
  2. Run through the install. At the "Choose a Download Site" section of the Cygwin Setup there are a number of options. All of them should be valid, but if you have connection problems you can switch sources.
  3. When you reach the "Select Packages" section choose any that you might want for local use, but make sure to select an ssh-client (under 'Net', openssh works well), and both xinit and xorg-server (under 'X11').
  4. Allow Cygwin to install any required packages and continue the install, it will take a while.

Using the Cygwin X11 server through the XWin Server app's interface

  1. Go to the Start menu and run the 'XWin Server' app.
  2. Right-click the 'Cygwin/X Server' shortcut in the notification area, select applications, then start xterm
  3. In the xterm window you can connect to whichever resource you like via ssh and enable X11 forwarding back to your running X server by using the -XY switches as follows:
 ssh -XY

When your remote session begins, you should be able to start remote x11 programs, with the GUI appearing on your machine. Running 'xeyes' or 'xclock' is a good test.

Using the Cygwin X11 server through a regular Cygwin shell

If you need to connect to the X Server from a Cygwin shell you have to set the display environment variable (DISPLAY) manually. The following commands can do that:

 export $DISPLAY=:0


 export $DISPLAY=:0:0

Once the display is set you can open an ssh session with the correct switch to allow X11 forwarding, usually -X, as follows:

ssh -X

You may have to troubleshoot based on your personal installation and the version of ssh that you are invoking - it is generally easier to use the xterm app from within the XWin Server app.