1. About Cygwin | |
1.1. | What is it? |
The Cygwin tools are ports of the popular GNU development tools for Microsoft Windows. They run thanks to the Cygwin library which provides the UNIX system calls and environment these programs expect. With these tools installed, it is possible to write Win32 console or GUI applications that make use of the standard Microsoft Win32 API and/or the Cygwin API. As a result, it is possible to easily port many significant Unix programs without the need for extensive changes to the source code. This includes configuring and building most of the available GNU software (including the packages included with the Cygwin development tools themselves). Even if the development tools are of little to no use to you, you may have interest in the many standard Unix utilities provided with the package. They can be used both from the bash shell (provided) or from the standard Windows command shell. | |
1.2. | What versions of Windows are supported? |
Cygwin can be expected to run on all modern 32 bit versions of Windows, except Windows CE. This includes Windows 95/98/ME/NT/2000/XP/2003 and the WOW64 32 bit environment on released 64 bit versions of Windows. As far as we know no one is working on a native 64 bit version of Cygwin. Since Cygwin is a community-supported free software project, patches to provide support for other versions would be thoughtfully considered. Paid support contracts or enhancements are available through Red Hat. For information about getting a Red Hat support contract, see http://cygwin.com/license.html. Keep in mind that Cygwin can only do as much as the underlying OS supports. Because of this, Cygwin will behave differently, and exhibit different limitations, on the various versions of Windows. | |
1.3. | Where can I get it? |
The home page for the Cygwin project is http://cygwin.com/. There you should find everything you need for Cygwin, including links for download and setup, a current list of mirror sites, a User's Guide, an API Reference, mailing lists and archives, and additional ported software. You can find documentation for the individual GNU tools at http://www.gnu.org/manual/. (You should read GNU manuals from a local mirror. Check http://www.gnu.org/server/list-mirrors.html for a list of them.) | |
1.4. | Is it free software? |
Yes. Parts are GNU software (gcc, gas, ld, etc...), parts are covered by the standard X11 license, some of it is public domain, some of it was written by Cygnus and placed under the GPL. None of it is shareware. You don't have to pay anyone to use it but you should be sure to read the copyright section of the FAQ for more information on how the GNU General Public License may affect your use of these tools. In particular, if you intend to port a proprietary (non-GPL'd) application using Cygwin, you will need the proprietary-use license for the Cygwin library. This is available for purchase; please visit http://cygwin.com/license.html for more information. All other questions should be sent to the project mailing list cygwin@cygwin.com. Note that when we say "free" we mean freedom, not price. The goal of such freedom is that the people who use a given piece of software should be able to change it to fit their needs, learn from it, share it with their friends, etc. The Cygwin license allows you those freedoms, so it is free software. | |
1.5. | What version of Cygwin is this, anyway? |
To find the version of the Cygwin DLL installed, you can use
If you are looking for the version number for the whole Cygwin release, there is none. Each package in the Cygwin release has its own version. The packages in Cygwin are continually improving, thanks to the efforts of net volunteers who maintain the Cygwin binary ports. Each package has its own version numbers and its own release process. So, how do you get the most up-to-date version of Cygwin? Easy. Just
download the Cygwin Setup program from
http://cygwin.com/setup.exe. This program will handle the task
of updating the packages on your system to the latest version. For
more information about using Cygwin's | |
1.6. | Who's behind the project? |
(Please note that if you have cygwin-specific questions, all of these people will appreciate it if you use the cygwin mailing lists rather than sending personal email.) Chris Faylor is behind many of the recent changes in Cygwin. Prior to joining Cygnus, he contributed significant fixes to the process control and environ code, reworked the strace mechanism, and rewrote the signal-related code from scratch as a Net contributor. In addition to continuing to make technical contributions, Chris is also currently the group's manager. Corinna Vinschen has contributed several useful fixes to the path handling code, console support, improved security handling, and raw device support. Corinna is currently employed by Red Hat as a GDB/Cygwin engineer. DJ Delorie has done important work in profiling Cygwin, worked on the Dejagnu automated testing framework, merged the dlltool functionality into ld, wrote a good deal of the Cygwin Users' Guide, authored the cygcheck utility, and made automated snapshots available from our project WWW page. DJ is currently employed by Red Hat as a GCC engineer. Egor Duda has contributed many useful fixes. He is responsible for Cygwin's ability to start a debugger on detection of a fatal error as well as produce core dumps. Robert Collins has contributed many improvements to thread handling as well as generic fixes to cygwin itself. Kazuhiro Fujieda has contributed many bug fixes and bug reports. Earnie Boyd has contributed many bug fixes and is the mingw and w32api maintainer. David Starks-Browning is our dedicated FAQ maintainer. Geoffrey Noer took over the Cygwin project from its initial author Steve Chamberlain in mid-1996. As maintainer, he produced Net releases beta 16 through 20; made the development snapshots; worked with Net contributors to fix bugs; made many various code improvements himself; wrote a paper on Cygwin for the 1998 Usenix NT Symposium; authored the project WWW pages, FAQ, README; etc. Geoffrey is not currently employed by Red Hat. Steve Chamberlain designed and implemented Cygwin in 1995-1996 while working for Cygnus. He worked with the Net to improve the technology, ported/integrated many of the user tools for the first time to Cygwin, and produced all of the releases up to beta 14. Steve is not currently employed by Red Hat. Marco Fuykschot and Peter Boncz of Data Distilleries contributed nearly all of the changes required to make Cygwin thread-safe. They also provided the pthreads interface. Sergey Okhapkin has been an invaluable Net contributor. He implemented the tty/pty support, has played a significant role in revamping signal and exception handling, and has made countless contributions throughout the library. He also provided binaries of the development snapshots to the Net after the beta 19 release. Mumit Khan has been most helpful on the EGCS end of things, providing quite a large number of stabilizing patches to the compiler tools for the B20 release. Philippe Giacinti contributed the implementation of dlopen, dlclose, dlsym, dlfork, and dlerror in Cygwin. Ian Lance Taylor did a much-needed rework of the path handling code for beta 18, and has made many assorted fixes throughout the code. Jeremy Allison made significant contributions in the area of file handling and process control, and rewrote select from scratch. Doug Evans rewrote the path-handling code in beta 16, among other things. Kim Knuttila and Michael Meissner put in many long hours working on the now-defunct PowerPC port. Jason Molenda and Mark Eichin have also made important contributions. Please note that all of us working on Cygwin try to be as responsive as possible and deal with patches and questions as we get them, but realistically we don't have time to answer all of the email that is sent to the main mailing list. Making Net releases of the Win32 tools and helping people on the Net out is not our primary job function, so some email will have to go unanswered. Many thanks to everyone using the tools for their many contributions in the form of advice, bug reports, and code fixes. Keep them coming! | |
2. Setting up Cygwin | |
| |
2.1. | What is the recommended installation procedure? |
There is only one recommended way to install Cygwin, which is to use the GUI installer ``Cygwin Setup''. It is flexible and easy to use. You can pick and choose the packages you wish to install, and update them individually. Full source code is available for all packages and tools. More information on using Cygwin Setup may be found at http://cygwin.com/cygwin-ug-net/setup-net.html. If you do it any other way, you're on your own! That said, keep in mind that the GUI installer is a "work in progress", so there might be a few difficulties, especially if you are behind a firewall or have other specific requirements. If something doesn't work right for you, and it's not covered here or in the latest development snapshot at http://cygwin.com/snapshots/, then by all means report it to the mailing list. For a searchable list of packages that can be installed with Cygwin, see http://cygwin.com/packages/. | |
2.2. | What about an automated Cygwin installation? |
The Cygwin Setup program is designed to be interactive, but there are
a few different ways to automate it. If you are deploying to multiple systems,
the best way is to run through a full installation once, saving the entire
downloaded package tree. Then, on target systems, run setup.exe as a "Local
Install" pointed at your downloaded package tree. You could do this
non-interactively with the command line options
For other options, search the mailing lists with terms such as cygwin automated setup or automated cygwin install. | |
2.3. | Does setup.exe accept command-line arguments? |
Yes, the full listing is written to the
Command Line Options:
-D --download Download from internet
-L --local-install Install from local directory
-s --site Download site
-R --root Root installation directory
-q --quiet-mode Unattended setup mode
-h --help print help
-l --local-package-dir Local package directory
-r --no-replaceonreboot Disable replacing in-use files on next
reboot.
-n --no-shortcuts Disable creation of desktop and start
menu shortcuts
-N --no-startmenu Disable creation of start menu shortcut
-d --no-desktop Disable creation of desktop shortcut
-A --disable-buggy-antivirus Disable known or suspected buggy anti
virus software packages during
execution.
| |
2.4. | Why not install in C:\? |
The Cygwin Setup program will prompt you for a "root" directory.
The default is (In the past, there had been genuine bugs that would cause problems
for people who installed in | |
2.5. | Can I use Cygwin Setup to get old versions of packages (like gcc-2.95)? |
Cygwin Setup can be used to install any packages that are on a Cygwin mirror, which usually includes one version previous to the current one. The complete list may be searched at http://cygwin.com/packages/. There is no complete archive of older packages. If you have a problem with the current version of a Cygwin package, please report it to the mailing list using the guidelines at http://cygwin.com/problems.html. That said, if you really need an older package, you may be able to find
an outdated or archival mirror by searching the web for an old package
version (for example, | |
2.6. | Is Cygwin Setup, or one of the packages, infected with a virus? |
Unlikely. Unless you can confirm it, please don't report it to the
mailing list. Anti-virus products have been known to detect false
positives when extracting compressed tar archives. If this causes
problems for you, consider disabling your anti-virus software when
running | |
2.7. | My computer hangs when I run Cygwin Setup! |
Both Network Associates (formerly McAfee) and Norton anti-virus products have been reported to "hang" when extracting Cygwin tar archives. If this happens to you, consider disabling your anti-virus software when running Cygwin Setup. The following procedure should be a fairly safe way to do that:
This should be safe, but only if Cygwin Setup is not substituted by something malicious, and no mirror has been compromised. See also http://cygwin.com/faq/faq.using.html#faq.using.bloda for a list of applications that have been known, at one time or another, to interfere with the normal functioning of Cygwin. | |
2.8. | What packages should I download? Where are 'make', 'gcc', 'vi', etc? |
When using Cygwin Setup for the first time, the default is to install
a minimal subset of all available packages. If you want anything beyond that,
you will have to select it explicitly. See
http://cygwin.com/packages/ for a searchable list of available
packages, or use If you want to build programs, of course you'll need | |
2.9. | How do I just get everything? |
Long ago, the default was to install everything, much to the irritation of most users. Now the default is to install only a basic core of packages. Cygwin Setup is designed to make it easy to browse categories and select what you want to install or omit from those categories. It's also easy to install everything:
This procedure only works for packages that are currently available. There is no way to tell Cygwin Setup to install all packages by default from now on. As new packages become available that would not be installed by default, you have to repeat the above procedure to get them. In general, a better method (in my opinion), is to:
| |
2.10. | How much disk space does Cygwin require? |
That depends, obviously, on what you've chosen to download and install. A full installation today is probably larger than 800MB installed, not including the package archives themselves nor the source code. After installation, the package archives remain in your ``Local
Package Directory'', by default the location of Of course, you can keep them around in case you want to reinstall a
package. If you want to clean out only the outdated packages, Michael Chase
has written a script called | |
2.11. | How do I know which version I upgraded from? |
Detailed logs of the most recent Cygwin Setup session can be found in
| |
2.12. | What if setup fails? |
First, make sure that you are using the latest version of Cygwin Setup. The latest version is always available from the 'Install Cygwin now' link on the Cygwin Home Page at http://cygwin.com/. If you are downloading from the Internet, setup will fail if it cannot download the list of mirrors at http://cygwin.com/mirrors.html. It could be that the network is too busy. Something similar could be the cause of a download site not working. Try another mirror, or try again later. If setup refuses to download a package that you know needs to be upgraded, try deleting that package's entry from /etc/setup. If you are reacting quickly to an announcement on the mailing list, it could be that the mirror you are using doesn't have the latest copy yet. Try another mirror, or try again tomorrow. If setup has otherwise behaved strangely, check the files
If you're still baffled, search the Cygwin mailing list for clues. Others may have the same problem, and a solution may be posted there. If that search proves fruitless, send a query to the Cygwin mailing list. You must provide complete details in your query: version of setup, options you selected, contents of setup.log and setup.log.full, what happened that wasn't supposed to happen, etc. | |
2.13. | My Windows logon name has a space in it, will this cause problems? |
Most definitely yes! UNIX shells (and thus Cygwin) use the space character as a word delimiter. Under certain circumstances, it is possible to get around this with various shell quoting mechanisms, but you are much better off if you can avoid the problem entirely. On Windows NT/2000/XP you have two choices:
On Windows 95/98/ME you can create a new user and run mkpasswd, or you can delete the offending entry from /etc/passwd. Cygwin will then use the name in the default entry with uid 500. | |
2.14. | My |
When starting Cygwin from Windows,
When using Cygwin from the network (telnet, ssh,...), If your Access to shared drives is often restricted when starting from the network,
thus Domain users may wish to have a different | |
2.15. | How do I uninstall individual packages? |
Run Cygwin Setup as you would to install packages. In the list of packages to install, browse the relevant category or click on the ``View'' button to get a full listing. Click on the cycle glyph until the action reads ``Uninstall''. Proceed by clicking ``Next''. | |
2.16. | How do I uninstall a Cygwin service? |
| |
2.17. | How do I uninstall all of Cygwin? |
Setup has no automatic uninstall facility. The recommended method to remove all of Cygwin is as follows:
| |
2.18. | How do I install snapshots? |
First, are you sure you want to do this? Snapshots are risky. They have not been tested. Use them only if there is a feature or bugfix that you need to try, and you are willing to deal with any problems, or at the request of a Cygwin developer. You should generally install the full
You cannot use Cygwin Setup to install a snapshot. First, you will need to download the snapshot from the snapshots page at http://cygwin.com/snapshots/. Note the directory where you saved the snapshot tarball. Before installing a snapshot, you must first Close all Cygwin
applications, including shells and services (e.g., Most of the downloaded snapshot can be installed using /bin/tar -C/ -jxvf /posix/path/to/cygwin-inst-YYYYMMDD.tar.bz2 --exclude=usr/bin/cygwin1.dll /bin/tar -C/tmp -jxvf /posix/path/to/cygwin-inst-YYYYMMDD.tar.bz2 usr/bin/cygwin1.dll
Exit the bash shell, and use Explorer or the Windows command shell to
first rename The operative word in trying the snapshots is "trying". If you
notice a problem with the snapshot that was not present in the release
DLL (what we call a "regression"), please report it to the Cygwin
mailing list (see http://cygwin.com/problems.html for problem
reporting guidelines). If you wish to go back to the older version of the
DLL, again, close all Cygwin processes, delete
| |
2.19. | Can Cygwin Setup maintain a ``mirror''? |
NO. Cygwin Setup cannot do this for you. Use a tool designed for this purpose. See http://rsync.samba.org/, http://wget.sunsite.dk/ for utilities that can do this for you. For more information on setting up a custom Cygwin package server, see the Cygwin Setup homepage at http://sources.redhat.com/cygwin-apps/setup.html. | |
2.20. | How can I make my own portable Cygwin on CD? |
While some users have successfully done this, for example Indiana University's XLiveCD http://xlivecd.indiana.edu/, there is no easy way to do it. Full instructions for constructing a porttable Cygwin on CD by hand can be found on the mailing list at http://www.cygwin.com/ml/cygwin/2003-07/msg01117.html. (Thanks to fergus at bonhard dot uklinux dot net for these instructions.) | |
2.21. | How do I save, restore, delete, or modify the Cygwin information stored in the registry? |
Currently Cygwin stores its mount table information in the registry. It
is recommended that you use the To save the mount information to a file for later restoration, use
| |
3. Further Resources | |
3.1. | Where's the documentation? |
If you have installed Cygwin, you can find lots of documentation in
There are links to quite a lot of documentation on the main Cygwin project web page, http://cygwin.com/, including this FAQ. Be sure to at least read any 'Release Notes' or 'Readme' or 'read this' links on the main web page, if there are any. There is a comprehensive Cygwin User's Guide at http://cygwin.com/cygwin-ug-net/cygwin-ug-net.html and an API Reference at http://cygwin.com/cygwin-api/cygwin-api.html. You can find documentation for the individual GNU tools at http://www.fsf.org/manual/. (You should read GNU manuals from a local mirror, check http://www.fsf.org/server/list-mirrors.html for a list of them.) | |
3.2. | What Cygwin mailing lists can I join? |
Comprehensive information about the Cygwin mailing lists can be found at http://cygwin.com/lists.html. | |
3.3. | What if I have a problem? (Or: Why won't you/the mailing list answer my questions?) |
Comprehensive information about reporting problems with Cygwin can be found at http://cygwin.com/problems.html. | |
4. Using Cygwin | |
| |
4.1. | Why can't my application locate cygncurses5.dll? or cygintl.dll? or cygreadline5.dll? or ...? |
If you upgraded recently, and suddenly vim (or some other Cygwin
application) cannot find Note that Cygwin Setup won't show this option by default. In the
``Select packages to install'' dialog, click on the Similarly, if something cannot find For a detailed explanation of the general problem, and how to extend it to other missing DLLs (like cygreadline5.dll) and identify their containing packages, see http://cygwin.com/ml/cygwin/2002-01/msg01619.html. | |
4.2. | Why is Cygwin suddenly so slow? |
If you recently upgraded and suddenly every command takes a
very long time, then something is probably attempting to
access a network share. You may have the obsolete Using //c (for C:) doesn't work anymore. (Similarly for any drive
letter, e.g. | |
4.3. | Why don't my services work? |
Most Windows services run as a special user called eval "`mount -m | sed -e 's/ -u / -s /g' -e 's/$/;/'`" | |
4.4. | Why can't my services access network shares? |
When a service switches to a certain user, it is running as
Workarounds include using public network share that does not require
authentication (for non-critical files), providing your password to a
net use command, or running the service as your own
user with | |
4.5. | How should I set my PATH? |
This is done for you in the file /etc/profile, which is sourced by bash
when you start it from the Desktop or Start Menu shortcut, created by
PATH="/usr/local/bin:/usr/bin:/bin:$PATH" Effectively, this prepends /usr/local/bin and /usr/bin to your
Windows system path. If you choose to reset your PATH, say in
$HOME/.bashrc, or by editing etc/profile directly, then you should
follow this rule. You must have | |
4.6. | Bash says "command not found", but it's right there! |
If you compile a program, you might find that you can't run it:
bash$ gcc -o hello hello.c
bash$ hello
bash: hello: command not found
Unlike Windows, bash does not look for programs in
bash$ gcc -o hello hello.c
bash$ ./hello
Hello World!
| |
4.7. | How do I convert between Windows and UNIX paths? |
Use the 'cygpath' utility. Type '
bash$ cygpath --windows ~/.bashrc
D:\starksb\.bashrc
bash$ cygpath --unix C:/cygwin/bin/cygwin.bat
/usr/bin/cygwin.bat
bash$ cygpath --unix C:\\cygwin\\bin\\cygwin.bat
/usr/bin/cygwin.bat
Note that bash interprets the backslash '\' as an escape character, so you must type it twice in the bash shell if you want it to be recognized as such. | |
4.8. | Why doesn't bash read my .bashrc file on startup? |
Your .bashrc is read from your home directory specified by the HOME environment variable. It uses /.bashrc if HOME is not set. So you need to set HOME correctly, or move your .bashrc to the top of the drive mounted as / in Cygwin. | |
4.9. | How can I get bash filename completion to be case insensitive? |
Add the following to your shopt -s nocaseglob and add the following to your set completion-ignore-case on | |
4.10. | Can I use paths/filenames containing spaces in them? |
Cygwin does support spaces in filenames and paths. That said, some utilities that use the library may not, since files don't typically contain spaces in Unix. If you stumble into problems with this, you will need to either fix the utilities or stop using spaces in filenames used by Cygwin tools. In particular, bash interprets space as a word separator. You would have to quote a filename containing spaces, or escape the space character. For example: bash-2.03$ cd '/cygdrive/c/Program Files' or bash-2.03$ cd /cygdrive/c/Program\ Files
| |
4.11. | Why can't I cd into a shortcut to a directory? |
Cygwin versions < 1.3.0 do not follow MS Windows Explorer Shortcuts (*.lnk files). It sees a shortcut as a regular file and this you cannot "cd" into it. Since version 1.3.0, Cygwin uses shortcuts as symlinks by default. Cygwin shortcuts are different from shortcuts created by native Windows applications. Windows applications can usually make use of Cygwin shortcuts but not vice versa. This is by choice. The reason is that Windows shortcuts may contain a bunch of extra information which would get lost, if, for example, Cygwin tar archives and extracts them as symlinks. Changing a Cygwin shortcut in Windows Explorer usually changes a Cygwin shortcut into a Windows native shortcut. Afterwards, Cygwin will not recognize it as symlink anymore. | |
4.12. | I'm having basic problems with find. Why? |
Make sure you are using the find that came with Cygwin and that you aren't picking up the Win32 find command instead. You can verify that you are getting the right one by doing a "type find" in bash. If the path argument to find, including current directory (default), is
itself a symbolic link, then find will not traverse it unless you
specify the If find does not seem to be producing enough results, or seems to be
missing out some directories, you may be experiencing a problem with one
of find's optimisations. The absence of | |
4.13. | Why doesn't |
The You may be able to use For some technical background into why | |
4.14. | Why doesn't man (or apropos) work? |
Before you can use /usr/sbin/makewhatis (it may take a minute to complete). | |
4.15. | Why doesn't |
The most common case is that your If you're using FAT32 instead of NTFS, For other cases, understand that Cygwin attempts to show UNIX permissions based on the security features of Windows, so the Windows ACLs are likely the source of your problem. See the Cygwin User's Guide at http://cygwin.com/cygwin-ug-net/ntsec.html for more information on how Cygwin maps Windows permissions. | |
4.16. | Why doesn't |
Starting with bash$ mkdir -p //MACHINE/Share/path/to/new/dir However, coreutils expects Unix path names, so something like
| |
4.17. | Why doesn't my shell script work? |
There are two basic problems you might run into. One is the fact that /bin/sh is really bash (prior to bash-3.0-6, /bin/sh was ash). and is missing some features you might expect in /bin/sh, particularly if you are used to /bin/sh actually being zsh (MacOS X "Panther") or ksh (Tru64). Or, it could be a permission problem, and Cygwin doesn't understand that your script is executable. Because #! /bin/sh (or any path to a script interpreter, it does not have to be /bin/sh) then Cygwin will not know it is an executable script. The Bourne shell idiom : # This is the 2nd line, assume processing by /bin/sh also works. Note that you can use | |
4.18. | How do I print under Cygwin? |
There is no working lp or lpr system as you would find on UNIX. Jason Tishler has written a couple of messages that explain how to use
a2ps (for nicely formatted text in PostScript) and ghostscript (to print
PostScript files on non-PostScript Windows printers). Start at
http://cygwin.com/ml/cygwin/2001-04/msg00657.html. Note that the
Alternatively, on NT, you can use the Windows bash$ print /\? for usage instructions (note the Finally, you can simply bash$ cat myfile > //host/printer You may need to press the formfeed button on your printer or append the formfeed character to your file. | |
4.19. | Why don't international (Unicode) characters work? |
Internationalization is a complex issue. The short answer is that
Cygwin is not Unicode-aware, so things that might work in Linux will
not necessarily work on Cygwin. However, some things do work. To type
international characters (£äö) in
set meta-flag on
set convert-meta off
set output-meta on
set input-meta on
set kanji-code sjis
These are options to the alias less='/bin/less -r' alias ls='/bin/ls -F --color=tty --show-control-chars' export LANG="ja_JP.SJIS" export OUTPUT_CHARSET="sjis" These examples use the Japanese Shift-JIS character set, obviously you will want to change them for your own locale. | |
4.20. | Why don't cursor keys work under Win95/Win98? |
(Please note: This section has not yet been updated for the latest net release.) Careful examination shows that they not just non-functional, but rather behave strangely, for example, with NumLock off, keys on numeric keyboard work, until you press usual cursor keys, when even numeric stop working, but they start working again after hitting alphanumeric key, etc. This reported to happen on localized versions of Win98 and Win95, and not specific to Cygwin; there are known cases of Alt+Enter (fullscreen/windowed toggle) not working and shifts sticking with other programs. The cause of this problem is Microsoft keyboard localizer which by default installed in 'autoexec.bat'. Corresponding line looks like: keyb ru,,C:\WINDOWS\COMMAND\keybrd3.sys (That's for russian locale.) You should comment that line if you want your keys working properly. Of course, this will deprive you of your local alphabet keyboard support, so you should think about another localizer. ex-USSR users are of course knowledgeable of Keyrus localizer, and it might work for other locales too, since it has keyboard layout editor. But it has russian messages and documentation ;-( Reference URL is http://www.hnet.ru/software/contrib/Utils/KeyRus/ (note the you may need to turn off Windows logo for Keyrus to operate properly). | |
4.21. | Is it OK to have multiple copies of the DLL? |
You should only have one copy of the Cygwin DLL on your system. If you have multiple versions, they will conflict and cause problems. If you get the error "shared region is corrupted" or "shared region version mismatch" it means you have multiple versions of cygwin1.dll running at the same time. This could happen, for example, if you update cygwin1.dll without exiting all Cygwin apps (including inetd) beforehand. The only DLL that is sanctioned by the Cygwin project is the one that
you get by running setup.exe, installed in the
directory controlled by this program. If you have other versions on
your system and desire help from the cygwin project, you should delete
or rename all DLLs that are not installed by If you're trying to find multiple versions of the DLL that are causing this problem, reboot first, in case DLLs still loaded in memory are the cause. Then use the Windows System find utility to search your whole machine, not just components in your PATH (as 'type' would do) or cygwin-mounted filesystems (as Cygwin 'find' would do). | |
4.22. | I read the above but I want to bundle Cygwin with a product, and ship it to customer sites. How can I do this without conflicting with any Cygwin installed by the user? |
Third party developers who wish to use Cygwin should check if there is a version of cygwin installed and use the installed version if it is newer, or conditionally upgrade if it is not. (If you write a tool to make this easy, consider contributing it for others to use) | |
4.23. | Can I bundle Cygwin with my product for free? |
Only if you comply with Cygwin's license very carefully. If you choose to distribute cygwin1.dll, you must be willing to distribute the exact source code used to build that copy of cygwin1.dll as per the terms of the GPL. If you ship applications that link with cygwin1.dll, you must either provide those applications' source code under a GPL-compatible license, *or* purchase a cygwin license from Red Hat. | |
4.24. | So I can't install a private version of the Cygwin DLL without conflictng with the system cygwin? |
Actually, if you are very careful, you can have two different versions of the Cygwin DLL installed on your system at the same time but they must be run serially. This means that you can't be running programs using both versions of Cygwin at the same time. Please be aware that currently both versions will use the same mount table entries although this wil change in Cygwin version 1.7.x. This usage is not recommeded for novices. Only limited support will be provided in the mailing lists if you run into problems. | |
4.25. | But doesn't that mean that if some application installs an older Cygwin DLL on top of a newer DLL, my application will break? |
It depends on what you mean by "break". If the application installs a version of the Cygwin DLL in another location than Cygwin's /bin directory then the rules in 9.3 apply. If the application installs an older version of the DLL in /bin then you should complain loudly to the application provider. Remember that the Cygwin DLL strives to be backwards compatible so a newer version of the DLL should always work with older executables. So, in general, it is always best to keep one version of the DLL on your system and it should always be the latest version which matches your installed distribution. | |
4.26. | Why isn't package XYZ available in Cygwin? |
Probably because there is nobody willing or able to maintain it. It takes time, and the priority for the Cygwin Team is the Cygwin package. The rest is a volunteer effort. Want to contribute? See http://cygwin.com/setup.html. | |
4.27. | Why is the Cygwin package of XYZ so out of date? |
(Also: Why is the version of package XYZ older than the version that I can download from the XYZ web site? Why is the version of package XYZ older than the version that I installed on my linux system? Is there something special about Cygwin which requires that only an older version of package XYZ will work on it?) Every package in the Cygwin distribution has a maintainer who is responsible for sending out updates of the package. This person is a volunteer who is rarely the same person as the official developer of the package. If you notice that a version of a package seems to be out of date, the reason is usually pretty simple -- the person who is maintaining the package hasn't gotten around to updating it yet. Rarely, the newer package actually requires complex changes that the maintainer is working out. If you urgently need an update, sending a polite message to the cygwin mailing list pinging the maintainer is perfectly acceptable. There are no guarantees that the maintainer will have time to update the package or that you'll receive a response to your request, however. Remeber that the operative term here is "volunteer". | |
4.28. | How can I access other drives? |
You have some flexibility here. Cygwin has a builtin "cygdrive prefix" for drives that are not mounted. You can access any drive, say Z:, as '/cygdrive/z/'. In some applications (notably bash), you can use the familiar windows <drive>:/path/, using posix forward-slashes ('/') instead of Windows backward-slashes ('\'). (But see the warning below!) This maps in the obvious way to the Windows path, but will be converted internally to use the Cygwin path, following mounts (default or explicit). For example:
bash$ cd C:/Windows
bash$ pwd
/cygdrive/c/Windows
and
bash$ cd C:/cygwin
bash$ pwd
/
for a default setup. You could also use backward-slashes in the Windows path, but these would have to be escaped from the shell. Warning: There is some ambiguity in going from a Windows path to the posix path, because different posix paths, through different mount points, could map to the same Windows directory. This matters because different mount points may be binmode or textmode, so the behavior of Cygwin apps will vary depending on the posix path used to get there. You can avoid the ambiguity of Windows paths, and avoid typing "/cygdrive", by explicitly mounting drives to posix paths. For example: bash$ mkdir /c bash$ mount c:/ /c bash$ ls /c
Then Note that you only need to mount drives once. The mapping is kept in the registry so mounts stay valid pretty much indefinitely. You can only get rid of them with umount, or the registry editor. The '-b' option to mount mounts the mountpoint in binary mode ("binmode") where text and binary files are treated equivalently. This should only be necessary for badly ported Unix programs where binary flags are missing from open calls. It is also the setting for /, /usr/bin and /usr/lib in a default Cygwin installation. The default for new mounts is text mode ("textmode"), which is also the mode for all "cygdrive" mounts. You can change the default bash$ mount -b --change-cygdrive-prefix cygdrive
will change all | |
4.29. | How can I copy and paste into Cygwin console windows? |
First, consider using rxvt instead of the standard console window. In rxvt, selecting with the left-mouse also copies, and middle-mouse pastes. It couldn't be easier! Under Windows NT, open the properties dialog of the console window. The options contain a toggle button, named "Quick edit mode". It must be ON. Save the properties. Under Windows 9x, open the properties dialog of the console window. Select the Misc tab. Uncheck Fast Pasting. Check QuickEdit. You can also bind the insert key to paste from the clipboard by adding the following line to your .inputrc file: "\e[2~": paste-from-clipboard
| |
4.30. | What firewall should I use with Cygwin? |
We have had good reports about Kerio Personal Firewall, ZoneLabs Integrity Desktop, and the built-in firewall in Windows XP. Other well-known products including ZoneAlarm and Norton Internet Security have caused problems for some users but work fine for others. At last report, Agnitum Outpost did not work with Cygwin. If you are having strange connection-related problems, disabling the firewall is a good troubleshooting step (as is closing or disabling all other running applications, especially resource-intensive processes such as indexed search). On the whole, Cygwin doesn't care which firewall is used. The few rare exceptions have to do with socket code. Cygwin uses sockets to implement many of its functions, such as IPC. Some overzealous firewalls install themselves deeply into the winsock stack (with the 'layered service provider' API) and install hooks throughout. Sadly the mailing list archives are littered with examples of poorly written firewall-type software that causes things to break. Note that with many of these products, simply disabling the firewall does not remove these changes; it must be completely uninstalled. See also http://cygwin.com/faq/faq.using.html#faq.using.bloda for a list of applications that have been known, at one time or another, to interfere with the normal functioning of Cygwin. | |
4.31. | How can I share files between Unix and Windows? |
During development, we have both Linux boxes running Samba and Windows machines. We often build with cross-compilers under Linux and copy binaries and source to the Windows system or just toy with them directly off the Samba-mounted partition. On dual-boot NT/Windows 9x machines, we usually use the FAT filesystem so we can also access the files under Windows 9x. | |
4.32. | Is Cygwin case-sensitive? What are managed mounts? |
Several Unix programs expect to be able to use to filenames
spelled the same way, but with different case. A prime example
of this is perl's configuration script, which wants To help with this problem, starting in mkdir /managed-dir mount -o managed c:/cygwin/managed-dir /managed-dir cd /managed-dir/ touch makefile touch Makefile | |
4.33. | What about DOS special filenames? |
Files cannot be named com1, lpt1, or aux (to name a few); either as
the root filename or as the extension part. If you do, you'll have
trouble. Unix programs don't avoid these names which can make things
interesting. E.g., the perl distribution has a file called
| |
4.34. | When it hangs, how do I get it back? |
If something goes wrong and the tools hang on you for some reason (easy to do if you try and read a file called aux.sh), first try hitting ^C to return to bash or the cmd prompt. If you start up another shell, and applications don't run, it's a good bet that the hung process is still running somewhere. Use the Task Manager, pview, or a similar utility to kill the process. And, if all else fails, there's always the reset button/power switch. This should never be necessary under Windows NT. | |
4.35. | Why the weird directory structure? |
Why do /lib and /usr/lib (and /bin, /usr/bin) point to the same thing? Why use mounts instead of symbolic links? Can I use a disk root (e.g., C:\) as Cygwin root? Why is this discouraged? After a new installation in the default location, your mount points will look something like this: bash$ mount C:\cygwin\bin on /usr/bin type system (binmode) C:\cygwin\lib on /usr/lib type system (binmode) C:\cygwin on / type system (binmode) (Exactly what you see depends on what options you gave to Note that /bin and /usr/bin point to the same location, as do /lib and /usr/lib. This is intentional, and you should not undo these mounts unless you really know what you are doing. Various applications and packages may expect to be installed in /lib or /usr/lib (similarly /bin or /usr/bin). Rather than distinguish between them and try to keep track of them (possibly requiring the occasional duplication or symbolic link), it was decided to maintain only one actual directory, with equivalent ways to access it. Symbolic links had been considered for this purpose, but were dismissed because they do not always work on Samba drives. Also, mounts are faster to process because no disk access is required to resolve them. Note that non-cygwin applications will not observe Cygwin mounts (or symlinks for that matter). For example, if you use WinZip to unpack the tar distribution of a Cygwin package, it may not get installed to the correct Cygwin path. So don't do this! It is strongly recommended not to make the Cygwin root directory the same as your drive's root directory, unless you know what you are doing and are prepared to deal with the consequences. It is generally easier to maintain the Cygwin hierarchy if it is isolated from, say, C:\. For one thing, you avoid possible collisions with other (non-cygwin) applications that may create (for example) \bin and \lib directories. (Maybe you have nothing like that installed now, but who knows about things you might add in the future?) | |
4.36. | How do anti-virus programs like Cygwin? |
Users have reported that NAI (formerly McAfee) VirusScan for NT (and others?) is incompatible with Cygwin. This is because it tries to scan the newly loaded shared memory in cygwin1.dll, which can cause fork() to fail, wreaking havoc on many of the tools. (It is not confirmed that this is still a problem, however.) There have been several reports of NAI VirusScan causing the system to hang when unpacking tar.gz archives. This is surely a bug in VirusScan, and should be reported to NAI. The only workaround is to disable VirusScan when accessing these files. This can be an issue during setup, and is discussed in that FAQ entry. Some users report a significant performance hit using Cygwin when their
anti-virus software is enabled. Rather than disable the anti-virus
software completely, it may be possible to specify directories whose
contents are exempt from scanning. In a default installation, this
would be See also http://cygwin.com/faq/faq.using.html#faq.using.bloda for a list of applications that have been known, at one time or another, to interfere with the normal functioning of Cygwin. | |
4.37. | Is there a Cygwin port of GNU Emacs? |
Yes! It uses the X11 (http://cygwin.com/xfree/) Windows interface. From a remote login shell, this ``emacs -nw'' works fine. There is also a non-X11 version which just provides the text-only terminal interface. Use Cygwin Setup to install either one (or both). | |
4.38. | What about NT Emacs? |
If you want GNU Emacs with a native Microsoft Windows interface, but without X, then you must use the native Windows port, commonly known as ``NT Emacs''. You get NT Emacs from any GNU mirror. It is not available from Cygwin Setup. NT Emacs uses the Windows command shell by default. Since it is not a Cygwin application, it has no knowledge of Cygwin mounts. With those points in mind, you need to add the following code to your ~/.emacs (or ~/_emacs) file in order to use Cygwin bash. This is particularly useful for the JDEE package (http://jdee.sunsite.dk/). The following settings are for Emacs 21.1: ;; This assumes that Cygwin is installed in C:\cygwin (the ;; default) and that C:\cygwin\bin is not already in your ;; Windows Path (it generally should not be). ;; (setq exec-path (cons "C:/cygwin/bin" exec-path)) (setenv "PATH" (concat "C:\\cygwin\\bin;" (getenv "PATH"))) ;; ;; NT-emacs assumes a Windows command shell, which you change ;; here. ;; (setq shell-file-name "bash") (setenv "SHELL" shell-file-name) (setq explicit-shell-file-name shell-file-name) ;; ;; This removes unsightly ^M characters that would otherwise ;; appear in the output of java applications. ;; (add-hook 'comint-output-filter-functions 'comint-strip-ctrl-m) If you want NT Emacs to understand Cygwin paths, get cygwin-mount.el from http://www.emacswiki.org/elisp/index.html. Note that all of this ``just works'' if you use the Cygwin port of Emacs from Cygwin Setup. | |
4.39. | What about XEmacs? |
For a concise description of the current situation with XEmacs, see this message from the Cygwin mailing list: http://cygwin.com/ml/cygwin/2002-11/msg00609.html. | |
4.40. | Is there a better alternative to the standard console window? |
Yes! Use rxvt instead. It's an optional package in Cygwin Setup.
You can use it with or without X11. You can resize it easily by
dragging an edge or corner. Copy and paste is easy with the left and
middle mouse buttons, respectively. It will honor settings in your
~/.Xdefaults file, even without X. For details see
| |
4.41. | info error "dir: No such file or directory" |
Cygwin packages install their info documentation in the
bash$ cd /usr/share/info bash$ for f in *.info ; do install-info $f dir ; done This may generate warnings: install-info: warning: no info dir entry in `gzip.info' install-info: warning: no info dir entry in `time.info'
The Even if the dir file already exists, you may have to update it when you install new Cygwin packages. Some packages update the dir file for you, but many don't. | |
4.42. | Why do I get a message saying Out of Queue slots? |
"Out of queue slots!" generally occurs when you're trying to remove many files that you do not have permission to remove (either because you don't have permission, they are opened exclusively, etc). What happens is Cygwin queues up these files with the supposition that it will be possible to delete these files in the future. Assuming that the permission of an affected file does change later on, the file will be deleted as requested. However, if too many requests come in to delete inaccessible files, the queue overflows and you get the message you're asking about. Usually you can remedy this with a quick chmod, close of a file, or other such thing. (Thanks to Larry Hall for this explanation). | |
4.43. | Why don't symlinks work on samba-mounted filesystems? |
Symlinks are marked with "system" file attribute. Samba does not enable this attribute by default. To enable it, consult your Samba documentation and then add these lines to your samba configuration file: map system = yes create mask = 0775 Note that the 0775 can be anything as long as the 0010 bit is set. | |
4.44. | Why does df report sizes incorrectly. |
There is a bug in the Win32 API function GetFreeDiskSpace that makes it return incorrect values for disks larger than 2 GB in size. Perhaps that may be your problem? | |
4.45. | Why doesn't Cygwin tcl/tk understand Cygwin paths? |
The versions of Tcl/Tk distributed with Cygwin (e.g. cygtclsh80.exe,
cygwish80.exe) are not actually "Cygwin versions" of those tools.
They are built with the See the entry "How do I convert between Windows and UNIX paths?" elsewhere in this FAQ. | |
4.46. | What applications have been found to interfere with Cygwin? |
From time to time, people have reported strange failures and problems in Cygwin and Cygwin packages that seem to have no rational explanation. Among the most common symptoms they report are fork failures, memory leaks, and file access denied problems. These problems, when they have been traced, often appear to be caused by interference from other software installed on the same PC. Security software, in particular, such as anti-virus, anti-spyware, and firewall applications, often implements its functions by installing hooks into various parts of the system, including both the Explorer shell and the underlying kernel. Sometimes these hooks are not implemented in an entirely transparent fashion, and cause changes in the behaviour which affect the operation of other programs, such as Cygwin. Among the software that has been found to cause difficulties are:
Sometimes these problems can be worked around, by temporarily or partially disabling the offending software. For instance, it may be possible to disable on-access scanning in your antivirus, or configure it to ignore files under the Cygwin installation root. Often, unfortunately, this is not possible; even disabling the software may not work, since many applications that hook the operating system leave their hooks installed when disabled, and simply set them into what is intended to be a completely transparent pass-through mode. Sometimes this pass-through is not as transparent as all that, and the hooks still interfere with Cygwin; in these cases, it may be necessary to uninstall the software altogether to restore normal operation. Some of the symptoms you may experience are:
| |
5. Cygwin API Questions | |
| |
5.1. | How does everything work? |
There's a C library which provides a Unix-style API. The applications are linked with it and voila - they run on Windows. The aim is to add all the goop necessary to make your apps run on Windows into the C library. Then your apps should run on Unix and Windows with no changes at the source level. The C library is in a DLL, which makes basic applications quite small. And it allows relatively easy upgrades to the Win32/Unix translation layer, providing that DLL changes stay backward-compatible. For a good overview of Cygwin, you may want to read the paper on Cygwin published by the Usenix Association in conjunction with the 2d Usenix NT Symposium in August 1998. It is available in HTML format on the project WWW site. | |
5.2. | Are development snapshots for the Cygwin library available? |
Yes. They're made whenever anything interesting happens inside the Cygwin library (usually roughly on a nightly basis, depending on how much is going on). They are only intended for those people who wish to contribute code to the project. If you aren't going to be happy debugging problems in a buggy snapshot, avoid these and wait for a real release. The snapshots are available from http://cygwin.com/snapshots/. | |
5.3. | How is the DOS/Unix CR/LF thing handled? |
Let's start with some background. In UNIX, a file is a file and what the file contains is whatever the program/programmer/user told it to put into it. In Windows, a fil | |