SolutionBase: Creating a test lab on one machine using VMware Workstation

Even though IT budgets are tight, you still need hardware to test different operating systems. Here's how to configure and customize VMWare to help ease your budget crunch.

Configuring new virtual machines
To create a new virtual machine, choose File | New | New Virtual Machine from the VMware menu. Choose Custom Installation. Pick a guest operating system from the drop-down list. Next, set a name and a location for the new virtual machine.

The next few screens allow you to configure RAM size, networking method, and other devices. If you need to change these settings later, you can do so by choosing Edit | Edit Virtual Machine Settings from the VMware menu.

Choose a memory allocation based on the recommended guest range. This is provided by VMware based on your total available memory (Figure A).

Figure A
You can allocate virtual machine RAM in increments of 4 MB up to the total permitted by VMware.

Next, configure networking. Choose Bridged, Network Address Translation (NAT), Host-Only, or None (Figure B). NAT requires few or no additional steps and is the easiest to set up; Bridged Networking involves setting up a separate IP address for the guest on the network.

Figure B
Choosing NAT will be the quickest way to get your new virtual machine on the network.

On the following screen, select Create A New Virtual Disk. Other choices are to reuse an existing virtual disk and have VMware access a physical disk. In the latter case, the guest OS reads and writes directly to the drive or partition. This is useful for multiboot machines if you want to run the alternate operating system(s) as a guest. However, it is not the best choice for a test machine, as directly accessing the physical disk invalidates the protections of using isolated virtual disks.

Next, specify a virtual disk capacity (Figure C). Remember to leave ample room for testing, as well as enough space on the hard drive where the virtual disk will be stored for shrinking and defragmenting. Splitting the disk into 2-GB files makes it easier for VMware to perform these operations. If you desire, choose to allocate the entire virtual disk at this time rather than having it grow dynamically.

Figure C

Virtual disks grow dynamically unless you specify otherwise. Splitting the disk into 2-GB files will ease later defragmentation and shrinking operations.

Maximum disk capacity workaround
The Specify Disk Capacity dialog states that a virtual disk can never be larger than the maximum capacity you allocate now. This is not strictly true. VMware has published a workaround using Norton Ghost to increase disk capacity later. However, the process is tedious, so it's better to set a workable limit at the beginning. An easier way to work around a disk capacity limit is to add additional virtual disks to a guest OS.

After you complete the Disk Capacity dialog, VMware will allocate the space. This operation can take some time.

Figure D shows VMware's tabbed display. You can switch from one guest to another using this interface. Highlighted is the new virtual OS, "Windows 2000 Pro on X:\." After configuring this guest, it receives a tab even though it has not yet been powered on. The summary lists all configured devices for that virtual machine.

Figure D
The new virtual machine is displayed in its own tab.

Whenever the guest is powered down, you may add or modify a device by clicking Edit Virtual Machine Settings. For example, to allow printing through the host, in the settings dialog, click Add, then select Parallel Port. VMware supports most standard devices you will need.

Modify a device by double-clicking it in the edit dialog. For example, if you have more than one CD drive, Auto Detect might sense the drive without the installation disk when the OS is powered on. Double-click CD-ROM to change from Auto Detect to a specified drive letter. You are limited to one CD-ROM per virtual machine.

Installing a Virtual OS
Once you have configured devices on the new virtual machine, you are ready to install an operating system. Place the operating system installation CD in the drive and power on your new guest by clicking Start This Virtual Machine. You may also create an ISO image and configure the new guest operating system to boot from it by choosing Edit | Virtual Machine Settings, clicking on CD-ROM, and setting the CD-ROM to the location of your ISO image.

Inputting within the new virtual machine
Initially, you must first click the mouse within the VMware window to enter any mouse or keyboard input into the guest machine. To remove focus from the guest, simultaneously press [CTR][ALT]. After you install the new OS and VMware tools, the host and guest systems will automatically grab focus for keyboard and mouse input.

If VMware doesn't boot from the installation CD, access the virtual machine BIOS when booting up by pressing F2. (First click the mouse within the guest screen to give it focus.) Select the boot menu and add CD-ROM Drive (Figure E). Exit the BIOS by pressing [F10].

Figure E
To boot from the installation CD, add CD-ROM to the virtual PhoenixBIOS Boot menu.

