Installing Cygwin
Cygwin is a collection of unix/linux style tools that run on Windows. I primarily use cygwin for xterms, ssh tools (ssh, scp), and rsync, but I sometimes use unix style tools to operate on the window system files.
The first thing you need to know is that cygwin is *not* unix or linux on windows — rather, it is a set of unix/linux tools that run on windows. Don’t expect a windows application to suddenly act like a unix application just because you see a familiar bash prompt.
I’ve used cygwin a long time and it has evolved quite a bit. It is simple and easy to install and use the basic tools. I’ve had trouble though when I’ve tried to run other applications, like mutt.
Here are my recommendations for installing and running cygwin.
Directory Structure
- Create a separate, permanent location for the setup application. I use
c:/cygwin-setup. The setup application stores setup configuration information in this directory and things will run smoother if it is there the next time you run setup. - I accept the default for the cygwin installation directory,
c:/cygwin.
Packages
The cygwin setup application is similar in concept to unix/linux package management systems like Debian’s. It provides a windows gui interface listing packages. After you select packages it will download those selected packages and all other packages required for a successful install of the selected packages.
The setup application will also download updates to any already installed packages that have updates. This surprised me the first time I decided to install some new small package and noticed setup was updating everything else I had previously installed. I now have the habit of periodically updating my cygwin installation by running setup and simply clicking through all of the options taking all of the defaults.
I recommend you start small — don’t install everything all at once. When I get a new windows system I start by installing
- openssh (getting me ssh and scp)
- rsync
- x enabled emacs
These items depend on the cygwin core, which includes bash and basic unix file system utilities. The x enabled emacs depends on the x window system so that will be installed too.
Setup will download the appropriate packages and create and populate the directory structure. It will put an icon on the desktop to the cygwin console – which I never use.
I don’t like the cygwin console. Instead I use the xterm. However, as of this writing, I don’t think cygwin has a convenient way to start xterms. This is what I do:
- install the package that gives you x start up scripts (sorry! forgot what its called). This will place in your /usr/X11R6/bin directory a file called startxwin.bat.
- place two copies of startxwin.bat on your desktop — call one ’startxwin.bat’, call the other ’startxterm.bat’.
- edit the version name ’startxterm.bat’. Comment out the ‘run XWin line’.
Now, to run an x application (or to get the first xterm), simply double click on the startxwin.bat. This will start the x-server and 1 xterm. The x-server will continue running even when you kill the xterm window. (The x server adds the x icon to the system tray.) You only need one x-server to run which is why we created the file startxterm.bat.
To start subsequent xterms (once the x-server is running) simply double click on the startxterm.bat file.
Other Suggestions
Cygwin creates unix directory structure in the c:/cygwin directory. When you start an xterm you will be placed in a directory like /home/username. The windows path to that directory is c:/cygwin/home/username.
I used to recommend that you sym link this directory to your windows “My Documents” directory. In the long run I think this is more trouble than it is worth.
I do create sym links to windows “My Documents” and desktop, called simply “documents” and “desktop”. These links make it pretty convenient to find files in the windows file system.
You reference the windows drives via the “cygdrive” directory. For example, to get to c:/, go to /cygdrive/c.
For more info visit http://www.cygwin.com/.