USC Home
 

Detailed Cygwin Installation Notes -

 
These are the three steps to get cygwin installed on your machine:
  1. Download cygwin to your desktop
  2. Install cygwin from local directory
  3. Setup and running cygwin on your machine
 
Download cygwin
  1. You can download and install cygwin in one shot, but I do not recommend that. This is because the intallation is huge and something can go wrong. I have experienced many instances where after 2 hours of downloading and installing, it freezes up and it was 99% completed and I have to restart the whole thing. So, it's best that you separate the download and installation steup.

  2. What account name do you use to login on your Windows XP/Vista machine?

    The default user account on cygwin will have a home directory of /home/ACCOUNT where ACCOUNT is the name of an account on Windows XP/Vista. Some software on cygwin may not run correctly if ACCOUNT has white space in it (such as your real name). So, it would probably be better if you setup cygwin from an account with account name that does not contain white spaces. Alternatively, you can create a new user with simple name such as Owner or Self, login to this new user's account and install and run cygwin from this account.

  3. Create a directory on your Desktop and call it Cygwin Setup.

  4. Visit the cygwin web site and click on Install Cygwin Now (using setup.exe) icon on that page. Save setup.exe in the Cygwin Setup directory you just created.

  5. Run setup.exe from the Cygwin Setup directory you have created when you were downloading cygwin to your machine. Click on the Next button to proceed.

  6. Select Download Without Installing and click on the Next button.

  7. In this screen, you need to choose your Local Package Directory. Click on the Browser button on the right and navigate to the Cygwin Setup directory you have created above (inside the Desktop directory). Click on the Next button.

  8. The next screen is the Selection Your Internet Connection screen. You should just click on the Next button to use Direct Connection. If you use a proxy server to connect to the Internet, you need to give the information about your proxy server.

  9. The next screen is the Choose Download Site screen. On the west coast, I like http://cygwin.osuosl.org. You ned to scroll the window up and down to look for this site. If you find something else that's close to you, you should use it. Click on the site then click on the Next button to proceed.

  10. When you get a list of components to install, they will all say "Default". It should look like the figure below.

  11. In this screen, the first line has "All", followed by the little "recycling-looking" icon, followed by "Default". Single-click on the little "recycling-looking" icon on the first line and wait. This can take several seconds and please do not click again! This should change everything from "Default" to "Install".
    Wait for everything to turn into "Install". Then click the Next button. At this point, it can take something like half an hour or more for everything to get downloaded.

    It may ask you additional questions during the downloading processes. Just click on OK to proceed.

  12. When downloading is done, make sure you don't see any error messages. Sometimes, the connection can breakdown and you would need to restart the whole process.

    To restart the whole process, please delete the Cygwin Setup folder from your Desktop and go to Step (3) above.

    If download was successful, please proceed to Intall From Local Directory.

 
Install From Local Directory
  1. Try to close and disable as much programs that run in the background as possible before you start the installation process. Close and disable virus/spyware checkers. You might also want to close or disable the Microsoft Internet Security Center.

  2. What account name do you use to login on your Windows XP/Vista machine?

    The default user account on cygwin will have a home directory of /home/ACCOUNT where ACCOUNT is the name of an account on Windows XP/Vista. Some software on cygwin may not run correctly if ACCOUNT has white space in it (such as your real name). So, it would probably be better if you setup cygwin from an account with account name that does not contain white spaces. Alternatively, you can create a new user with simple name such as Owner or Self, login to this new user's account and install and run cygwin from this account.

  3. Run setup.exe from the Cygwin Setup directory you have created when you were downloading cygwin to your machine. If you have a CD, you can also run setup.exe from the disk. Click on the Next button to proceed.

  4. Select Install from Local Directory and click on the Next button.

  5. Although cygwin can be installed in any directory, I would recommend installing it in the default directory (which is C:\cygwin). In this case, C:\cygwin in Windows will map to / in cygwin. You can also install it on a different drive if you have one. Please also keep the Default Text File Type to be Unix / binary if you want things to be more like UNIX/Linux.

  6. Referring to the figure above... Do not change the settings on this page. Keep the All Users and Unix / binary radio buttons selected. Then click on the Next button.

  7. Click the Browse button to select the Local Package Directory. Select something that looks like http%3a%2f%2fcygwin.osuosl.org%2f in the Cygwin Setup directory on your Desktop. (If you are installed from a DVD, and you can see the ftp.cygwin.osuosl.org.pub.cygwin directory on the DVD drive, select it.) Click OK and then click the Next button to proceed.

  8. When you get a list of components to install, they will all say "Default". It should look like the figure below.

  9. In this screen, the first line has "All", followed by the little "recycling-looking" icon, followed by "Default". Single-click on the little "recycling-looking" icon on the first line and wait. This can take several seconds and please do not click again! This should change everything from "Default" to "Install".
    Wait for everything to turn into "Install". Then click the Next button. At this point, it can take something like half an hour or more for everything to get installed.

  10. When installation is done, make sure you don't see any error messages. If it cannot complete the installation, you should try to close more programs that run in the background and restart the install program. You can run the install program as many times as you want. Although it takes quite a long time to run it.
 
Running cygwin
There are basically two ways to run cygwin:
  1. Run applications in cygwin in individual windows, just like Windows applications. One advantage of this approach is that you may be able to copy and paste between Windows and some cygwin applications.
  2. Run cygwin in full-screen mode. When you are in cygwin, it feels like you are on a Linux/UNIX machine.
The setup for the first approach is minimal. The setup for the 2nd approach is more elaborate.
 
