Can't native boot Hyper-V generation 2 vhdx


  1. Posts : 5,478
    2004
       #1

    Can't native boot Hyper-V generation 2 vhdx


    If I create a generation 1 VM I can native boot the vhdx by adding bcd entry. If I make a generation 2 VM it fails with "a required device isn't connected...0xc0000225". Pressing f8 for "Startup Settings" gives "The application or operating system couldn't be loaded because a required file is missing. File \Windows\system32\winload.efi. Error code 0xc0000225"

    This is my BCD entry
    Code:
    Windows Boot Loader
    -------------------
    identifier              {default}
    device                  vhd=[D:]\Hyper-V\Windows-vm3\Virtual Hard Disks\Windows-vm3.vhdx
    path                    \WINDOWS\system32\winload.efi
    description             Windows-vm3
    locale                  en-US
    inherit                 {bootloadersettings}
    recoverysequence        {2bd3faf9-6091-11e5-86c4-c3a22c898ce3}
    recoveryenabled         Yes
    isolatedcontext         Yes
    flightsigning           Yes
    allowedinmemorysettings 0x15000075
    osdevice                vhd=[D:]\Hyper-V\Windows-vm3\Virtual Hard Disks\Windows-vm3.vhdx
    systemroot              \WINDOWS
    resumeobject            {2bd3faf2-6091-11e5-86c4-c3a22c898ce3}
    nx                      AlwaysOn
    bootmenupolicy          Standard
    hypervisorlaunchtype    Auto
    and the Hyper-V definition (I've tried with and without secure boot, changing the boot order and removing the separate pagefile drive. It always works on Hyper-V will never boot on native boot.

    Can't native boot Hyper-V generation 2 vhdx-capture.png

    Conversely if I install windows and turn off the VM before the first reboot I can boot it natively but Hyper-V will not boot (again complains of missing bootloader). The bootloader can't be repaired by bootrec, no valid windows installations are found.

    Windows versions I'm using are 10 Pro build 10240 for host, build 10586 or 10240 for guest.

    Does anyone know if it is possible to native boot a generation 2 VM vhdx and boot it through Hyper-V, the same as you can with generation 1?
      My Computer


  2. Posts : 16,605
    Windows 11 Pro X64
       #2

    How much HD space have you allotted. It needs to be able to expand to the full size during boot.
      My Computers


  3. Posts : 5,478
    2004
    Thread Starter
       #3

    Dude said:
    How much HD space have you allotted. It needs to be able to expand to the full size during boot.
    It's only 20GB maximum - I have space for it to expand to full size..
      My Computer


  4. Posts : 16,605
    Windows 11 Pro X64
       #4

    I would try at least 40gb, always worked for me in hyper-v at that size.
      My Computers


  5. Posts : 5,478
    2004
    Thread Starter
       #5

    Thanks, I'll try that in a bit - I'm upgrading to 10586 at the moment... I found this as well which seems to say I'm making the bcd entry wrong...

    Using VHD Native Boot with UEFI Firmware - bcdedit vs bcdboot - dai - Site Home - MSDN Blogs
      My Computer


  6. Posts : 16,605
    Windows 11 Pro X64
       #6

    Nice find, good luck
      My Computers


  7. Posts : 5,478
    2004
    Thread Starter
       #7

    That was it - bcd was created wrong method for UEFI vhdx.

    In case it helps...

    For generation 1:
    • bcdedit /copy {default} /d "Boot from Foobar.vhdx"
    • bcdedit /set {guid} device vhd="[D:]\VHDs\Foobar.vhdx" (replacing guid with the generated guid and D with the drive the vhdx is on)
    • bcdedit /set {guid} osdevice vhd="[D:]\VHDs\Foobar.vhdx"
    • bcdedit /set {guid} detecthal on

    For generation 2:
    • mount vhdx
    • bcdboot F:\Windows (replacing F with the drive it vhdx is mounted to)
    • bcdedit /set {default} description "Boot from Foobar.vhdx"
      My Computer


  8. Posts : 16,605
    Windows 11 Pro X64
       #8

    Glad you got it working right.
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 02:34.
Find Us




Windows 10 Forums