Setup secure X11 connections using cygwin

Thanks to: http://x.cygwin.com/docs/ug/setup-cygwin-x-installing.html (that URL includes a few pictures, in case something is unclear)

GOAL To setup cygwin on a Windows workstation so that you can forward X11 apps from a Unix workstation.

ALTERNATIVES There are no other free and opensource alternatives to cygwin for X11 forwarding to Windows workstations. You can use commercial products such as Hummingbird eXceed, X-Win, or NX.

INSTALL cygwin

  • goto http://cygwin.com/
  • click on Install or update now! and pick a place to download setup.exe
  • after downloading, run setup.exe
  • choose to Install from Internet
  • all other defaults are fine
  • when asked for mirror, you can choose any, but http://mirrors.kernel.org/ is a pretty fast one
  • when asked for which packages, there are two required to make this work:
        Net > openssh (which auto-selects openssl)
        X11 > xorg-x11-base (which auto-selects other X11 packages)
    
    ... feel free to include anything else you want

Now you've finished downloading and installing cygwin.

USE cygwin

  • double-click on cygwin icon (this opens up a terminal window, where you have a more Unix-like command-line environment within Windows)
  • to do X11 forwarding, type startxwin.bat (this will open up another terminal window with all the X display information already configured by cygwin)
  • in this new terminal window, type
  • ssh -Y ip.address.of.unixserver
  • login with your credentials
  • now you can run any X program and they will be forwarded from the Unix workstation to your Windows workstation
  • examples:
        gnome-session (for an entire desktop)
        thunderbird (a particular app)
    
  • you can run the programs in the background, which gives you back control at the command-line, thus you can forward multiple X11 apps:
        thunderbird &
        gaim &
    

In subsequent sessions, you only need follow the steps under USE cygwin.