Swapping between Native VHD boot and Hyper-V

Hi All,

I was building the Virtual PC that will be used in the “Wordpress on Windows Install Challenge” next Saturday on the Dutch Wordcamp event when I had to figure out if I could get this working.

My setup is a single laptop running Windows 7 native booted from a VHD as is described here. Unfortunately or great (Depends who you are talking to) Windows Server 2008 R2 only exists in 64bit so I couldn’t run it in Virtual PC as it currently only supports 32bit operating systems. So I started to create a VPC with Windows Server 2008 so I could use Hyper-V as a hypervisor which does support 64bit OSses.

I really love native boot VHDs they make live so easy and clear. I was working in WS2008R2 and build a Virtual Machine which the people will use on Saturday but all my tools of course were on my other VHD which runs Win7.

I thought I might be able to boot my main install in Hyper-V. I tried that and got a bootloader not found error message which makes sense as the bootloader of my laptop is on my system partition. After a little research I figured out how to make the VHD bootable by putting a bootloader on it.

From a command prompt run:

Open Diskpart

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

Attach Vdisk

select part 1


Assign letter=Z


Now, at the command prompt, change to Z:\Windows\System32

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

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

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

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

Change directory to C:\

open Diskpart again and run

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

detach vDISK


After this you can boot your VHD from Hyper-V it will install the drivers required and after a reboot it feels just like my main install. Only a bit slower as I have to reserve memory for the base os and my other VMs. If I want my power back I can boot native from the VHD and work from there.

On my physical disk there are only 3 files now windows7.vhd, hyperv.vhd and wordcamp.vhd (I like it).

See you all soon