PC410.com, Science Translations in Westminster Maryland, established 1990

Managed IT Services, PC Service and Sales in Central Maryland
Home » Articles » Custom Virtual PCs

Custom Virtual PCs

Creating a Test ‘Computer’ in Windows Virtual PC

Written by
Editor, ASPects
Article reprint from the May 2010 issue of ASPects

Previously, I covered the download and installation of Windows Virtual PC and the pre-built VHD (virtual hard drive) of Windows XP Mode for Windows 7 Pro. This time, I’ll describe what happens when you create your own VHD. What I’ll create is a Windows 2000 Professional computer in a VPC box.

If you have already installed XP Mode, you have most of the software you need to support adding a virtual hard drive. Just add an operating system. I’ll use the original Windows 2000 Professional boot (W2K) CD. These steps require Windows 7 Professional or higher (Ultimate or Enterprise) as the operating system for the base PC, and a processor that supports hardware virtualization, which must be turned ON in the BIOS; for more, see Installing XP Mode and Virtual PC in Windows 7: Test Everywhere

If XP Mode isn’t already installed, just go to http://www.microsoft.com/xpmode and download Virtual PC. The XP Mode VHD download isn’t needed this time, but it’s useful for an XP installation that includes its own license, and is pre-configured to work well for running legacy applications.

After installing Virtual PC, run it from the Windows start globe; there is no desktop shortcut. It looks like a folder display, with a toolbar at the top–that’s all there is. Click on ‘Create virtual machine’ and add a name for the machine, and a path to a folder to hold it, and click ‘Next’.

Specify a name and location for this virutal machine...

Choose the memory and networking options. The defaults of 512Mb and ‘Use computer network connections’ work well for W2K. Click ‘Next’.

At ‘Add a virtual hard disk’ choose ‘Create a virtual hard disk using advanced options’ and check off ‘Enable Undo Disks’. Click ‘Next’. At ‘Choose the type of virtual hard disk to create’, choose ‘Fixed size’. I chose 8 Gb.

Click ‘Next’. Virtual PC will create the VHD file. Click ‘Close’ and you’ll be back at the Virtual PC folder, with a new entry for the Win2K machine, with a new entry, Win2000Pro.vmcx, with machine status, ‘powered down’.

Put the Win200Pro boot CD in the drive; double-click the VMCX file. A new window will open, with bootup messages. To exit the attempted network boot, press Ctrl-C. Allow Windows 2000 Pro setup to boot normally.

After the usual W2K drivers load, Windows will want to format the C: drive. It should only see the 8Gb hard drive, and it will want to format it. That’s why I chose that fixed size for the VHD–sanity and visibility. We’re building a computer inside a computer, and formatting hard drives that don’t exist inside hard drives that both exist and are non-trivial to restore. I first tried using the ‘non-fixed’ drive size, and Windows Virtual PC told Win2K that the C: drive was around 132 Gb. The real C: partition is currently 96 Gb. The real E: partition, where the VHD is located, is 124 Gb, with 82 Gb free. OK, I don’t have a clear view of what’s where, and telling Win 2000 Pro to go ahead and format that is either scary, as in: “Will it delete the real boot drive?” or scary: “Will it fill the E: drive?” I don’t need more than 8 Gb, don’t mind using all 8 Gb for as long as I need the VHD, and Windows 2000 Pro announced that it had found an 8Gb drive and offered to format it. OK, that’s within my comfort level–it all matches up.

Formatting the Windows 2000 Pro virtual drive in Microsoft Virtual PC

From here, it’s a totally routine Win 2000 Pro installation. After the usual reboots (all inside the virtual computer), and all the usual prompts for language, time zone, network settings, and so on, the result is the familiar Windows 2000 Pro desktop.

During the install, you’ll probably see a “Mouse captured” warning, telling you that the virtual PC isn’t letting your mouse move out of the box. Ctrl-Alt-Left-Arrow releases the mouse from the virtual PC, or use any keyboard shortcut to switch PCs, such as the Windows key with the Tab key.

Reminder: At this point, there’s a working W2K setup in a VHD, that has not been saved. You can easily lose the install, if you tell Virtual PC to close without saving changes–a reboot inside the VHD is not the same as telling Virtual PC to either ‘shut down’ or hibernate. And then saving a backup of the folder holding the VHD. Don’t choose ‘turn off’ the first time you run the VHD, or you’ll end up with an empty virtual computer–the operating system installation hasn’t been saved yet.

Now, not everyone wants or needs a Windows 2000 test PC. The steps above will work for other operating systems, too.

Second install: Just to mix things up and see what’s possible, I’ll install Linux, too. I went to http://www.ubuntu.com and downloaded the latest live CD of desktop Ubuntu, version 9.10, burned the ISO, restarted Virtual PC, created a VHD (allowed 1 Gb of RAM, 8 Gb hard drive), started it and booted from the live disk, and chose to install to the hard drive.

Ubuntu’s initial startup displayed as a black screen–it tries to use a different video mode than most default character-based programs, but as soon as the boot proceeded into the graphical interface, the display showed normally. I chose defaults for everything–installation was mostly routine. At the end, there’s a reboot, which didn’t work. Ubuntu left behind the last shutdown screen without restarting. I went to the Virtual PC toolbar, chose Action, and then Turn off, and then re-started the virtual PC, after removing the live/boot CD. Ubuntu started right up in the VPC.

Now here’s the kicker. I wrote parts of this article at the same time as the Win2K ‘machine’ was formatting in the background, and at the same time as the Ubuntu 9.10 ISO file was downloading in a Firefox window. As the setup progressed, so did the download and the article, even while W2K is rebooting. As everything progressed, I was able to grab screen captures of the virtual computers, including boot messages, in the normal way with Alt-printscreen, and paste them as needed in programs running in Windows 7. At no time during the installs did I exit my other desktop programs or restart the hardware. OK, all that is happening on a quad-core AMD Athlon II processor, with 8 Gb of non-virtual memory–real chips. But still, cool.

(Below, desktop view from top to bottom: Ubuntu 9.10 virtual machine, Windows XP Mode virtual machine, Windows 2000 Pro virtual machine, Virtual PC console showing status of the three running virtual PCs, all running under Windows 7 Ultimate, 64-bit.)

Windows 7 with virtual PC windows for Ubuntu Linux, Windows XP Pro, and Windows 2000 Professional

Jerry Stern is the editor of ASPects, the ASP’s Coordinator of Anti-Spyware Operations, runs Startupware.com and WordPerfect.org, and is online at www.sciencetranslations.com.