Share via


Using Existing Virtual Hard Disks with Hyper-V

Applies To: Windows 7, Windows Server 2008 R2

The following section provides step-by-step instructions for how to migrate a bootable VHD image between physical and virtual environments. This process relies on using the System Preparation (Sysprep) tool. You use Sysprep to remove unique information from the Windows installation, which enables you to reuse that image on different computers.

For more information, see the Sysprep Technical Reference (https://go.microsoft.com/fwlink/?LinkID=155027).

To migrate a VHD that is using Hyper-V to a physical environment

  1. Boot the VHD image.

  2. Navigate to the following directory: C:\Windows\System32\sysprep.

  3. Double-click Sysprep to prepare and generalize the operating system.

  4. In System Cleanup Action, select Enter System Out-of-Box Experience (OOBE).

  5. Select the Generalize check box.

  6. In Shutdown Options, click Shutdown.

  7. Now you are ready to configure the VHD for native boot or to boot in a virtual machine by following the instructions in Preparing Virtual Hard Disks for Boot.

To deploy the image, follow the instructions in the “Deploying a bootable VHD by using Xcopy” section of Deploying Virtual Hard Disks.

To migrate a VHD that is running on a physical computer to a Hyper-V environment

  1. Boot into the VHD on the computer.

  2. Navigate to the following directory: C:\Windows\System32\sysprep.

  3. Double-click Sysprep to prepare and generalize the operating system.

  4. In System Cleanup Action, select Enter System Out-of-Box Experience (OOBE), select the Generalize check box, and then select Shutdown under Shutdown Options.

  5. Boot into Windows PE (or another instance of the Windows operating system) on the computer.

  6. Copy the image that you prepared by using Sysprep to the server running Hyper-V.

  7. On the server running Hyper-V, start Hyper-V Manager (click Start, click Administrator Tools, and click Hyper-V Manager).

  8. Click Action, click New, and then click Virtual Machine. The New Virtual Machine Wizard appears.

  9. Specify a Name and Location for the new virtual machine, and then click Next.

  10. Assign memory to the virtual machine, and then click Next.

  11. On the Connect Virtual Hard Disk page, select Use an existing virtual hard disk, browse to the location of the VHD that you prepared with Sysprep, and then click Finish.

  12. Now you are ready to configure the VHD for native boot or configure it to boot in a virtual machine by following the instructions in Preparing Virtual Hard Disks for Boot.