Using a Boot to VHD file in a Hyper-V Server VM

hyper-v-server-2008-r2vhdvirtual-machines

I have a file win7.vhd that I've been using in a Boot to VHD scenario. Now I want to run that Windows 7 instance within Hyper-V Server alongside a few other VMs I have. I sysprepped win7.vhd and copied it over to the the Hyper-V Server and tried creating a new VM using that .vhd file. I get the "Boot failure. Reboot and Select proper Boot device or Insert Boot Media in selected Boot device" error. Any suggestions?

Best Answer

I was able to successfully boot my vhd in Hyper-V Server using the sequence of commands found at http://www.ravichaganti.com/blog/?p=317

  • Boot into a Windows 7 Installation disc. When the wizard begins, open a command prompt by pressing Shift+F10
  • Open Diskpart
  • Select vdisk file=D:\Win7.VHD
  • Attach Vdisk
  • select part 1
  • active
  • Assign letter=Z
  • exit
  • 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=D:\Win7.VHD
  • detach vDISK
  • Exit