With the IT community buzzing about the reduced number of servers required with virtual machines, it's easy to...
forget that virtualization can serve as a valuable testing and training tool as well.
Many administrators have to work with a variety of configurations to support customers using Windows NT, Windows 2000 Server, Windows Server 2003, R2 and soon Windows Server 2008. Creating a virtual lab allows you to test these configurations, as well as train on new products like Exchange Server 2007 without buying more hardware.
This eliminates a big investment in hardware. Since these machines are actually just files on the physical disk, you won't be afraid of doing destructive testing because you can just delete the virtual machine file and start a new copy of the virtual machine you've kept. Therefore, you don't have to spend hours reinstalling Windows on computers.
Another advantage of building a virtual test lab involves networking. You can isolate virtual machines in a network so they can talk to each other and the host, but not the outside world. With that isolation, you don't need to worry about security patches, firewalls or antivirus software -- making maintenance of this environment very easy. Of course, you can switch the networking configuration to allow the virtual machine to see the Internet if you need to download something or perform the Windows activation.
Building a virtual test lab consists of the following steps:
1. Select a computer with adequate resources. The disk space used on each virtual machine along with memory uses physical resources. An ideal machine would be an x64 desktop with 8 GB of RAM and at least a 200 GB drive. This gives you plenty of CPU power and more than enough memory and disk space to divide up.
2. Choose the virtualization software you will use. The leaders of the pack are VMware products and Microsoft's Virtual Server products. While each product line has advantages and disadvantages, both can work with this environment.
3. Using your virtualization software, install Windows to create a virtual machine. Also install any and all applications, tools and so on that you want on the VMs.
4. Use the System Preparation tool (Sysprep) to convert the virtual machine to a generic image.
5. Copy the generic image to multiple instances. Each of these instances can become a new virtual machine.
6. Again using your virtualization software, open each copy of the Sysprep converted virtual machine. When it boots, a mini-setup wizard will run allowing you to enter network information, etc. Also, you can set up Sysprep to provide a random computer name during setup.
7. Create the domain -- domain controllers, servers and so forth. Remember you did all of this from a single installation of Windows.
Two important decisions to make involve the size of the virtual disk and the memory allocated. Here are my recommendations:
- Windows 2000, 2003
* Minimum 256 Mb RAM, 2 GB disk
* Recommended: 512 Mb RAM, 3-4 GB disk
- Exchange Server 2003
* Minimum 256 Mb RAM, 6 GB disk
* Recommended 512 Mb RAM, disk size according to needs
The step that a lot of administrators miss is creating the Sysprep image. You can't just open a new virtual machine, install Windows, then make multiple copies of that machine and join them to a domain. Why? Because besides the fact that they would all have the same name and IP address, they would all have the same SID. Sysprep is a utility that strips all of that and effectively neuters the machine.
To create a single installation of the Windows operating system, follow the instructions for your virtualization software to create a new machine. After Windows is installed, you can add applications, tools, network configuration, etc. You can add anything that you want to show up on all instances of this machine.
Sysprep can be a little confusing. Here are the steps to follow when running it. Sysprep for Windows 2000 and 2003, including R2, is located on the server CD in the \Support directory.
1. With the virtual machine configured the way you want it, load the Windows Server CD (2000 and 2003 are the same). Go to \SUPPORT\TOOLS\DEPLOY.CAB and copy SYSPREP.EXE, SETUPMGR.EXE and SETUPCL.EXE to a directory on the virtual machine: C:\SYSPREP.
2. Execute SETUPMGR to produce SYSPREP.INF. The Setup Manager wizard will present you with a number of questions. Here are the answers in order:
b. Create new
c. Sysprep setup
d. Pick the SKU of the Windows version you installed
e. Yes - fully automate
f. Enter your name and organization
g. Leave video settings to default values
h. Choose correct time zone
i. Enter the Product ID (PID) key
j. Enter appropriate license settings
k. Choose "Automatically generate computer name"
l. Enter password
m. Select Next
n. Select Next
o. Select Next
p. Select Next
q. Select Regional settings
r. Select Next
s. Select Next
t. Enter an ID string – such as "VMware SYSPREP"
u. Select Finish
v. Choose cancel when complete!
3. Put the resultant Sysprep.inf file in C:\SYSPREP. Also, copy it to another directory. If you want to modify it, you can edit the inf file without going through this to generate another one. The Sysprep.inf file in C:\SYSPREP will be destroyed after you do the next step.
4. Run SYSPREP.EXE
a. When prompted, choose "Optional -> Don't reset grace period"
b. When prompted, select "Reseal"
Now you have that neutered image all ready for duplicating. VMware and Virtual Server both create a number of files that are associated with each virtual machine. I recommend zipping them up to keep them organized. Put a copy of the zip file somewhere for safe keeping and then extract copies of it to other directories.
I like to put my Sysprep converted image in C:\Vault and restrict access to read. Then I create C:\Virtual Machines to put the copies in for final installation into a domain. Note that when using VMware, you should create a separate directory for each virtual machine to keep them straight – for example, C:\Virtual Machines\VM1, \VM2, etc. Virtual Server is easy to organize by putting them all in one directory.
Now that you have this under your belt, check back for our next article to learn how to add a Windows Server 2008 virtual machine.
ABOUT THE AUTHOR
Gary Olsen is a systems software engineer for Hewlett-Packard in Global Solutions Engineering. He authored Windows 2000: Active Directory Design and Deployment and co-authored Windows Server 2003 on HP ProLiant Servers. Gary is a Microsoft MVP for Directory Services and formerly for Windows File Systems.