Cygwin

Cygwin is a very common way to get a unix-like environment running on a windows machine. This is a short introduction to installing it on your personal machine.

Installation Instructions

Directory Setup

Cygwin will need a directory where it can keep its file system. The default is to install to c:\cygwin. When I install Cygwin I usually create a directory called c:\cyginstall where I can keep the installer and all the files it downloads.

Running the Installer

  1. Get the installer

  2. Run the installer (c:\cyginstall\setup.exe)

  3. Click on 'Next'.

  4. Choose Install from Internet and click on 'Next'.

  5. The default settings on the Choose Installation Directory screen should be fine, so just click on 'Next'.

  6. The default Local Package Directory is fine also, so click 'Next' again.

  7. If you use a proxy to connect to the web or ftp set it on this screen, otherwise click 'Next'.

  8. Now choose a mirror server, I usually use ftp://mirror.mcs.anl.gov. Click 'Next'.

  9. The next step is selecting the packages you want to install. If you want your Windows computer to be an almost fully featured Linux-like development center, just go ahead and install everything. If you only want to connect to the department machines, just install the defaults, XFree86, and OpenSSH. In order to install XFree86, just scroll the list down until you see XFree86. The word Default should appear to the right. Click on Default and wait a minute or two until it changes to Install. OpenSSH can be found in the Net category. Now click on 'Next'.

  10. Wait a while....

  11. You can now choose to create icons on the desktop or in the Start menu, that's really your preference.

  12. Click on 'Finish'.

  13. Wait a little while longer, then click on 'OK'.

General Use

The Shell

The usual interface for Cygwin is the bash shell. You can start it by clicking the Cygwin icon or going to Start->Run and typing bash --login. When you installed Cygwin it created a Linux-like file system in c:\cygwin this is your / file system. It order to access your Windows drives you can go to /cygdrive/c or /cygdrive/driveletter.

XWindows

You can start XWindows on your Cygwin install by running startxwin.sh from your bash prompt. This will start the Xserver and open an xterm window.

Remote Execution

Having an Xserver is very useful when you want to run programs on a remote Linux computer and have them display on your screen. In order to do this you can use SSH to connect and then run your program. The following example shows the commands I would use if I wanted to run emacs on baseball.cs.byu.edu. All of these commands need to be entered in your bash window:

startxwin.sh
ssh -X byronc@baseball.cs.byu.edu
[enter password]
emacs

emacs would then appear on my screen and I could use it just as if I was in the lab.