Your operating system setup program will load and run exactly as it would for a physical machine. Here are a few items to be aware of:
  • Disk formatting: Don't be alarmed when the setup program reports that it has found a new hard disk and warns that data on C may be lost. Format the virtual disk—no data on your host will be harmed.
  • Windows XP, Office XP, and Office 2003: Licenses for these products are valid for installation on one physical machine at a time. These licenses must be activated through the Internet. If the activation service detects the new virtual machine as separate hardware, then the products on the guest machine will be set to time-limited demo versions. If this happens, call the Microsoft Product Activation Center number given in your product. The staff is usually generous in granting additional activation keys that register multiple installations of products on the same hardware. But you may be required to purchase additional licenses.
  • Service Pack 3 issues:A Windows 2000 guest with Service Pack 3 installed may not boot. Before powering down a Windows 2000 guest, upgrade to Service Pack 4. If this isn't possible, VMware has a workaround.
  • Linux installations: Linux X System graphic drivers will not work properly until after WMware tools are installed. Therefore, use the text-based installation and do not start XFree 86 until after you install VMware tools from the Linux console. Instructions for installing VMware tools are given below. In addition, VMware recommends deactivating screensavers under Linux guests as they can cause the virtual machine to hang.

For more information, tips, and tricks, check VMware's Guest Operating System Installation Guide and the VMware support page.

Installing VMware tools
VMware tools' SVGA driver is necessary for setting high screen resolutions and accelerating video performance on the guest machine. Other useful features include automatic switching of mouse and keyboard focus between the host and guest screens and the ability to shrink the virtual machine and conserve disk space.

To install VMware tools on a Windows guest, start the guest operating system. When it is running, choose File | Install VMware Tools from the VMware menu.

Additional VMware tool tweaks for various Windows OSs are listed in the VMware Workstation manual that comes with the program.

To install the tools on a Linux guest, start Linux and log on as administrator or superuser (su -). Do not start the X server. Choose File | Install Vmware Tools from the VMware menu. The next steps are performed in the Linux console:

Mount the VMware Tools virtual CD-ROM image and change to a working directory (i.e. /tmp). (This image is an ISO that appears as a CD-ROM to the Linux guest.) To do so, type:
mount /dev/cdrom /mnt
cd /tmp
tar zxf /mnt/vmware-linux-tools.tar.gz

Next, unmount the CD-ROM image by typing:
umount /mnt

After that, run the VMware Tools installer and exit from the root account by typing:
cd vmware-tools-distrib

Finally, type startx to launch your graphical environment. Once it loads, launch the VMware Tools background application in a terminal window by typing, vmware-toolbox &.

Installing applications, updates, and patches
Once you've installed your guest OSs and VMware tools, you're ready to install applications, updates, and patches. Set these up exactly as you will on any other system. Download and install updates within the virtual machine.

Using Snapshots
The Snapshot feature allows the entire state of guest systems, including disk data, memory, and settings, to be preserved whenever you desire. A Snapshot is useful for testing, as you can revert any virtual machine to a previous saved state. You are limited to one snapshot at a time.

To create a Snapshot, with the guest OS running, choose Snapshot | Save Snapshot from the VMware menu. A progress bar will appear with the message Saving Virtual Machine State. This operation can take some time. Snapshot information is stored in a file with the extension .vmsn, and additional files with REDO as part of the extension. Each time you create a Snapshot, the previous one is updated with the virtual machine's current configuration.

To return the guest OS to a saved configuration, choose Snapshot | Revert To Snapshot from the VMware menu. You can prevent the current Snapshot from being updated by selecting Edit | Virtual Machine Settings, clicking the Options tab, and then clicking Snapshot. Check the box, Lock This Snapshot (Figure F).

Figure F
Locking a Snapshot will prevent accidental configuration changes. Note that the date and time of the current snapshot is displayed in this screen.

During testing, you may find it useful to revert the guest OS to the Snapshot state each time it is powered down. In the Snapshot Options panel, under When Powering Off, click Revert To The Snapshot. Alternatively, you may choose to update your Snapshot when the virtual machine is powered off.

To remove a Snapshot, first power down the guest OS, then choose Snapshot | Remove Snapshot. If the OS is not powered off, this option will be grayed out.

Copying, backing up, moving, and renaming virtual disks
Copying, moving, and backup operations are as simple as manipulating the virtual machine's files and selecting File | Open from the VMware menu to make VMware aware of a new or moved virtual machine. Note, however, that when moving a virtual machine to a different physical machine, you will need to edit the guest's device settings for the new hardware. Further, if the new computer uses a different processor, a Linux guest may not work on the new machine. This is due to the fact that Linux installations choose a kernel optimized for either an Intel or AMD processor.