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
Boot the VHD image.
Navigate to the following directory: C:\Windows\System32\sysprep.
Double-click Sysprep to prepare and generalize the operating system.
In System Cleanup Action, select Enter System Out-of-Box Experience (OOBE).
Select the Generalize check box.
In Shutdown Options, click Shutdown.
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
Boot into the VHD on the computer.
Navigate to the following directory: C:\Windows\System32\sysprep.
Double-click Sysprep to prepare and generalize the operating system.
In System Cleanup Action, select Enter System Out-of-Box Experience (OOBE), select the Generalize check box, and then select Shutdown under Shutdown Options.
Boot into Windows PE (or another instance of the Windows operating system) on the computer.
Copy the image that you prepared by using Sysprep to the server running Hyper-V.
On the server running Hyper-V, start Hyper-V Manager (click Start, click Administrator Tools, and click Hyper-V Manager).
Click Action, click New, and then click Virtual Machine. The New Virtual Machine Wizard appears.
Specify a Name and Location for the new virtual machine, and then click Next.
Assign memory to the virtual machine, and then click Next.
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.
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.