a1ive / grub

Fork of GRUB 2 to add various features.
GNU General Public License v3.0
138 stars 38 forks source link

vhd Boot fail #69

Closed atmgnd closed 4 years ago

atmgnd commented 4 years ago

I have some vhds, sometimes, I got 0x0c0000000f or ix0c00000359.

, 64bit uefi mode.

a1ive commented 4 years ago

any screenshots? which command did you use?

atmgnd commented 4 years ago

IMG_20200716_134718

Here is the screenshot of using latest grub2-filemananger gui. I created the vhd somewhere else using virtual machine(BIOS). then I copy to this pc, using grubfmx64.efi(UEFI)'s NTBOOT to try to boot, error 0x0c0000000f or ix0c00000359 ocurrs. Plus I can mount the vhd under windows 10.

But if I recreate the virtual machine and reinstall windows in it, do the copy, try again.the reinstalled vhd may boots ok.

It looks like a low probability problem, And

atmgnd commented 4 years ago

I have noticed the real path of winload.efi is: \Windows\System32**Boot\winload.efi not \Windows\System32\boot**\winload.efi

Is that the reason?

atmgnd commented 4 years ago

I have noticed the real path of winload.efi is: \Windows\System32Boot\winload.efi not \Windows\System32boot\winload.efi

Is that the reason?

Negative, I have mount the vhd under windows 10, rename Boot directory to Bootx, and then rename to boot, then boot it again using grub2-filemanager's ntboot. result: same error.

a1ive commented 4 years ago

if it shows bcd error 0xc000000f , you can press ENTER twice to skip this error (see http://bbs.wuyou.net/forum.php?mod=viewthread&tid=417545)

IMG_20200716_134718

Here is the screenshot of using latest grub2-filemananger gui. I created the vhd somewhere else using virtual machine(BIOS). then I copy to this pc, using grubfmx64.efi(UEFI)'s NTBOOT to try to boot, error 0x0c0000000f or ix0c00000359 ocurrs. Plus I can mount the vhd under windows 10.

But if I recreate the virtual machine and reinstall windows in it, do the copy, try again.the reinstalled vhd may boots ok.

It looks like a low probability problem, And

I can't reproduce the 0xc0000359 error.

But if I recreate the virtual machine and reinstall windows in it, do the copy, try again.the reinstalled vhd may boots ok. Negative, I have mount the vhd under windows 10, rename Boot directory to Bootx, and then rename to boot, then boot it again using grub2-filemanager's ntboot. result: same error.

have you tried to boot the vhd directly using bootmgfw.efi and bcd ? you can use the following batch commands to generate the bcd file:

set guid={12345678-6666-8888-abcd-000000000000}
set bcdfile=/store bcd
set vhdfile=\path\to\windows.vhd

bcdedit /createstore bcd
bcdedit %bcdfile% /create {bootmgr} /d "Windows Boot Manager"
bcdedit %bcdfile% /set {bootmgr} timeout 1
bcdedit %bcdfile% /set {bootmgr} locale en-us
bcdedit %bcdfile% /set {bootmgr} displaybootmenu true
bcdedit %bcdfile% /set {bootmgr} nointegritychecks true
bcdedit %bcdfile% /create {globalsettings}
bcdedit %bcdfile% /set {globalsettings} optionsedit true
bcdedit %bcdfile% /set {globalsettings} advancedoptions true
bcdedit %bcdfile% /create %guid% /d "BOOT VHD" /application OSLOADER
bcdedit %bcdfile% /set %guid% device vhd=[C:]%vhdfile%
bcdedit %bcdfile% /set %guid% path \Windows\System32\boot\winload.efi
bcdedit %bcdfile% /set %guid% osdevice vhd=[C:]%vhdfile%
bcdedit %bcdfile% /set %guid% locale en-us
bcdedit %bcdfile% /set %guid% systemroot \Windows
bcdedit %bcdfile% /set %guid% detecthal true
bcdedit %bcdfile% /set %guid% pae default
bcdedit %bcdfile% /set %guid% nx OptIn
bcdedit %bcdfile% /displayorder %guid% /addlast
atmgnd commented 4 years ago

I don't think it's grub2-filemanager's problem, because I install a windows 10 to the pc, then added a boot entry use official ms's bcdboot, still the same error. IMG_20200716_184538

atmgnd commented 4 years ago

Hello, a1ive, I have another question not relative to this issue,

  1. Is it bootmgrw.efi, boot.sdi unmodified micorsoft 's binaries? Can you explain it to me ? thanks.
a1ive commented 4 years ago

Hello, a1ive, I have another question not relative to this issue,

  1. Is it bootmgrw.efi, boot.sdi unmodified micorsoft 's binaries? Can you explain it to me ? thanks.

grub2-filemanager uses unmodified bootmgfw.efi extracted from MS Windows Server 2019 ISO.(https://github.com/a1ive/grub2-filemanager/raw/master/arch/x64/wimboot.xz) Booting VHD/ Windows OS doesn't need boot.sdi.

atmgnd commented 4 years ago

I found the reason is: I am trying to boot a 32bit windows 10 vhd image using 64bit uefi firmware.

From msdn(https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-8.1-and-8/hh824898(v=win.10)?redirectedfrom=MSDN): While in UEFI mode, the Windows version must match the PC architecture. A 64-bit UEFI PC can only boot 64-bit versions of Windows. A 32-bit PC can only boot 32-bit versions of Windows. In some cases, while in legacy BIOS mode, you may be able to run 32-bit Windows on a 64-bit PC, assuming the manufacturer supports 32-bit legacy BIOS mode on the PC.

and https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface

a1ive commented 4 years ago

Actually, it's possible to boot 32-bit Windows in 64-bit UEFI if we create a 'fake' 32-bit UEFI firmware, but it may be very difficult.

atmgnd commented 4 years ago

Actually, it's possible to boot 32-bit Windows in 64-bit UEFI if we create a 'fake' 32-bit UEFI firmware, but it may be very difficult.

Yes, but I don't think there is such a need(emulate a 32 bit uefi on 64 bit uefi), uefi is how how very recent/modern. Maybe there won't be new 32bit windows 10 in the near future.