Multiple Cygwins/ Distributing Cygwin apps

John Moore gmanenews@tinyvital.com
Thu Nov 6 23:51:00 GMT 2003


I now have a procedure that works on my system for allowing more than 
one cygwin to exist on the same Windows instance at the same time (but 
not to execute at the same time). I thank several on this list and who 
replied privately for help. For my needs, this solves the problem that 
started the thread. Perhaps it can help others.

I have put the full discussion here at 
http://www.tinyvital.com/techblog/archives/000330.html#more.

Also, part of it follows below (minus the nice HTML formatting):

--------------------------------------------------------------------------

NOTE: This will not allow both Cygwin environments to operate at the 
same time, but it will allow one to switch back and forth without 
rebooting the Windows OS. I am running this on Windows2000, but it 
should work on any modern Windows OS.

If you follow this procedure and have problems, please DO NOT BOTHER the 
Cygwin maintainers, as they will NOT answer your questions. Multiple 
Cygwins are outside of their current charter.


The approach is based on the following known or suspected cygwin 
characteristics:

...cygwin conflicts occur if cygwin discovers that there are more than 
one cygwin1.dll's on your machine

...Cygwin keeps its file system mount point information in the registry.

...It appears to discover duplicate cygwins if the "wrong" dll is in the 
Windows DLL path, if the "wrong" one is pointed to by a mount point, or 
if there is a cygwin shared memory segment (always present when a cygwin 
app is running). I am not sure this is exactly right, but it is 
consistent with my observations. In any case, the following procedure 
does work for me.

.................

First, perform the following steps [Standard warning. I am not 
responsible if this screws up your system, and if you are going to mess 
with the registry, you should know what you are doing. Read the whole 
procedure before starting.]:


...Remove the current cygwin installation if there is one (you may want 
to copy all or parts of the installation to another area).

...Make sure no keys exist in the registry named "cygwin" by deleting 
them and the appropriate parent if necessary - ("Cygnus Solutions."). It 
may not be necessary to mess with the registry, but I did. If it make 
you nervious, try without it. One alternative that may be sufficient is 
issuing the cygwin command "umount -A" - obviously before you delete 
your cygwin!

...Install cygwin in the normal fashion. In my case, against Cygwin 
recommendations, I install it in "C:/".

...Choose a directory for the switch scripts. Mine is c:/localbin - 
which is used for the rest of the example.

...Start a cygwin shell and issue the following command:"

              mount -m >c:/localbin/mount-std
         This will save the mount information from the registry into a 
script.

...Edit the script so that each mount command is an absolute windows 
style path to the mount binary for the non-standard cygwin mount.exe 
that will be installed in a later step. The absolute path is necessary 
or some mount commands will fail once the root mount path is changed. 
See the example scripts below.

...Exit ALL cygwin applications (and terminate the cygipc service or 
other daemon if they are running). This will make the shared memory 
segment go away.

...Issue the following command to hide the current cygwin installation 
from the new one to be installed:

              umount -A


...Install the new cygwin, but NOT with the same cygwin root directory 
as the "standard" one. I installed mine on H:/cygwin. This may or may 
not be an option on the distributed software.

...Start a shell from the new cygwin (to make the other script):

...mount -m >c:/localbin/mount-ven


...Edit the script so that each mount command is an absolute windows 
style path to the mount binary for the standard cygwin mount.exe.

----------------------------------------------------------------------

Now, if you are running in the non-standard cygwin environment, to 
switch to the standard environment:


...Stop all cygwin programs (including daemons) except one shell.

...In that shell, execute the mount-std script as follows (at least for 
my system):

       . c:/localbin/mount.std


...Exit from that shell

At this point you can run applications from the standard cygwn. BE 
CAREFUL not to run any applications from the other cygwin or things will 
get and stay screwed up until you end all running cygwin applications!

If you are running the the standard cygwin environment, and want to 
switch to the non-standard environment, do everything like the previous 
procedure, except invoke mount-ven. At that point, you can run anything 
from the non-standard environment ONLY (see caution above).



--------------------------------------------------------------------------------


My mount-std script:

mount -f -s -b "M:" "/mnt/cdrom"
mount -f -s -t "c:" "/cygdrive/c"
mount -f -s -t "d:" "/cygdrive/d"
mount -f -s -t "e:" "/cygdrive/e"
mount -f -s -t "f:" "/cygdrive/f"
mount -f -s -t "g:" "/cygdrive/g"
mount -f -s -t "h:" "/cygdrive/h"
mount -f -s -t "i:" "/cygdrive/i"
mount -f -s -t "u:" "/cygdrive/u"
mount -f -s -t "v:" "/cygdrive/v"
mount -f -s -t "w:" "/cygdrive/w"
h:/cygwin/bin/mount -f -s -b "C://bin" "/usr/bin"
h:/cygwin/bin/mount -f -s -b "C:/usr/X11R6/lib/X11/fonts" 
"/usr/X11R6/lib/X11/fonts"
h:/cygwin/bin/mount -f -s -b "C://lib" "/usr/lib"
h:/cygwin/bin/mount -f -s -b "C:" "/"
h:/cygwin/bin/mount -s -b --change-cygdrive-prefix "/cygdrive"



--------------------------------------------------------------------------------

My mount-ven script:

mount -f -s -b "M:" "/mnt/cdrom"
mount -f -s -t "c:" "/cygdrive/c"
mount -f -s -t "d:" "/cygdrive/d"
mount -f -s -t "e:" "/cygdrive/e"
mount -f -s -t "f:" "/cygdrive/f"
mount -f -s -t "g:" "/cygdrive/g"
mount -f -s -t "h:" "/cygdrive/h"
mount -f -s -t "i:" "/cygdrive/i"
mount -f -s -t "u:" "/cygdrive/u"
mount -f -s -t "v:" "/cygdrive/v"
mount -f -s -t "w:" "/cygdrive/w"
c:/bin/mount.exe -f -s -b "H:/cygwin/lib" "/usr/lib"
c:/bin/mount.exe -f -s -b "H:/cygwin" "/"
c:/bin/mount.exe -s -t --change-cygdrive-prefix "/cygdrive"
c:/bin/mount.exe -f -s -b "H:/cygwin/bin" "/usr/bin"




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list