Cygwin on portable storage devices

Ali Devin Sezer, 5 Feb 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 to Cygwin.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.

Choice of Portable device

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.

Choice of Filesystem

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.

Installation

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).

Back to Devin Sezer's home