I cannot make my VHD bootable.
I'm following this guild word for word, trying to create a Bootable VHD.
The BCDboot is supposed to create boot configuration entry so that windows bootloader can boot from the VHD, and I've seen it went successful, however, it just doesn't work:
D:>P:\windows\system32\bcdboot P:\windows /s P:
Boot files successfully created.
D:>BCDEdit
Windows Boot Manager
identifier {bootmgr}
device partition=\Device\HarddiskVolume1
path \EFI\MICROSOFT\BOOT\BOOTMGFW.EFI
description Windows Boot Manager
locale en-US
inherit {globalsettings}
default {current}
resumeobject {c605aeaf-...8}
displayorder {current}
toolsdisplayorder {memdiag}
timeout 30
Windows Boot Loader
identifier {current}
device partition=C:
path \Windows\system32\winload.efi
description Windows 10
locale en-US
inherit {bootloadersettings}
recoverysequence {c605aeb1-...8}
displaymessageoverride Recovery
recoveryenabled Yes
isolatedcontext Yes
allowedinmemorysettings 0x15000075
osdevice partition=C:
systemroot \Windows
resumeobject {c605aeaf-...8}
nx OptIn
bootmenupolicy Standard
hypervisorlaunchtype Auto
I.e., the device partition=P: entry is not there.
When I tried to boot it from Hyper-V, Hyper-V tells me that there is no boot-loader.
What could possibly wrong and how can I fix it? (again, I'm followed this guild word for word successfully until I came to the bcdboot & BCDEdit step. I.e., all my steps are exactly as shown there.)
UPDATE:
I'm not sure if I'm using UEFI though, because these are all it takes for me to create my disk:
select vdisk file=e:\vhd\winboot.vhd
attach vdisk
create partition primary
assign letter=v
active
format quick FS=NTFS Label=VHD
Most importanly, when select the Generation type for hyper-v, I chose Generation 1, which I think don't support UEFI.
BCDstore for the VHD, it's UEFI, whereas theDiskPartcommands you issued are for BIOS (bcdeditshows the BCD store for the booted OS ifBCDstore isn't specified). @wasif-hasan's answer is the semi-correct way to configure the VHD - I'd recommend modifying it slightly to create the WinRE partition in front of the EFI (order: 1: 665MB WinRE; 2: 100MB EFI; 3: 16MB MSR; 4: OS partition), such as in thisDiskPartscript (diskpart /s CreatePartitions.txt). – JW0914 Jun 18 '20 at 11:06