Hints for Setting up Cygwin
Note: This page is no longer maintained. A more recent
set of instructions for some topics may be found at
Welcome. This page has instructions for setting up Cygwin, a Linux-like environment for
Windows, including such tools as gcc, (X)Emacs, latex. It is free and
open source (supported by RedHat at some level). Using cygwin, its X
server, and a virtual desktop called JS Pager
can make using Windows an enjoyable experience (or at least pretty
Note: Cygwin comes with an X server (what you need to
display X windows on your computer). This package however does not
have a current maintainer and sometimes has issues. I
recommend installing XMing, an open source
X server that shares the same code base as the Cygwin X server. (I
would recommend downloading Xming and the
In this web page, I've listed a lot of different options. All you
need to do is follow the How to Start directions.
You can then come back in install any other options as you want them.
How To Start
Here is how I setup Cygwin on computers with at least 2 Gb free of disk space:
To start XWindows, you want to double click on:
C:\cygwin\usr\X11R6\bin\startxwin.bat. You probably want to
put a link to some version of it in your Startup folder so it starts
automatically every time you log in.
- Go to http://cygwin.com/
- Save the installer http://cygwin.com/setup.exe (I
always rename it cywgin_setup.exe)
- Run, click next, choose "install from Internet"
- Keep clicking next until you get to 'Available Download Sites',
- The next screen will let you choose which packages: leave it as
- Keep clicking 'next' until everything's done.
- You _may_ have to reboot after finishing
- Rerun install. Keep clicking next until you get to choose which
packages. Click '<>Default' next to All ONCE - after a second it
should read 'Install' (read the second tidbit
below before this step).
- Click next until everything done.
Note: The cygwin.bat icon starts up a bash session
in the cmd.exe program. Personally, I think this is a lousy
window to work in. On my computer, I use a shortcut to start an mrxvt
window using a bash script that I've included in my useful files. Note: I have been having
problems getting this shortcut to work on other people's computer. mrxvt.bat (assuming you put
mrxvt.exe in c:\cygwin\bin) works.
- You may want to disable your virus checker when running the
Cygwin installer. Don't forget to re-enable it when you're finished
- If you are planning on installing
CERN's Root, I recommend going to
the 22.214.171.124 version. Root 5.14 (or later?) should be immediately
compatible with this release. You may have to build the earlier
versions from sources.
- Cygwin doesn't like it if there is a space in your Windows
username. If you have a space, do the following after installing Cygwin:
- Edit /etc/passwd (using either emacs, vi, or even Windows Wordpad)
- Find your entry (it will start with your windows username)
- Take the space out of your username (1st entry) and your home directory (2nd to last entry).
- Quit all Cygwin
- Use Windows Explorer to rename your home directory (C:\cygwin\home\cplager in my case)
- Cygwin doesn't like spaces in directories. To have access to
my program files, I created a 'mount point':
cygwin> mount -f -s -b "c:/Program Files" "/mount/programfiles"
You only need to run this command once.
- To make access easier to my documents and the decktop, I made
the following soft links in my home directory
cygwin> ln -s 'C:/Documents and Settings/cplager/Desktop' Desktop
cygwin> ln -s 'C:/Documents and Settings/cplager/My Documents' Documents
- Download this tgz file somewhere
cygwin can see it
- Make a temporary directory and move the file there
cygwin> mkdir junk; mv useful_charles.tgz junk/
- Untar the file
cygwin> tar xzf useful_charles.tgz
- Look through the files and take what you want.
- A lot of the files have /home/cplager hardcoded.
Please makes sure you run
fixHomeCplager in the bin directory to change
these to /home/yourusername.
- The .emacs file is a good place to start. You either
need to copy the emacs/ directory to your home directory
cygwin> cp -r emacs ~/
or edit the .emacs to comment out the all references to tramp.
Backup Your Cygwin installation
After you are happy with your Cygwin installation, it is a good
idea to back it up so that if you anything happens, or if you want to
move it to another computer as is, you can.
- Save the mount points
cygwin> mount -m > /usr/bin/mountCommands.bat
- Save the C:\cygwin directory (e.g., burn it to
DVD, save it to another hard disk, etc.)
- If you need to re-install Cygwin:
- copy the backup to C:\cygwin
- run C:\cygwin\mountCommands.bat
Here is a very small list of software that is available for Cygwin:
If you want to use kerberos with cygwin, please visit my Windows Kerberos at FNAL page. You want to
read the cygwin section.
Alternatively, you can visit Axel Naumann's download directory
which has a lot of good HEP software, including kerberos.
Note: If you have set up Kerberos previously on your computer
without a Cygwin install, you will need to follow the directions in
the cygwin section.
Emacs and Tramp
If you followed the instructions above, you
already have emacs installed. Tramp is a package for emacs that lets
you run a local copy of emacs and edit remote files (using ssh/scp).
If you have already kerberized your ssh/scp, then tramp uses these
versions automatically without any problems.
To install tramp, copy the emacs/ directory from the tgz above. You will want to add the
following lines to your .emacs file:
;;; Tramp stuff
(add-to-list 'load-path "~/emacs/tramp/lisp/")
(setq tramp-default-method "scpx")
To use tramp, you open a file much like normal (i.e. <ctrl>-x <ctrl>-f), but you need to specify the file name slightly
<ctrl>-x <ctrl>-f /[firstname.lastname@example.org]localpath
<ctrl>-x <ctrl>-f /[email@example.com]/absolute/path
Do not forget the / at the
beginning of the filename.
Visit my Emacs
page to see more useful tips about Tramp in
particular and emacs in general.
rxvt is an xterm-like terminal program. mrxvt is
built from the same code base, but adds tabs (similar to
konsole terminals in KDE). It turns out building these for
Cygwin (assuming you have the X11 libraries installed) is very easy.
Note: I recommend building mrxvt from source, but for those who
want to try a built version, you can grab mine. I also have a perl script, mrxvt_options.pl, that lets you change the
names of tabs, etc. mrxvt.bat
(assuming you put mrxvt.exe in c:\cygwin\bin) will
start it up for you.
- Visit the mrxvt
- Read the README file.
- Download the
- Untar the source file
cygwin> tar xzf mrxvt_0.40.tar.gz
- Configure as shown in the readme file
cygwin> ./configure --enable-everything --disable-debug
- Make and install
cygwin> make && make install
You should be good to go. Here are the entries I have in my ~/.Xdefaults file:
! These keys are used by emacs, disable them
Installing Perl Tk
Note: As of December 2005, you can download Tk from any
Cygwin mirror using the cygwin installer. I recommend trying this
first before building your own.
Perl Tk is a useful GUI addition to the Perl language. In my Useful files tar ball, you will find a few scripts
that take advantage of this package. It is, however, by no means
necessary, so feel free not to install it (or install it later).
Note: I have always installed Perl Tk 8.00.024. There are
newer versions; I just haven't tried them. If you're curious, please
try and let me know how it goes. If you want to be lazy and play it
safe, follow the directions below.
I'm assuming that you have a full cygwin installation as shown above.
You should now be good to go.
- Open a new Cygwin window and fix a problem with Perl
cygwin> cd /usr/X11R6/lib
cygwin> ln -s libX11.dll.a libX11.a
Close the window.
Note: I've been told that you don't need
to do this step anymore, but I haven't verified that yet.
- Grab the source of Tk-800.024.tar.gz and save it somewhere
cygwin can see it
- Open a window in Cygwin and untar and feather it:
cygwin> tar xzf Tk-800.024.tar.gz
- Log into the new directory
cygwin> cd Tk800.024
- Read the README.cygwin file
- Configure the makefile as specified in the readme file
cygwin> perl Makefile.PL x
- Start the build
- It has always worked for me. Hopefully it will work for you. If
the build is successful, install it
cygwin> make install
The console GUI is a Perl Tk script that I wrote that makes it easy to
log into many different machines. You can find it in the tgz above.
- Take all files in the bin/ directory and copy them to
your bin dir. Copy also the .console.properties file (a
directory up) to your home area.
- I have the shortcut I use to start the console script (Console.lnk). Right-click on the link
and save it to your desktop. You will have to edit this shortcut to
point to your version.
- Right-click on the icon and choose properties.
- Edit the Target and replace /home/cplager
- The shortcut also assumes that run.exe is in
/bin, so copy it there
cygwin> cp /usr/X11R6/bin/run.exe /bin/
- Summary of Commands:
- l/L - start Local xterm
- x/X - start xterm as you on machine selected
- o/O - start xterm as other on machine selected
- The console GUI is configurable. Edit the
.console.properties file for details.
- If your cygwin username does not match your FNAL username (a
bad idea, but it happens), you will need to:
- Add a line in the .console.properties
- user fnalUserName
- Edit bin/kinit.pl file where you add what is in
system "/bin/kinit -n -l 100d fnaluser@FNAL.GOV";
Last modified: Wed May 2 10:03:16 CDT 2007