Installing and Configuring Cygwin X Windows

  1. Visit http://www.cygwin.com and download setup.exe (look for the "Install or update now!" link, or this link works as of 11/02/2005).
  2. Run the downloaded setup.exe
  3. Choose "Next" past the banner page, "Install from Internet", and select a local directory where the software will be installed.  I usually use the default location.  Inside the "Install For" box, make sure that "All Users (RECOMMENDED)" is selected.  Additionally, under "Default Text File Type", I use "Unix / binary (RECOMMENDED)", though if you know what you're doing, you can use "DOS / text" (this particular choice shouldn't affect the X Windows setup).  "Next"
    image of setup.exe window
  4. Select a temporary directory to save the installation files.  I usually create a new folder on the desktop, and put the files there so they can be easily deleted after the installation.  "Next"
  5. The proper internet connection type will depend on where you are, but for almost 100% of UT, you will use "Direct Connection".  "Next".
  6. Choose a download site.  I generally use sites that end with ".edu", or ".nasa.gov".  It doesn't really matter, but I get the best speed from those.  "Next"
  7. Here is where you select packages.  There are tons of UNIX utilities available, so feel free to add any that you might like.  I'm only going to list the ones you have to have to get X Windows working. Jump down to the "X11" group, open it up by clicking on the "+" next to X11, and select (by clicking the spinny arrow thing to the left of the word "Skip"):
    Tada. Selecting this one will turn on the dependencies it needs.
    package selection window
    For your convenience, you might also want to install the command line version of SSH, instead of needing to use the graphical Windows SSH client (although the Windows client works just fine if you turn on X tunnelling).  SSH is in the "openssh" package in the "Net" tab.  Choosing openssh will select the openssl, etc, packages automatically.
    net tab showing openssh
    "Next"
  8. All of the packages that are being installed will be downloaded, and installed.
  9. If it fails, go ahead and restart setup.exe, and use a different download site.  Some of them sometimes seem to fall out of sync with the rest, and cause problems.
  10. If the installation succeeds, you'll be presented with
    window for adding icon to desktop and start menu
    I usually accept the defaults, but it's personal choice.  "Finish"
  11. Fin.

How to Run X

  1. Open a "Cygwin Bash Shell" from Start->All Programs->Cygwin.
  2. At the prompt, type "startxwin.sh".  There is also a "startxwin.bat" available under the directory where you installed cygwin, in the "usr/X11R6/bin" subdirectory.  You can use the .bat file to make an icon on your desktop or start menu if you so choose.
  3. You can run local X programs, or use SSH with X tunnelling to run X applications on UNIX machines.  Run ssh from the xterm that gets opened by startxwin.sh, so that your DISPLAY environment variable is already set, and is propogated through the ssh tunnel. The syntax is:
    ssh -X username@hostname
  4. Once ssh'ed to the destination machine, you can make sure your DISPLAY is set by using
    echo $DISPLAY

    example ssh connection
  5. If you're using Center for Space Research computers, I've provided instructions on configuring the graphical Windows SSH client.  You can also use the command line SSH client:
    ssh -f -n -L 2222:dirac.csr.utexas.edu:22 username@ssh.csr.utexas.edu sleep 100000
    ssh -X -p 2222 username@localhost
    You can replace dirac with whichever host you need to connect to, 2222 with some random port number (but don't change the 22), and 100000 with however long you want the tunnel to stay alive (in seconds).
  6. The newer versions of cygwin default to using the Windows type windows for your X Windows windows.  This way it peacefully and seamlessly integrates with your normal Windows environment.  If you would like for X to take up the whole screen, or use a different window manager, you can make a copy of the startxwin.sh or startxwin.bat file, and make modifications to it for your own use.  The options allowed are very well documented inside of the scripts.

If you have questions, you can contact john@csr.utexas.edu. I can't guarantee I can help, but I'll give it a shot.