You are on page 1of 14

HOWTO install Cygwin

Cygwin is a Unix-like environment for windows.

It can be obtained from:
Below are notes on how to install and setup cygwin for access to group computers.
Installation Notes:

1. Download setup.exe from

2. Run application from your local harddrive.

3. Chose next on first screen.

4. Select "Install from Internet" and click next.

5. Enter preferred installation (Root) directory and click next.

6. Enter a temporary installation directory and click next.

7. Select "Direct Connection" and click next.

8. Select a download site and click next.
(Any site that you can connect to is fine. Some sites are more
stable and/or faster than others. Try to pick one that works for
9. Select the packages you want to install and click next.
Packages you may want to install include:
○ opennssh
○ keychain (for ssh key pairs)
○ gv
○ ghostscript
○ emacs
○ vi
○ grace
○ tcsh
○ gnu compilers
○ tetex
○ aspell
○ gnuplot
○ rsync

Please note sometimes you may get a download incomplete and

the setup application will return to step 8. Simply select another
server and continue the installation process.

10. Once the installation is complete, click Finish and continue with
the Setup section.
Setup Notes:

1. Setup Windows Environment V ariables:

○ Open your System Control Panel:
Select [start]->Control Panel->System

2. Select "Environmental Variables" under the "Advanced" tab of the

"System Properties" Control Panel

○ In the Environmental variables window select new under
"Variables for User" window.

Edit "User Variable" as follows:

Variable name: HOME
Variable value: Path to where you want your home directory
e.g. C:\Documents and Settings\User\My

○ In the Environmental variables window select Path under

"System Variables" window.
Edit "System variable" as follows:
Append "; C:\cygwin\bin" to Variable value: (semicolon is
very important)

○ Select "Ok" to close both "Environmental Variables" and

"System Properties" windows.

3. Setup and configuring cygwin files.

A. Edit the passwd file.
On your harddisk navigate to the passwd file.

For a standard install this should be under

 Right click on the passwd file, select open and then
choose notebad to edit the file.

 Edit the last line of the file as following:

854245398-1004:/cygdrive/c/Documents and
Settings/User/My Documents/username:/usr/bin/tcsh
 Save the file once you've completed the edit.

B. Edit the startxwin.bat file.

Next on your harddisk navigate to the startxwin.bat (you
may just see starxwin if you don't allow windows to show file
extensions) file.

For a standard install this should be under

 If you want to change your default shell to tcsh
instead of bash right click on the starxwin.bat file and
select edit to edit this file.

 Use your favourite windows text editor for this

purpose (e.g. notepad)

 Edit the line:

run xterm /bin/bash
to read:
run xterm -geometry 100x32 -sb -rightbar
-e /usr/bin/tcsh -l

 save the file, restart windows and then start X-

windows by double clicking on the startxwin.bat
file(you may want to make a shortcut to this file for
future use).

 "ssh -X" can be used to log into and then

"ssh -X" to our group machines and this will allow you
to tunnel X-windows through ssh.
Installing Cygwin/X
Cygwin tools are, in the words of the Cygwin development
homepage,, "ports of the popular GNU development tools and
utilities for Windows 95, 98, and NT. They function by using the Cygwin library
which provides a UNIX-like API on top of the Win32 API." Cygwin allows the
compilation of the X Window System source on Win32; several patches were made to
the X Window System source to make it actually compile and run under Cygwin.
Cygwin has a nice setup program that downloads and installs the necessary Cygwin
packages for you.
1. Open the Cygwin, page in your web browser
2. Click the "Install Cygwin Now" link in the upper-right hand corner of the page.
This link downloads setup.exe from the primary Cygwin server;
savesetup.exe to the directory that you would like to store the downloaded
packages in (e.g. c:\download); do not save setup.exe to c:\cygwin, as that is
the default directory for the extraction and installation of the downloaded
3. Run setup.exe, you will see the welcome screen:

4. Click Next to proceed to the next screen.

5. Choose, Install from Internet, this will still save the package files to your
download directory so that you can install Cygwin on any number of machines:
6. Click Next to proceed to the next screen.
7. The default Install Root is c:\cygwin which should be fine for most
installations. Leave Default Text File Type as UNIX. Leave Install For set
to Allunless you lack local administrative privileges.

8. Click Next to proceed to the next screen.

9. Local Package Directory should default to the directory that you
ran setup.exe from:
10. Click Next to proceed to the next screen.
11. Choose your proxy setup, or, just choose Direct Connection if no proxy is

12. Click Next to proceed to the next screen.

13.Select your nearest mirror for downloading:
14. Click Next to proceed to the next screen; setup will download a list of available
packages as it moves to the next screen.
15. On the next screen you will select the packages that will be downloaded and
installed. A listing of the Cygwin/X packages is given below; a listing of the
general Cygwin packages would be beyond the scope of this document.
Cygwin/X packages are located in the X11 category.
○ xorg-server (required, the Cygwin/X X Server)
○ xinit (required, scripts for starting the X
server: xinit, startx,, startxwin.bat (and a shortcut on the
Start Menu to run it),startxdmcp.bat )
○ xorg-docs (optional, man pages)
○ X-start-menu-icons (optional, adds icons for X Clients to the Start
○ You may also select any X client programs you want to use, and any
fonts you would like to have available.
○ You may also want to ensure that the inetutils or openssh packages are
selected if you wish to use telnet or ssh connections to run remote X
16. Click Next to begin the download process, you may want to try another mirror
if you see a "Connecting" message on this screen for a long period of time:

17.After the packages are downloaded, setup will automatically begin to install
18. I highly recommend allowing Cygwin Setup to create Desktop and Start Menu
icons for you; these icons simply launch a bash shell:

19. Click Finish to close the setup program.