Installing a Unix like environment on NT

If you follow these instructions and something does not work then please let me know. Except for the installing service packs to NT and installing or patching AFS you do not need administrator privileges.

NT Version 4 with service pack 3

Make sure that you have service pack 3 installed onto NT version 4. When you boot the system and you get a blue screen with some white writing on the top - it should say here that have service pack 3. If your system is already running go to the Start menu, the to Administrative Tools (Common) and then start up Windows NT Diagnostics. Here click on the version tab and it should say:

Version 4.0 (Build 1381: Service Pack 3)

AFS

It is easiest to work with SRT if you have afs installed. AFS client 3.4a with patch 5 is probably the best but gives some problems with tar as when you untar it complains that it cannot set access and modification times of directories. File times are handled correctly though. Patch 8 does not work as it makes scripts not executable. To recognize patch 5, go the directory in which the afs client is installed and look for Tranptch.ini. Examine this file in an editor and look at lines 28-30 which all mention patch 5. To install or AFS and its patches you must have administrator priveliges. For people at CERN the afs distribution may be found in /afs/cern.ch/system/i386_nt35/afs34a1

Notes on binary mode

You will need to decide whether or not you wish to work with CR LF between lines of text files or to follow the Unix convention of just LF. Whether or not you choose the binary option (i.e. Unix style) you will probably get some problems, but you will probably get fewer problems with binary mode. The rest of these instructions assume binary mode.

When saving plain text files from the web, they will not be stored in binary mode. You can convert them with the editor PFE and say that you want to store in Unix mode. Or, once you have loaded the basic CYGWIN32 system, you can use a script, nocr. This script takes as parameter the name of the file which will be stripped of carriage return characters. Note that these carriage return characters hide quite well, but the command od -c <file name> will reveal \r \n instead of just \n for a bad file.

CYGWIN32

Cygnus Solutions provide the core of the Unix environment.. The current version is 19.1. This requires cdk.exe and an update to a dll. You can conveniently copy these to your desktop.

Information about mount points is held in the registry. The installation will not destroy old settings but may add new ones. If you want to start clean run the regedit program. Go to Run... on the Start menu and enter regedit then click OK. Go down the explorer window to HKEY_CURRENT_USER\Software\Cygnus Solutions and hit the Delete key. You will be asked if you mean it - check that Cygnus Solutions is selected and click OK. As you probably know making mistakes in the registry can be catastrophic. It should not normally be necessary to do this however.

Execute cdk.exe to install it (note the first time it prompts you for a path this is just a temporary directory for unpacking)

Then find the cygwinb19.dll in the installed structure and replace it with the new one. It will be in h-i386-cygwin32/bin relative to where you installed it.

Now establish a short cut to bash. Using explorer, find the cygnus.bat in the directory where you installed and drag it on the desktop. This will create a shortcut to the file. Then, if you wish, right click on the shortcut and rename it - to Bash for example. Right click again and bring up properties, select the shortcut tab and clear the field Start In or set it to a directory you would like the something you find useful. You can also set the icon which you will find in the share directory below where you installed. Finally you may like to drag the shortcut onto your Office Shortcut Bar and/or onto the Start button after which you may wish to delete it from your desktop. Note that if you install as administrator, you may get an entry stored in the Start menu.

Now obtain unixnt.tar.gz and store this on your desktop. (Note that you may be prompted to store it as unixnt_tar.gz.)

Ensure that the environment variable HOME is set in your environment. Go to the NT control panel, select system then select the tab Environment and look for either a system or user variable HOME. If none is set, enter HOME as the variable and a DOS style path (e.g. H:/) as the value and click Set and OK.

Start a Bash shell from a shortcut, the Start menu or the Office Shortcut Bar. Ignore any warnings about /tmp not existing and type:

tar zxvf unixnt.tar.gz
cd unixnt
bash setup

This will unpack a few files, and run a script which tries to install things in a safe manner. You may prefer to read the script and carry out the steps by hand. You may get a warning about /tmp not being found - it will be created for you if necessary. The script will, among other things copy a .bash_profile, a .bashrc and a .emacs file to your $HOME directory. You may of course choose to modify any of these files - but be careful with the PATH. You will need to uncomment and set correctly CVSROOT in $HOME/.bash_profile.

Note that along with this setup script is a very short script, nocr, which has one argument the name of a text file. It will remove all carriage return characters from the file.

Next time you start up a Bash shell it will run srt setup. This is quite slow with CYGWIN32 so be patient waiting for the prompt.

Autoconf, Make and CVS

Take usrlocal.tar.gz and store it on your desktop. This file contains ready built versions of what should be in the /usr/local tree. If you are still in the unixnt directory then cd .. will take you back to the desktop, then type:

desk=$(pwd)
cd /
tar zxvf $desk/usrlocal.tar.gz

If you should wish to build these tools from source, the instructions are available.

More useful things

These instructions have been kept as simple as possible to allow people to set up a basic environment. Instructions are also provided on adding in extra useful gadgets.

Problems

  1. When you run configure for an srt package, you will find that the last thing it does is to check paths for mount points. Any paths which are CYGWIN32 style will be modified to use normal windows drive letters. You may find that the prefix entry in the .makestate file which is created is modified this way. This will render the GNUmakefile unusable. Editing the .makestate file seems to work or you can specify --disable-mount-translations when you run configure. Either of the solutions may lead to other problems. It may need a fix to srt.
  2. The script invoked by bash setup creates a temp directory (if not already in existence) on your C drive to use as /tmp. You will normally have one as part of the NT installation, but if you did not install NT on drive C or wish to have your /tmp elsewhere you might like to modify the setup script.
  3. The script does not mount you home directory. To do this, if for example your HOME directory is on the H drive, then type:
    mount -b h: /h
    
  4. The home file server at CERN does not seem to work correctly with CYGWIN32.
Steve Fisher