Copying and moving virtual hard disks

Copying and moving virtual hard disks

You can use the file system of the host operating system to copy or move a virtual hard disk. A virtual hard disk is stored as a file that has a .vhd extension. Your user account must have the appropriate permission to access a .vhd file because Virtual Server 2005 uses discretionary access control lists (DACLs) to control access to the folders and files used by Virtual Server. For more information, see File system security settings for Virtual Server.

In general, we recommend that you use one location to store all files used by a virtual machine, including all virtual hard disk files. Using one location makes it easier to manage the virtual machine and also makes it more portable. However, if you need to store a large amount of data or improve disk performance, it may be more practical to store virtual hard disks in another location.

Before you attempt to copy or move a virtual hard disk, it is important to know whether the virtual hard disk is associated with another disk, such as an undo disk or a differencing disk. If so, you must also copy or move the undo disk or differencing disk. This is especially important if the virtual hard disk is not stored in the same folder as the virtual machine, because undo disks are stored in the same location as the virtual machine configuration file.

It is also important to know whether a virtual machine has been placed into a saved state. If you save the state of a virtual machine instead of shutting it down, all data from the virtual machine's memory is stored in a saved-state file (.vsv file) instead of in a .vhd file. We recommend that you either restore the virtual machine or discard the changes and then shut down the virtual machine before moving or copying a .vhd file. For more information about virtual machine states, see Managing virtual machine state.

Copying a virtual hard disk

There are several considerations that apply only when you copy a virtual hard disk instead of move it, as follows:

  • Guest operating system licenses are not included with Virtual Server. You must ensure that you are appropriately licensed for all operating systems and applications that you install on a virtual machine.
  • If the virtual hard disk contains a Windows operating system, use the System Preparation (Sysprep.exe) tool to make a distributable version of the operating system. A distributable version is ready to be personalized and does not contain security identifiers. For links to information about Sysprep, see Virtual Server Resources.
Do not copy a .vhd file while it is in use by a virtual machine. The file system of the host operating system does not prevent you from copying a file in use; however, data will be missing from the copied file because data in the virtual machine's memory will not be copied. Do not copy a .vhd file that is used by a virtual machine configured as a domain controller; doing so can cause problems such as duplicate security IDs (SIDs) appearing on the network.

Moving a virtual hard disk

When you move a virtual hard disk, the main consideration is ensuring that you update all other files that refer to the virtual hard disk's location. Consider the following:

  • The virtual machine configuration file (.vmc file) stores path information about each virtual hard disk attached to the virtual machine. You can update the location information of the virtual hard disk by modifying the virtual machine configuration. For instructions, see Modify general virtual machine properties.
  • If the Undo Disks feature is turned on for the virtual machine, or the virtual hard disk you want to move uses differencing disks, consider committing or merging the disks. For more information, see Using Undo Disks and Using differencing disks.