Sunday, March 31, 2013

Convert Boot-to-VHD image to Hyper-V

The following post is a useful guide on how to modify a Boot-to-VHD image to work in Hyper-V:

http://blogs.msdn.com/b/bramveen/archive/2009/10/27/swapping-between-native-vhd-boot-and-hyper-v.aspx

From the command prompt, enter the following commands:

DiskPart

select vdisk file=C:\<VHDFILENAME>.VHD

attach vdisk

select part 1

active

assign letter=Z

exit

Z:

cd Z:\Windows\System32

BCDboot.exe Z:\Windows /s Z:\

BCDedit /store Z:\boot\BCD /set {bootmgr} device boot

BCDedit /store Z:\boot\BCD /set {default} device boot

BCDedit /store Z:\boot\BCD /set {default} osdevice boot

C:

Diskpart

select vdisk file=C:\<VHDFILENAME>.VHD

detach vdisk

exit

No comments: