By Ian Buck
Last updated: January 22nd, 2003
This page documents some tips on how to turn a vanilla Windows 2000 machine into a sleek development machine.
Instructions for the impatient: Reinstall the with Win2k if
New computers today typically come with an operating system already installed. If its not Windows 2000 or Windows XP, you will want to reinstall. Windows 98/ME do not provide the stability necessary for a development workstation. The other reason you may want to reinstall is because of all the OEM crap that can come with a laptop that you simple don't need. This includes the endless list of programs in the Start menu.
The downside to reinstalling the operating system is driver support. Windows 2000 may not come with all the drivers for the hardware in your system. This is especially true for laptops which usually have funky chipsets and power management hardware. Drivers usually can be found on the manufacture's web page but it can be a challenge finding them. With a new laptop, I would hesitate reinstalling the OS, but with a standard workstation, its recommended.
If you are getting a hand-me-down machine, you will almost certainly want to reinstall the OS. Who knows what that joker installed on that system.
Instructions for the impatient: You should have two partitions: C drive for applications and OS which is at least 5 GB. D drive for work files. All partitions should be FAT32 formatted.
A development machine should have a separate partition for work files than application and OS files. A work partition not only makes for a cleaner working environment, it also protects your data should you every need to reinstall your operating system and applications.
The C drive should contain the operating system files and all applications you install. This partition should be at least 5 GB (preferably more). The D drive can use the remaining space for your work files. There are two choices when formatting a new partition FAT32 or NTFS. I prefer to use FAT32 for all my partitions since a standard Windows98 boot disk can read the partitions. In case my OS crashes, I can still get the data. NTFS drives are only readable by an NT kernel (Win2k/NT/XP) which don't have single floppy boot disks and make it much harder to get a the data in case of a system crash. Furthermore, some programs only run in old-school DOS mode which Win2k does not support.
Instructions for the impatient: Go to http://windowsupdate.microsoft.com, and click product updates. Install all critical updates items and service packs. Reboot and repeat until no remain.
A development machine should have the latest OS fixes. Fortunately Microsoft provides WindowsUpdate. Go to http://windowsupdate.microsoft.com/ and click on Product updates. Be sure to download all critical update packages specially service packs. You may need to reboot your machine multiple times and revisit the site since some components must be installed individually.
To edit your environment variables in Windows 2000, right click on My Computer, select Properties. Under the Advance tab, select Environment Variables. Here you can edit the path and other environment variables or create new ones. Note that you will always want to edit the system variables not the user variables. When editing the PATH variable, directories are separated by the semicolon and don't worry about spaces in the directories. Also, in order for running applications will see environment variable changes, you will need to restart them. This includes the command prompt.
Instructions for the impatient: Default options are OK. Check "Register environment variables" when asked. Install latest Visual Studio service pack also.
When installing Visual Studio, be sure to be logged in as you would be when working. The default options are OK but you may want to include the C runtime library source code in case your interested in tracing through functions like printf. This option can be found in the Visual C++ settings. When asked if you would like to register environment variables, be sure to check the box. This lets you compile from the command line !! After installing Visual Studio, be sure to install the latest Visual Studio Service Pack.
Instructions for the impatient: Default options are OK.
I've always followed the default install for Microsoft Office and have never had a problem. Also as far as I can tell there really isn't much difference between the different versions of Microsoft Office.
Instructions for the impatient: VNC is useful. Default options are OK.
VNC allows you to gain access to other computers' desktops that are running VNC servers as well as gain access to your own desktop from a remote PC. VNC is shareware and the latest version can be found at http://www.uk.research.att.com/vnc/. Its much simpler than Microsoft Desktop sharing and more reliable.
I prefer to not mess with the Windows Program Files directory when installing my own binaries. It is too long to type and some applications have trouble parsing the space in the name. To fix this, create a C:\bin directory in which to install these applications. My bin directory contains applications like cygwin, perl, python, ghostscript, and MikTex as well a few one file applications.
Instructions for the impatient: Install into the c:\bin\cygwin directory. Install all of the packages.
Cygwin provides a Unix like environment for Windows workstations giving you commands like ls, diff, and ssh from the Windows command line. The Cygwin web site is http://sources.redhat.com/cygwin/. Click the "Install Cygwin Now" button and run the setup program. Click "Install from Internet" and hit next. Set the install directory to be "C:\bin\cygwin". The other defalt settings are fine. The local packages directory is where the installer will dump the packages before installing them. By default, it picks the desktop which is fine. When your done installing cygwin, you can delete these files. Next, the "Direct Connection" is usually fine. For a download site, I usually pick the nasa.gov site.
Its best to install all the packages. Click on the "Default" next to "All" until it says "Install". Create a desktop if you like a tcsh shortcut.
Instructions for the impatient: Add C:\bin\cygwin\bin to your path. Run mkpasswd -d GRAPHICS-DOMAIN > c:\bin\cygwin\etc\passwd. Create the directory c:\bin\cygwin\home\<username>
In order to get access to all the cygwin goodies in a command prompt, you will want add the cygwin bin directory (c:\bin\cygwin\bin\) to your path (see editing enviroment variables above). Next you will want to make a valid passwd file. Run mkpasswd -d GRAPHICS-DOMAIN > c:\bin\cygwin\etc\passwd. This will build a passwd file so that cygwin will know who you are. If your registered under a different domain, replace GRAPHICS-DOMAIN with your domain name. Running "whoami" (a cygwin program) should print your windows logon user name. Finally, you should create a home directory for yourself. Type mkdir c:\bin\cygwin\home\<username> to create the directory.
You now have commands like cvs, vim, ssh, ls, and tar available from the command line.
Personally, I prefer use the Windows Command Prompt over the tcsh shell installed by cygwin. This is mostly a matter of personal preference. With a few tweeks (see below), you can make the Command Prompt just a powerful as a unix prompt.
If you decide to use the Windows Command Prompt. Its helpful to put a link to it on the desktop or in the Quickstart tray which is to the right of the Start button. Just drag it from Program Files->Accessories to where ever you like.
I prefer to use the Perl and Python implementations from http://www.activestate.com/ and http://www.python.org/. Install both of these in the c:\bin directory and be sure to add them to your path, specifically c:\bin\perl\bin and c:\bin\python, before cygwin directory.
MikTex is the standard LaTex implementation for Windows. The web site is http://www.miktex.org/. Note that MikTex has a really annoying two set install process. You need to first download MikTex to an install directory then install the actual program from that directory. Be sure to install both the texmf folder and the localtexmf folders inside c:\bin. Otherwise the default install options are fine. Once installed, you can delete downloaded install files. MikTex should add its bin directory to your path, if not you should add c:\bin\texmf\miktex\bin to your path.
GhostScript is a Postscript rendering library used for viewing postscript files. GSView is the actuall viewer. The installers can be found at http://www.cs.wisc.edu/~ghost/. First follow the install instructions for GhostScript, then GSView. Make sure the bin directories c:\bin\gs and c:\bin\gs\gsXXX\bin (where XXX is the version number) are added to your path.
To turn on tab completion in the command prompt, you will need to edit the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor. Run regedit from the command line and select the key. Change the CompletionChar and PathCompletionChar values to 9, which is the ASCII code for TAB. Quit regedit and restart the command prompt.
Here is a registry patch to do just this. Open the file to have it automatically merged into your registry.
Windows 2000 Professional uses a really small file to save memory, however increasing the file cache can dramatically speed up compile times. To increase the file cache, modify the registry key HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Memory Management. Run regedit from the command line and select the key. Change the value of "LargeSystemCache" to 1. Restart the computer.
By default Windows hides a bunch of things like hidden files ans extensions. To turn this off, open a directory window and go to Tools->Folder Options. Select the View tab and select "Show hidden files and folders" and uncheck "Hide file extensions for known files" and "Hide protected operating system files." I also like to check "Display the full path in the address bar" and "Display the full path in the title bar".
The default command prompt is pretty wimpy. I prefer a smaller font, bigger window, and easier access. First, open the Start menu, Programs, Accessories. Drag the Command Prompt menu entry down to the series of icons to the right of the start button. This places a C:\ command prompt icon in the start tray for easy shell access. Next run the command prompt and select properties from the menu inside the window icon in the upper left corner of the window. Under the Font tab, change the font to something smaller (I prefer the 6x8 font). Under the Layout tab, change the window size to be 80x50. Click OK and be sure to select the "Modify shortcut" option so that future command prompt windows will also have these settings.
The F7 key displays a command history window. To copy text out of the command window, highlight the text with the mouse. Hit any key or the left mouse button to place the text in the clipboard. To paste, click the left mouse button again.
You'll need the environment variable MAKE_MODE=unix in order for cygwin's GNU make to work properly.
Everybodies favorite editor can be found here http://www.xemacs.org/Download/win32/setup.exe
Setting up your ssh keys properly allows you to ssh to machines without requiring you to type your password. First, cd to your home directory which should be c:\bin\cygwin\home\<username>. Make a ".ssh" directory and cd into it. Run:
ssh-keygen -t rsa -f id_rsa
When asking for a passphrase, just leave it blank. Next run:
cat id_rsa.pub >>authorized_keys
This will create an authorized_keys file containing your public key. Next copy your .ssh directory to your Unix account. Inside unix, run:
chmod 700 ~/.ssh
This is important since that directory contains your private key. You should now be able to ssh from tcsh or command prompt shell to your unix machine without typing you password.
The offical Graphics lab howto on this can be found here: http://graphics.stanford.edu/lab/net/sshrsa.html
Cygwin comes with a very handy (and free) XServer which works pretty well within Windows and supports OpenGL. Here is how you turn it on. First add the cygwin X11R6\bin directory to your path. Mine is located in C:\bin\cygwin\usr\X11R6\bin. Next, edit the "startxwin.bat". Towards the end of the file, change the line that says:
start XWin
to:
start XWin -rootless
Also, cygwin by defaults starts the twm window manager which is terrible. To fix this change the line:
run twm
to
run fvwm2 -f /usr/X11R6/share/fvwm/system.fvwm2rc-sample-95
Save the new startxwin.bat. Add a new shortcut your desktop (Right-click on the desktop->New->Shortcut) and point it at c:\bin\cygwin\usr\X11R6\bin\startxwin.bat. Call it something like "XServer".
By default cygwin does not allow anyone to connect to your XServer. The safe and secure way to use it is through ssh tunneling. To turn on ssh tunneling. Create the file c:\bin\cygwin\home\<username>\.ssh\config (if it is not already there). Add the line:
ForwardX11 = yes
This will turn on X forwarding. Finally, add the DISPLAY=:0.0 environment variable to your system (See "Editing Environment Variables" above on how to do this).
To test it out, run the XServer and then ssh to your favorite unix machine and run "xcalc". The calculator should appear on your desktop.
By default, CVS uses rsh to do remote checkouts which is very unsecure. In the past, we used to use the pserver feature of cvs, but its buggy and can be hacked. The only secure way to do remote CVS is through ssh which opens an ssh connection to the cvs server to do checkouts and updates. To set up add the enviroment variable by right clicking on My Computer-> Properties. Click the Advanced tab, click evironment variables button. Add to the system variabels:
CVS_RSH = ssh
To check out a project from the command prompt type:
cvs -d :ext:username@my_favorite_unix_machine.stanford.edu:/usr/graphics/project checkout myproject
(Replace my_favorite_unix_machine with whatever unix machine can "cd" to wherever the repository is. Also you can change /usr/graphics/project to your own repository if you have one.) This will checkout myproject into the directory myproject. Once inside that directory, the regular cvs commands work without the "-d :ext:..." stuff.