Deployment Testing with Virtual PC 2004

By Jerry Honeycutt
Jerry Honeycutt

Jerry Honeycutt is a writer, speaker, and technologist. He has written more than 25 books, including Microsoft Windows Desktop Deployment Resource Kit (Microsoft Press, 2004). Jerry’s consulting practice is in the Dallas area, but he travels frequently.

Measure Twice, Cut Once

The old carpenter’s axiom, “Measure twice, cut once,” was never more true than with desktop deployment. I test, test, and test more until I’m satisfied that I’m not going to lose the job because of some easily foreseen error. Don’t rely on luck to get the job done right.

Too many times I’ve seen desktop engineers fail to test in a lab setting before unleashing their configurations in production environments. In a recent example, an engineer deployed a simple registry hack to the production environment without testing it and broke Microsoft Internet Explorer—a catastrophic failure that should have jeopardized his job. Of course, the whole miserable experience would have been avoided had he tested this configuration change in a lab setting that simulated the production environment.

In more extreme examples, I’ve watched in horror after desktop engineers skipped testing their organizations’ line-of-business (LOB) and mission-critical applications before deploying a new desktop configuration. The result can be devastating. The engineers usually aren’t familiar with tools and methodologies such as the Windows Application Compatibility Toolkit that are available for testing these applications against new configurations. In this case, ignorance is not bliss.

Part of the problem is that many shops don’t maintain good testing environments. This is especially true of small and medium-sized businesses. Many businesses I’ve visited recently didn’t have a formalized testing lab because of time, space, or cost constraints. I’ve even seen resource conflicts prevent the creation of good testing environments for desktop deployment. Such decisions are shortsighted and jeopardize the success of a project. Sometimes, shops that do have formalized testing labs manage them ineffectively, making the labs difficult to use. Some shops even create mixed-use training and testing labs, which makes scheduling and using the lab a frustrating experience for everyone.

If you’re motivated to build a test lab in your shop, I recommend that you do some reading first. One of the better resources for designing, building, and using a deployment-testing lab is right here at TechNet. It’s the Microsoft Windows® Server 2003 Deployment Kit. In particular, the chapter “Planning, Testing, and Piloting Deployment Projects” describes how to design a test lab and use it to verify your project. Another good source of information about testing applications in a lab environment is the white paper Deploying Windows XP - Application Compatibility.

However, even a dedicated testing lab with the best hardware isn’t always easy to use. I consider my lab environment to be above average, but it’s still time-consuming and I dread having to use it. Reconfiguring the hardware, software, and infrastructure for any particular test is an involved process, to say the least, and having to coordinate the use of the lab with other people—particularly when competing parties require different configurations—can be even more frustrating. Many desktop-deployment tests are straightforward, and there has to be a better way to ensure that the tests are done at a reasonable cost and within a reasonable amount of time. Enter Microsoft Virtual PC 2004—the focus of this article.

Testing with Virtual PC 2004, Instead

Virtual PC 2004 lets you test many facets of a desktop deployment, including answer files, application compatibility, disk images, and software installation. Creating virtual test labs is easy with Virtual PC 2004, and reconfiguring the virtual lab takes minutes instead of hours. With Virtual PC 2004, you can:

  • Create virtual machines on a physical computer, then install operating systems and applications in those virtual machines. Virtual PC 2004 mimics real computers so closely that the operating systems and applications you install in the virtual machines don’t know the difference. Virtual machines that you create also have virtual hardware that mimics real hardware, including a CPU, a video card, and a network adapter.

  • Share drives, folders, and files with the physical computer so that you can exchange data between the physical and virtual computers, thus making it easier to test operating system and application installation.

TechNet’s Virtual PC 2004 content is currently a bit sparse, but I anticipate that that will change soon. Fortunately, the white paper Microsoft Virtual PC 2004 Technical Overview is a good source of information about the technical capabilities and many uses of this product. The best source of information about using Virtual PC 2004, however, is actually the online Help that Virtual PC 2004 provides. TechNet subscribers receive a 45-day free trial for Virtual PC 2004.

After Microsoft bought Virtual PC 2004 from Connectix Corporation, Microsoft primarily positioned the product as a migration tool. In other words, you can use the tool to continue to support mission-critical legacy applications that are incompatible with the Microsoft Windows XP Professional operating system, thus ensuring that your Windows XP Professional deployment stays on track while you continue to support your legacy applications. Positioning the product as a deployment-testing tool was a low priority for Microsoft, but I find the tool very useful for this purpose. It’s a test lab in a box.

