Portable Cygwin/Move your Cygwin install
Scenario: Cygwin is installed on your D drive, I mvoe the Cygwin directory to my C drive, fix the desktop shortcut and its not starting, giving me funny messages about the tmp directory and /etc/passwd
Solution: There are 4 entries in the windows registry that point to the cygwin install directory, they are:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions]
[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin]
[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2]
“cygdrive prefix”=”/cygdrive”
“cygdrive flags”=dword:00000022
[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/]
“native”=”C:\\cygwin”
“flags”=dword:0000000a
[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin]
“native”=”C:\\cygwin/bin”
“flags”=dword:0000000a
[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib]
“native”=”C:\\cygwin/lib”
“flags”=dword:0000000a
[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Program Options]
Open regedit, navigate to these keys, update them to the correct directory and you are set.
For the Geeks: Portable Cygwin
1. Export the registry key file & copy the desktop Cygwin shortcut to your Cygwin directory
2. Burn the entire directory to a CD -or- copy to flash disk
3. Copy the Cygwin directory to the new system
4. Edit the keys – notepad or wordpad works well
5. right click | merge on the .reg file (to merge the registry keys file to the system registry)
6. Copy the icon to your desktop, make necessary changes
7. You are set, test by launching the icon from the desktop
For anyone that has it running w/o the need for registry update, please email me – gregglain@yahoo.com
How to make cygwin completely portable?
I’m not allowed to update registry keys at work
(no admin rights).
Use the Cygwin’s “mount” command instead of editing the registry.
- First, save you mount information:
mount -m > saved_mount_info.txt
- it will show something similar to the following:
06:10:17> mount -m
mount -f -s -b “C:/Cygwin/bin” “/usr/bin”
mount -f -s -b “C:/Cygwin/lib” “/usr/lib”
mount -f -s -b “C:/Cygwin” “/”
mount -s -b –change-cygdrive-prefix “/cygdrive”
- print this or have it showing in another window.
- now unmount everything:
umount -A
- now for each line in your saved printout, use the mount command to mount to your *new* drive location, e.g.:
mount -f -s -b “D:/Cygwin/bin” “/usr/bin”
..etc for each line in your printout
That is a much better solution – thanks – will update the post