Ali Devin Sezer
Feb 5, 2005
Cygwin is a software package that enables one to work in a UNIX-like environment under a Windows machine. It is fast, reliable and easy to install. It has most of the applications one uses on UNIX (gcc, X, xfig, latex, Perl, bash, ps tools, textutils,...) and most of it is covered by the GNU public license. Cygwin supports many flavors of Windows:XP, 2000, 98, etc. For more info on cygwin go toCygwin.com.
The goal of this page is to describe a way of installing cygwin on a portable storage device like a portable hard drive or a USB memory stick. The main use of such a setup, obviously, is that it enables you to carry a UNIX like system in your pocket everywhere you go and use any Windows machine (e.g. Windows pc's at your university library) with your own powerful cygwin/UNIX tools.
The choice of device doesn't really change the installation process. However here are some notes on this issue:
The rest of this note is independent of the choice of portable storage device.
You have two realistic choices for a file system (FS) on your portable storage device:fat32 and ntfs. (For those who are not familiar with FSs: FS is what is installed on a storage device when you format it. The formatting software asks you which kind of FS you want). Although NTFS is a much better FS, I had read/write permission problems with it when using different computers on which i had different accounts. A simplistic solution to this problem is to use fat32. That's what I do.
I assume that your portable storage device is already formatted. Here are the steps:
This is it. double clicking "X.bat" will make cygwin operational and start an X server as well as an rxvt. When you exit all cygwin software, double click "uninstall.bat".
If you are using a very old windows, replace
for /f %%A in ('cd') do set WD=%%A
in "X.bat" with
set WD=%1
and start "X.bat" from "Run" in the Start menu by typing "X.bat [DRIVE]:\" in the Run box, where [DRIVE] is the letter that Windows assigned to your portable storage device (`E' in the above examples).
[*] This script is based on a script by Fergus in the CD-ROM related postings at cygwin.com (see the links above).
[**]The scripts ``X.bat'' and ``uninstall.bat'' modify host's registry. They insert several keys in the CURRENT USER and LOCAL MACHINE sections of the registry. These keys are modified through the ``mount'' command of cygwin and are referred to by cygwin to find out which directories on the Windows directory structure are going to be mapped to /bin, /lib and /. If cygwin is already installed on the host, "X.bat" will save these entries before changing them. The modified entries are later restored when you are done using your portable cygwin and run the "uninstall.bat" script.