This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Sharing a single cygwin installation among multiple clients machines


Hello:

This a actual case example of sharing a single installation of cygwin on
a server machine and having access to cygwin from multiple clients
without the need of installing cygwin on the clients.

First I like to congratulate the developers of cygwin for their wisdom
in using the registry as the mount table.  Without this little feature,
this sharing of cygwin in this manor would not be possible!

Here is my successful experience....

The first task to accomplish is the boot strapping of the system
registry to get the proper mounts reflected.  The clients are in a
catch-22 position of not having a functioning cygwin to be able to use
the mount command.  It might be a nice feature to write standalone
program (not using cygwin1.dll) that would read a file to indicate what
mounts you desire and have it create the registry entries.  But given
the lack of such a program, you have to manually construct a file to
contain the new registry entries to be added.

Before continuing, I need to explain my conventions so you know what I'm
doing.  On my server machine (containing the cygwin installation) and
all client machines, I mount all of my local drive letters as
/{drive_letter}.  This means that drive C: is mounted as /c and drive D:
is mounted as /d and so on.  So /c would reference the C: drive on each
respective local machine.  For all client machines. I mount the drives
of the server machine using a double-letter convention.  This means that
/cc refers to drive C: on the server and /dd refers to the D: drive on
the server.  On my server machine, I have the following mounts:

	D:\cygwin\bin on /usr/bin type system (binmode)
	D:\cygwin\lib on /usr/lib type system (binmode)
	D:\cygwin on / type system (binmode)
	c: on /c type user (textmode)
	d: on /d type user (binmode)
	e: on /e type user (binmode)

All physical drives on the server machine are shared resources (Windows
share).  All client machines map network drives to my share as follows:
	H: -> \\server\C$
	I: -> \\server\D$
	J: -> \\server\E$

Now we're ready to begin the initial bootstrap of the client machines. 
The desired mounts for a particular client with a single hard drive
might look like this:
	I:\cygwin\bin on /usr/bin type system (binmode)
	I:\cygwin\lib on /usr/lib type system (binmode)
	I:\cygwin on / type system (binmode)
	C: on /c type system (binmode)
	H: on /cc type system (binmode)
	I: on /dd type system (binmode)
	J: on /ee type system (binmode)

Remember drive I: is a network drive mounted from \\server\D$ which
contains the cygwin installation.  The next step is to create a file to
be used by regedit to install the mount registry entries.  The following
is the actual file used to create the desired client mounts:

REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\00]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\01]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\02]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\03]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\04]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\05]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\06]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\07]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\08]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\09]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\0A]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\0B]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\0C]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\0D]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\0E]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\0F]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\10]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\11]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\12]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\13]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\14]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\15]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\16]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\17]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\18]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\19]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\1A]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\1B]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\1C]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL
setup\b15.0\mounts\1D]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/]
"native"="D:/cygwin"
"flags"=dword:0000000a

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin]
"native"="D:/cygwin/bin"
"flags"=dword:0000000a

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib]
"native"="D:/cygwin/lib"
"flags"=dword:0000000a

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/c]
"native"="C:"
"flags"=dword:0000000a

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/cc]
"native"="H:"
"flags"=dword:0000000a

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/dd]
"native"="I:"
"flags"=dword:0000000a

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/ee]
"native"="J:"
"flags"=dword:0000000a

Note:  The entries beginning with "[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus
Solutions\CYGWIN.DLL setup]" are probably not needed as I think they are
a carry over of the B20 release of cygwin.

With the above file, you install the registry entries in a MS-DOS Prompt
windows entering "regedit {file}".  Before you do this, cygwin1.dll MUST
be UNLOADED.  If you are doing this for the first time, chances are that
cygwin1.dll is not loaded.

The next step is to create a copy of the cygwin.bat file tailored for
client machines.  I typically call this file "cygwin_remote.bat".  It is
essentially a copy of cygwin.bat with the drive letters representing the
cygwin installation changed to reflect the mapped drive letters on the
client machine.  Below is what my cygwin_remote.bat file looks like:

  @ECHO OFF
  SET MAKE_MODE=UNIX
  set PATH=I:\cygwin\bin;%PATH%
  SET IS_CYGWIN=true
  set HISTSIZE=1200
  set HOME=I:/cygwin/home/paul
  set ENV=I:/cygwin/home/paul/.bash_login
  set CYGWIN=tty
  ksh

You should tailor your cygwin_remote.bat file after your copy of the
cygwin.bat file.  Mine is specific for using ksh as my login shell.  You
get the idea.

The last step is to install a shortcut on your client to envoke the
cygwin_remote.bat file you just created on the server.  The shortcut
should execute the following command:

	C:\WINDOWS\COMMAND.COM /e:4096 /c I:\cygwin\cygwin_remote.bat

Assumming that you have done the above properly, double-clicking the
short cut will start up cygwin on your client machine using the copy
that is installed on your server machine.  The true advantage of this
arrangement is that you only have ONE copy of cygwin to keep up to
date.  For this to be totally successful, you should not reference drive
letters in your .profiles since the drive letters will be system
dependant.

I'll admit that the initial bootstrapping process is tedious but the
payoff is big afterwards.

As a side note....
A couple years ago, I created a runable cygwin B20 CD that all you do is
to insert the CD and it fires up your shell, performs the required
mounts, and then ready for input.  You have a completely portable CYGWIN
on CD that you can take to other PCs that don't have cygwin installed
and have access to cygwin commands.  I called it "CYGWIN on a Platter". 
True is runs slower off of the CD but it's far better to deal with slow
cygwin commands rather than DOS commands! YUK!

In a few months, I will be repeating my development of CYGWIN on a
Platter using a more current release of cygwin (probably cygwin DLL
1.3.6).  It will be based upon ksh and not bash.  I hope to make it
available in a CD image format.

-paul mcferrin
 

-- 
NOTE***  This email looks it came from MailHole@insight.rr.com but in
          reality it came from pmcferrin@insight.rr.com.  If you send
          a reply to this message, it *should* get delivered to the
          correct place.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]