Thomas Damgaard's Blog

How to speed up Cygwin startup time

6 May 2022 - Thomas Damgaard

Some time ago, I was using a Windows machine on which Cygwin was extremely slow to start the terminal.

I found the reason for the slowness and the fix.

The fix for me was to make a cache of the local authentication and AD credentials. This is done by running:

$ mkpasswd -l -c >/etc/passwd
$ mkgroup -l -c >/etc/group
$ cp /etc/nsswitch.conf /etc/nsswitch.conf.bak
$ echo 'passwd: files' >/etc/nsswitch.conf
$ echo 'group: files' >>/etc/nsswitch.conf

Then kill all Cygwin processes and start a Cygwin terminal. It should now be significantly faster.

Filed under: cygwin, howto, tips, windows