For example, I use Virtual PC 2004 to test any configuration change before deploying that change to the production environment and to test applications for compatibility. I also use Virtual PC 2004 to test deployment scenarios, including Windows XP Setup and disk-imaging techniques. For example, I can quickly boot Virtual PC 2004 by using MS-DOS® or Windows Preinstallation Environment (Windows PE), then either load a disk image by using Symantec Ghost or run Windows XP Setup with an answer file to install the operating system. In fact, I maintain virtual disk images for different server configurations such as the Microsoft Active Directory® directory service and the Remote Installation Service (RIS) so that I can run quick tests without scheduling lab time. (Using RIS to start a virtual machine is a quick way to test your RIS customizations and images.) Granted, Microsoft doesn’t support running server operating systems by using Virtual PC 2004, and a server operating system runs much more slowly in a virtual machine than on a dedicated box. (For more information about using Virtual PC 2004 with server operating systems, see the “Community Talk” section.) But I more than make up the time by not having to reconfigure a physical computer to meet my test requirements.

Improving the Workflow

Using Virtual PC 2004 for deployment testing is more productive if you streamline the workflow by eliminating repetition. For example, as you progress, create a library of virtual hard disks that you can copy and use at any time. You might have a basic Windows XP Professional image that you can copy and use to test application installation in just a few minutes.

Another key to eliminating repetition in Virtual PC 2004 lies in being able to start a virtual machine quickly in order to put an operating system on its virtual hard disk. The best way to do that is to create a variety of boot disk images for different scenarios, such as RIS, disk imaging with Sysprep, Windows PE, and MS-DOS. I like to use WinImage from Gilles Vollant Software to create boot images for Virtual PC 2004 because both programs share the same file formats for disk images. To create boot images using WinImage:

  1. Create a bootable floppy disk or CD with which you can boot a virtual machine. With Virtual PC 2004, virtual machines can share disk drives with the physical computer, so creating bootable floppy disks and CDs is straightforward.

  2. In WinImage, do one of the following:

    • If you’re creating an image of a floppy disk, select Read disk from the Disk menu. Then, select Save As from the File menu and save the image as a .vfd file (that is, a PowerQuest Image File), which is the disk image format that Virtual PC 2004 uses for floppy disks.

    • If you’re creating an ISO image of a CD, select Create CDRom Iso Image from the Disk menu to create an .iso file for that CD. (ISO is the format that Virtual PC 2004 uses for CD images.)

After you’ve created a bootable disk image, mounting it in a virtual machine is simple. Create a new virtual hard disk and virtual machine configuration, then start them. To start the virtual machine using a floppy disk image, in Virtual PC 2004 select Capture Floppy Disk Image from the Floppy menu to mount a virtual floppy disk image. To start the virtual machine using an ISO image of a CD, select Capture ISO Image from the CD menu to mount a virtual CD image. After mounting the floppy disk or CD image, restart the virtual machine so that you can boot from it.

When you’ve created a library of bootable disk images, you can quickly test a variety of deployment scenarios. For example, you can:

  • Start a virtual machine with your Windows PE CD image (Figure 1), then test your answer files with Windows XP Setup.

  • Start a virtual machine with a virtual RIS boot disk, then test your RIS disk images.

  • Start a virtual machine with a bootable MS-DOS disk, then use Sysprep to write a disk image to the virtual hard disk and test it.

Figure 1. Starting Windows PE in a virtual machine to test Windows XP Setup.

Figure 1. Starting Windows PE in a virtual machine to test Windows XP Setup.

Community Talk: Testing Server Deployment

While writing this article, I looked through the newsgroups to see IT professionals’ questions and concerns about using Virtual PC 2004 for deployment testing. One particularly common question was whether you could use Virtual PC 2004 to test server deployments.

I’ve used Virtual PC 2004 to create virtual machines for server products, mostly to test RIS configurations and Active Directory software installation. However, Microsoft doesn’t support this configuration. The company supports only the client versions of the Windows operating systems as described in the Virtual PC 2004 Product Overview. There is no support for running server products in a Virtual PC 2004 virtual machine.

That said, for running Microsoft Windows Server 2003 in a virtual machine, Microsoft has announced a product called Virtual Server. The primary purpose of this product is to consolidate application servers and support the migration of legacy applications. Of course, Virtual Server will be a valuable tool for testing server deployments, too.