Share via


About virtual hard disks

Applies To: Windows 7

Virtual hard disks provide storage for a virtual machine. A virtual machine requires at least one virtual hard disk so that an operating system can be installed. When you create a virtual machine, you have the option of creating a virtual hard disk. To provide more storage for a virtual machine, you can add virtual hard disks to the virtual machine as long as the virtual machine is shut down or turned off. Each virtual machine can have a maximum of 3 virtual hard disks.

You can perform some management tasks for virtual hard disks. For more information, see Modify a virtual hard disk.

Important

Virtual hard disks are stored as .vhd files, which makes them portable but also poses potential security risks. For example, an unauthorized user could gain access to the file and might be able to access the data. We recommend that you mitigate this risk by taking precautions such as storing the .vhd files in a secure location.

Creating virtual hard disks

Before you create a virtual hard disk, make sure you understand the physical storage that is required for the .vhd file. The storage requirements are different for the different types of virtual hard disks. The types of disks and storage requirements are as follows:

  • Dynamically expanding virtual hard disk. This type requires a minimum of 8 MB free space on the physical storage media. The size of the disk (and the .vhd file) grows as the disk is used, up to the maximum size specified when the disk was created.

  • Fixed virtual hard disk. This type of disk requires as much physical storage space as the size you specify for the disk when you create it. The size of the .vhd file is the same as the virtual hard disk size and remains unchanged.

  • Differencing virtual hard disk. This type requires a small amount of physical storage when you create the disk, and requires more storage as the size of the disk grows. The maximum size of a differencing disk is restricted by the maximum size of its parent hard disk.

Important

We recommend that you write-protect or lock the parent disk before using the differencing disk. Otherwise, if the parent disk is modified by some other process, any differencing disk related to it becomes invalid, and all data written to the differencing disks is lost.

To create a virtual hard disk

  1. Open the Virtual Machines folder. (From the Start menu, click Windows Virtual PC.)

  2. Right-click the name of the virtual machine that you want to attach the new virtual hard disk to, and then click Settings.

  3. In the left pane, click one of the Hard Drive settings.

  4. In the right pane, click Create. The Create a Virtual Hard Disk Wizard opens.

  5. Proceed through the pages of the wizard. After the virtual hard disk is created, it is attached to the virtual machine and available to the guest operating system. If you install an operating system to this virtual hard disk, the installation process automatically prepares the disk for use and you do not need to complete the remaining steps. Otherwise, complete the next steps to prepare the disk for use inside the guest operating system.

Note

You can complete the following steps only if the virtual machine is already configured with a guest operating system (installed to a virtual hard disk attached to the virtual machine).

Start the virtual machine and log on to the guest operating system.
  1. Open Disk Manager.

  2. The new virtual hard disk is shown as a separate disk. Assign a drive letter and create a volume, the same as you would for a physical disk. The virtual hard disk is now available for use.

Using an existing virtual hard disk

You can use an existing virtual hard disk by attaching it to a virtual machine. The steps differ depending on whether you attach the virtual hard disk when you create the virtual machine, or after the virtual machine exists.

To use an existing virtual hard disk when you create a virtual machine

  1. Start the Create a Virtual Machine Wizard. (For instructions, see Create a virtual machine and install a guest operating system.)

  2. On the Add a virtual hard disk page, select Use an existing virtual hard disk.

  3. Next to Location, type the full path to the .vhd file (including the .vhd file name)—or click Browse, navigate to the .vhd file, and then click Open.

  4. Click Create to finish creating the virtual machine.

To use an existing virtual hard disk with an existing virtual machine

  1. Open the Virtual Machines folder. (From the Start menu, click Windows Virtual PC.)

  2. Open the settings for the virtual machine. In the Virtual Machines folder, right-click the name of the virtual machine, and then click Settings.

  3. In the left pane of the Windows Virtual PC Settings page, click Hard Disk 1, Hard Disk 2, or Hard Disk 3.

  4. Click Virtual hard disk file. Type the full path to the .vhd file, (including the .vhd file name)—or click Browse, navigate to the .vhd file, and then click Open.

  5. Click OK to save the change.

See Also

Concepts

Use Undo Disks
Configuring a virtual machine
Configuring and using Windows XP Mode
Using a virtual machine
Windows Virtual PC Help