Virtual Hard Disks

A "virtual hard disk" (vhd) is a file somewhere on your real hard disk. It can be placed on any accessible partition on your real hard disk. The virtual machine will pretend this file is a complete hard disk in itself. This step can be completed while creating a virtual machine, but I am presenting it as a separate step to reinforce the point that it is a separate operation and need not be done through the virtual machine wizard.

A virtual hard disk can be partitioned and formatted, just like a real hard disk. Even utilities like Partition Magic can be run inside a virtual machine to partition a virtual hard disk.



Create a Virtual Hard Disk

Step 1:

Start the Virtual PC Console.

From the menu bar, click File, then select Virtual Disk Wizard.
Step 2:

Click Next to continue.
Step 3:

Select the option to Create a new virtual disk.

Click Next to continue.
Step 4:

Select the option to create A virtual hard disk.

Click Next to continue.
Step 5:

The virtual hard disk will be a vhd file. This file can be located anywhere on the host system. Remember, the file is going to represent an entire hard disk, so it will be a very large file.

I prefer to keep my C: drive slimmed down for more efficient backup imaging, so let's put the vhd file on drive E:, a large NTFS data partition.

Each virtual machine should have its own vhd. We can create other vhd files to use with other virtual machines. Since we're going to install Windows 98 on this vhd, we'll give it a name to help identify this one.

Click Next to continue.
Step 6:

If we select a fixed size virtual disk, the vhd file will be the same size as the virtual disk. If we select a dynamically expanding virtual disk, the vhd file will start off being smaller --just enough to cover the amount of disk space actually being used in the virtual machine. As our virtual machine adds more and more files to the virtual disk, the vhd file will increase in size.

Click Next to continue.
Step 7:

A virtual hard disk can be up to 137 GB in size. We're not going to install a lot of stuff on this Windows 98 virtual machine, so let's limit the size of the virtual disk to 2 GB.

Click Next to continue.
Step 8:

Click Finish.


This process creates a file called vpc_w98.vhd on the E: drive. Initially, the file is not that large, but as I install Windows on it and begin filling the virtual disk, the size of the file will increase.

The vhd file can be duplicated if I want additional 2-GB virtual disks.

If you want to use a real hard disk partition in a virtual machine, you must create a vhd file that is linked to your real hard disk. This Linked to a hard disk option is shown in Step 6. Note that you cannot link a partition to a vhd, you must link the entire hard disk. The partition will then be available to the virtual machine, but so will all the other partitions. This exposes all the other partitions to potential corruption if something goes wrong in the virtual machine.


author: Dan Goodell

Back