Running cygwin Applications in Individual Windows
You need to create two icons on the desk top.
  1. Create a shortcut with the following location if your preferred login shell is csh/tcsh:
        C:\cygwin\bin\rxvt.exe -fn FixedSys
                -geometry 80x21 -exec /bin/tcsh -l
    (If your preferred login shell is bash, just replace tcsh with bash above.)
    Name this icon as New Cygwin Window.

    The rxvt.exe program is a VT102 terminal emulator for both X and Windows. It runs as a console window and you can have as many of this as you'd like.

  2. To make starting the X server easier, please do the following to copy a shortcut from the cygwin install directory.

    Click on Windows' Start button, click on All Programs, click on Cygwin-X, and copy XWin Server to your desktop.

To start the X server, click on the XWin Server icon. Once the XWin server is started, you can launch as many terminal windows as you'd like by clicking on the New Cygwin Window icon. Occasionally, if the XWin server died, you can restart the XWin server by click on the XWin Server icon.

After you click on the XWin Server icon, you will see a ugly-looking console window. You can type exit or <Cntrl+D> to close this console window.

From within a Cygwin Window, you can ssh to aludra/nunki.usc.edu, but you should use the -X commandline option. This way, you can run X-based application on aludra/nunki.usc.edu and the window will be opened on your desktop. For example, you can run xeyes or xterm. Depending on your connection speed, it may take a long time before a window shows up on your desktop. If it takes too long, you may want to consider starting your appliactions differently.

 
Running cygwin in Full-screen Mode
(Please note that this mode cannot be run concurrently with the above mode. If you want to try this, you must quit the Cygwin X Server first. Find the black X icon in the System Tray, right-click on it and select Exit to quit the X server.)

Running cygwin For The First Time

  1. Click on the Cygwin icon on the desktop to run Cygwin for the first time. You should see a window that looks like the following:
    Type the following command in this window and press the <RETURN> key (please do not type the $ symbol, it is there to denote that what follows is a command you type into cygwin):
        $ pwd
    What gets printed is your Home Directory in cybwin. Your Home Directory is where you store all your files. Other directories in cygwin are System Files and you should probably not touch them!

    If what you see is /home/xyz and you installed cygwin in C:\cygwin, then you Home Directory is in C:\cygwin\home\xyz. Please open up your Windows Explorer to find this directory.

  2. In order to run X Window System, you need an .xinitrc file to startup X. I use fvwm2 as my window manager and it needs a .fvwm2rc configuration file. I also use a .Xdefaults file to setup stuff like colors and locations of windows. Here is what I use:

    • .fvwm2rc
        mouse clicks on desktop background:
        • <Meta><Shift>Btn1 - Utilities menu
        • <Meta><Shift>Btn2 - WindowOps menu
        • <Meta><Shift>Btn3 - WindowList menu
        mouse clicks anywhere:
        • <Meta><Cntrl>Btn1 - Quit-Verify menu
        • <Meta><Shift>Btn1 - WindowOps menu
        • <Meta><Shift>Btn2 - Shells menu
        • <Meta><Shift>Btn3 - Utilities menu
        mouse clicks inside a window:
        • <Meta>Btn1 - RaiseLower window
        • <Meta>Btn2 - Iconify window
        • <Meta><Cntrl>Btn2 - Move window
        • <Meta><Cntrl>Btn3 - Resize window
    • .xinitrc
    • .Xdefaults

    You should copy the above 3 files into your Home Directory in cygwin. Afterwards, you can start the X server by entering the following in the cygwin command window:

            xinit -- -fullscreen -emulate3buttons
    You can add an alias for the above command in your ~/.bash_profile file. For example, adding the following will alias xs to be the command above to start the X server:
            alias xs="xinit -- -fullscreen -emulate3buttons"
    To quit the X server, you can press <Alt><F4> or <Cntrl><Alt><Backspace>. You can also use <Alt><Tab> to switch between X and other Windows applications.

    You may also want to set an alias for ssh:

            alias ssh="ssh -X"

Running cygwin For The 2nd Time And More

  1. Click on the Cygwin icon on the desktop to run Cygwin for the second time. Type the following in the cygwin window to start the X server (xs stands for "X start"):
    
        $ xs
    When the current application is the X server, it will take up the whole screen. You can press <Alt><Tab> to switch to other applications in Windows.

  2. What you see in the X server are four instances of the xterm programs. You can type in UNIX commands (e.g., "ls", "date", etc.) in each window. I've setup an "di" alias to be equivalent to running the "ls -F" command. If you use "di" instead of "ls", directories will be displayed differently from a regular file. This can be handy sometimes.

  3. If the current application is the X server, you can press <Alt><F4> or <Cntl><Alt><Backspace> to quit X.
 
Comments
Things I like most about cygwin:
  • It uses Windows as its base system. So, if networking/display/mouse is working on Windows, you don't need to configure anything in cygwin because it just uses what Windows has. (If I have a dual-boot PC, occasionally I would run into trouble getting networking and display to work on Linux. Under cygwin, I never have to worry about things like this.)
Things I wish cygwin can do:
  • You cannot cut and paste between cygwin and Windows for some applications. What I normally do is to use files in ~/tmp in cygwin. On Windows' desktop, I would create a shortcut to ~/tmp. This way, I can save some text or gif/jpeg files in ~/tmp and then <Alt><Tab> to Windows side and import text and images from a file.
 

[Last updated Tue Sep 30 2008]   [Bill Cheng (bill.cheng@usc.edu)]