Grub2 UEFI PXE Boot, unable to set up proper Windows and iPXE chainloaders
by shivansps from LinuxQuestions.org on (#5H615)
Hi, im trying to migrate from grub4dos that ive been using for years for Legacy BIOS PXE boot, and it was working perfectly to boot both Linux, Windows, Clonezilla and iPXE for iSCSI booting.
Now, im trying to migrate to UEFI, reason for this is that some newer motherboards are lacking CSM.
I was able to set up Clonezilla and the Linix installers whiout too much issues.
For Windows, i have a special BCD with wims entries created to run repair disk, live wims, install wims, etc. This is setup is souch a way that if i set the dhcp server reqfilename to "bootx64.efi" it boots the Windows boot mgr and i can boot wims without any problem.
But trying to chainload bootx64.efi under grub2 so far has been impossible. Since direct booting the bootx64.efi works i tried this:
Code:menuentry "Windows Menu" {
chainloader /bootx64.efi
}But that results in a BlInitializeLibrary failed 0xc0000001 i think, it is lossing the tftp root access and it is not seeing any other files.
For reference, this is how i do it under grub4dos
Code:title Windows Menu
pxe keep
chainloader --raw /boot/pxeboot.n12As for iPXE i need to be able to pass a scritp file, chainloading the ipxe.efi file works but i cant load a script. So i tried to load it in the same way i do with the Clonezilla and Linux installers.
Code:menuentry "iPXE"{
linux /ipxe/ipxe.lkrn
initrd /ipxe/boot1.txt
}That results in a reboot.
Code:menuentry "iPXE"{
linuxefi /ipxe/ipxe.efi
initrdefi /ipxe/boot1.txt
}That gives me a "invalid magic number".
I saw that someone started working on a uefi version of grub4dos but it is missing features, so at this point i dont know what to do, i either wait or try to figure this out. But i just dont see how.


Now, im trying to migrate to UEFI, reason for this is that some newer motherboards are lacking CSM.
I was able to set up Clonezilla and the Linix installers whiout too much issues.
For Windows, i have a special BCD with wims entries created to run repair disk, live wims, install wims, etc. This is setup is souch a way that if i set the dhcp server reqfilename to "bootx64.efi" it boots the Windows boot mgr and i can boot wims without any problem.
But trying to chainload bootx64.efi under grub2 so far has been impossible. Since direct booting the bootx64.efi works i tried this:
Code:menuentry "Windows Menu" {
chainloader /bootx64.efi
}But that results in a BlInitializeLibrary failed 0xc0000001 i think, it is lossing the tftp root access and it is not seeing any other files.
For reference, this is how i do it under grub4dos
Code:title Windows Menu
pxe keep
chainloader --raw /boot/pxeboot.n12As for iPXE i need to be able to pass a scritp file, chainloading the ipxe.efi file works but i cant load a script. So i tried to load it in the same way i do with the Clonezilla and Linux installers.
Code:menuentry "iPXE"{
linux /ipxe/ipxe.lkrn
initrd /ipxe/boot1.txt
}That results in a reboot.
Code:menuentry "iPXE"{
linuxefi /ipxe/ipxe.efi
initrdefi /ipxe/boot1.txt
}That gives me a "invalid magic number".
I saw that someone started working on a uefi version of grub4dos but it is missing features, so at this point i dont know what to do, i either wait or try to figure this out. But i just dont see how.