Developers Don’t Despair: Virtualize Your PC
September 13, 2006 Michael Sansoterra
Today’s developers often wear many hats: programmer, operator, help desk, and database administrator. Furthermore, they often support software on many operating systems (various versions of Windows, Linux, Unix, and so forth) with various versions of application software (Microsoft Office 97 or 2003, ERP clients, and so on) using a variety of developer tools (Visual Studio, Visual Studio .NET, Websphere Development Studio Client, Delphi, and others).
It can be quite overwhelming for companies with small budgets to create testing and development environments for such a wide array of software. Fortunately, there is a way to deal with this type of situation: create software-based “virtual workstations.” Two products capable of performing this amazing feat are Microsoft’s Virtual PC 2004 and VMware‘s Workstation 5.5.
A PC within a PC
This specialty software’s job is to literally slice up a PC into a number of virtualized PCs, which can be then loaded with a variety of operating systems. These virtual machines can run as a window or in full screen mode.
With these virtual machine partitioning products, you configure virtual machines using a wizard. Each virtual machine is configured to use a virtual hard drive, virtual video adapter, virtual network adapter (if needed) and a specified amount of the real PC’s main memory. Other devices such as CD/DVD drives, USB devices, and the like are shared between the virtual machine and the actual PC. All of the virtual machine settings for guest operating systems are based in software and hence are stored in a file on the physical host computer.
The virtual hard drive (VHD) is implemented as a single file on the host PC’s hard drive. Each VHD can be fixed size or configured for automatic growth. Each virtual machine can be configured to use several virtual hard drives. I have a few VHD’s configured for dynamic growth (running Windows XP and a few other applications) that are each about 5 GB to 7 GB in size. While these large VHD files are somewhat slow, it is a snap to backup the entire virtual PC. Additionally, VMware Workstation has the option of allocating an entire drive to the control of a particular virtual machine session.
The combination of software based configuration and the implementation of “virtual” devices and drivers allow a virtual machine to be transferred between computers regardless of PC hardware (that is, as long as the virtual machine software supports the hardware).
For example, say you can configure a virtual machine at work. Your entire virtual machine will consist of two or more files on a hard disk (one for the machine config and at least one VHD). If you store your virtual machine files on an external drive you can literally take your work computer “home” and run it on your home computer (assuming you have the PC virtual machine software in both places.)
Supported Operating Systems
Virtual PC 2004 supports Microsoft operating systems from MS-DOS all the way through Windows Server 2003. Other operating systems, theoretically, should work. I’ve come across Web sites that maintain that various versions of Linux do work. However, I’ve known a few people that have unsuccessfully tried. The point is you may have to tinker for a while to get other operating systems to work.
VMware Workstation 5.5 supports MS-DOS, Windows 3.1 and higher, various versions of Linux, Novell NetWare 5 and 6, and FreeBSD. Additionally “experimental” support for the Windows Vista beta and Sun Microsystems Solaris 9 and 10 Unixes are provided. VMware has a sort of operating system plug-in concept that allows the folks at VMware to handle special requirements as new operating systems are released.
Both VMware Workstation 5.5 and Virtual PC 2004 currently require Windows 2000 or higher for the host machine’s operating system. Note that installing these products does not alter the host operating system in any way; it’s just like loading any other program. Further, VMware supports various versions of Linux as a host operating system.
As you might imagine, PC virtual machine partitioning software is resource intensive. Microsoft gives the following recommendations for a Virtual PC:
An X86-based computer with one of the following processors: AMD Athlon/Duron family or Intel Celeron or Pentium II, III, or 4 family; 400 MHz minimum, 1.0 GHz or faster recommended. You can run Virtual PC on a multi-processor computer, but it uses only one processor.
Host operating system: Windows XP Professional, Windows 2000 Professional, or Windows XP Tablet PC Edition.
For main memory, you’ll need at least 256 MB for the host operating system plus an additional amount of memory to run the guest operating system. Of course, hard disk space requirements vary depending on the guest operating system.
For VMware Workstation 5.5, the requirements are given as:
Since VMware Workstation runs on x86-based hardware, most machines with Intel and AMD processors can run VMware Workstation 5. We recommend that you have a 500MHz or faster processor, 256MB of RAM, and at least 1GB of free disk space, depending on the operating system you want to install. For more details on recommended hardware, see the host system requirements.
The laptop I use has a 3 GHz Pentium 4 processor with 1 GB of main memory and gives acceptable performance. I generally switch back and forth between the host and the virtual machine. For my usual virtual machine, I allocate 384 MB of memory. For Virtual PC, the RAM allocated to a virtual machine must be physical RAM–oddly enough not Virtual RAM swapped to the hard drive! With VMware, I was able to start more simultaneous machines than I could with Virtual PC, but the excessive hard drive swapping was no fun.
The Benefits to a Developer
Virtual machine partitions are beneficial because they allow you to do the following things without destroying your current PC configuration:
Creating a Virtual Machine
When starting Virtual PC or VMware Workstation, you will be given the option to create a new virtual machine. Let the virtual machine wizard guide you through creating a virtual hard disk and allocating RAM and the like.
After the virtual machine is configured and started, a BIOS screen will appear as though you had turned on an actual PC. At this point, put in the bootable CD/DVD of the operating system you want and choose the appropriate option to make sure the emulator has control of the CD/DVD drive. For the record, a virtual machine can also read an .ISO image instead of using an actual device. (Virtual PC 2004 can’t read a DVD .ISO, though). You can also boot from floppy.
The virtual machine should boot from the CD. If you didn’t get the CD in time and are looking at an “operating system not found” type of error message, simply choose Ctrl+Alt+Delete option from the appropriate emulator menu to reset the machine. Because of the virtual hard disk concept, expect the operating system install to take longer than usual. In my configuration, I was able to let it run as a background task so I didn’t lose much productivity.
Once your operating system is installed correctly you’re good to go – you have a fully functional PC within a PC. If you’ve installed a supported operating system with your virtual emulator, you will probably want to install a special enhancement feature called:
Regardless of product, these features do pretty much the same thing: they allow for smooth interaction between the host operating system and the guest operating system. The options available in each product vary depending on the guest operating system but some of the features include:
Further, check the documentation as there are a few special keystrokes that you’ll want to learn in order to effectively use the emulator. The keystroke functions include:
VMware Workstation 5.5 retails for $199 and Virtual PC 2004, as of mid-July 2006, is free. Earlier this summer, Microsoft sold Virtual PC 2004 for $129. When you consider the cost of a virtualized workstation, don’t forget to include the guest operating system license price where applicable, the cost of other software you may need, and the cost of any PC hardware upgrades that may be required to run the virtual machine.
While I’ve been very happy with both products, VMware has a few additional benefits that may make it worth the money:
Also note that Microsoft Virtual PC 2007 is on the horizon and is expected to be offered for free as well.
Easily Build a Virtual Machine
The next time you cringe at ruining your current PC configuration by loading old development software to maintain an old application, or loading the next version of iSeries Access for testing with current software, think Virtual PC or VMware Workstation. When you need to debug a software issue running under the infamous Windows ME, don’t take a stab in the dark or configure a separate PC to recreate the problem, just use a virtual machine partitioning program to get the job done.
FOR MORE INFORMATION:
VMware Workstation 5.5
Virtual PC 2004
Michael Sansoterra is a programmer/analyst for i3 Business Solutions, an IT services firm based in Grand Rapids, Michigan. Click here to contact Michael Sansoterra by e-mail.