wimboot is a boot loader for WinPE (.wim). You can use wimboot to boot WinPE from Grub2 in Legacy mode and iPXE in UEFI mode.
Introduction
AIO Boot uses wimboot to boot WinPE when it can not directly use Windows Boot Manager. In fact wimboot will boot Windows Boot Manager from RAM disk instead of physical disk.
AIO Boot uses wimboot for the following cases:
- Boot from GPT hard disk in Legacy BIOS mode. Because Windows Boot Manager can not boot in Legacy mode on a GPT hard drive.
- Boot through Network boot.
- Also use wimboot in case you can not run AIOCreator.exe. Useful if you are using Linux or macOS. However, I encourage you to integrate WinPE 10 and then boot into WinPE 10 and run AIOCreator.exe instead of using wimboot.
In Legacy mode, we will use Grub2 and in UEFI mode we will use iPXE. Currently Grub2 does not support booting wimboot in UEFI mode, hopefully in the future it will support doing this. Syslinux, pxelinux and Grub4dos also support wimboot but I have not tried it yet.
Grub2
First, you need to copy all the WinPE (.wim) files to /AIO/Files/WinPE. For the ISO file, you need to extract the sources\boot.wim file. From the Grub2 main menu, press the t
key to quickly access the “Boot WinPE via WimBoot” menu.
This is the Grub2 script written for AIO Boot. You need to change the path of your files.
function wimboot { echo "Loading ${1}... Please wait...". linux16 /AIO/Tools/MS/PXE/wimboot.x64 rawbcd initrd16 \ newc:bootmgr:/AIO/Tools/MS/PXE/bootmgr \ newc:bootmgr.exe:/AIO/Tools/MS/PXE/bootmgr.exe \ newc:bcd:/AIO/Tools/MS/PXE/boot/bcd \ newc:segmono_boot.ttf:/AIO/Tools/MS/PXE/boot/fonts/segmono_boot.ttf \ newc:segoe_slboot.ttf:/AIO/Tools/MS/PXE/boot/fonts/segoe_slboot.ttf \ newc:segoen_slboot.ttf:/AIO/Tools/MS/PXE/boot/fonts/segoen_slboot.ttf \ newc:wgl4_boot.ttf:/AIO/Tools/MS/PXE/boot/fonts/wgl4_boot.ttf \ newc:boot.sdi:/AIO/Tools/MS/boot.sdi \ newc:boot.wim:"${1}" } function ListWimBoot { echo "Getting the list of files in \"/AIO/Files/WinPE\". Please wait..." for file in /AIO/Files/WinPE/*.wim /AIO/Files/WinPE/*.WIM /AIO/Files/WinPE/*/*.wim /AIO/Files/WinPE/*/*.WIM; do if ! test -f "$file"; then continue; fi regexp -s filename "/AIO/Files/WinPE/(.*)" "$file" if [ -z "$havefile" ]; then set havefile="1"; fi menuentry "${filename}" { wimboot "/AIO/Files/WinPE/${1}" } done if [ -z "$havefile" ]; then echo echo "Please copy all your WIM files to the \"/AIO/Files/WinPE\" folder first." echo echo -n "Press ESC to continue " sleep -i -v 60 else unset havefile menuentry "Return to the Main menu" { configfile ${prefix}/grub.cfg } fi unset filename } submenu "Boot WinPE via WimBoot" { if [ -n "$pc" ]; then ListWimBoot else chainloader /EFI/iPXE/WimBoot${_SPEC_UEFI_ARCH}.efi fi }
This is the command to boot WinPE in whatever path you want. For example, the boot.wim file is located in the root directory. press c to enter:
wimboot "/boot.wim"
iPXE
In UEFI mode, we will use iPXE instead of Grub2. By default, AIO Boot will boot /AIO/Files/WinPE/x64/boot.wim for 64-bit and /AIO/Files/WinPE/x86/boot.wim for 32-bit. AIO Boot will chain the /EFI/iPXE/WimBootx64.efi file (named from ipxe.efi) and iPXE will load the menu at /AIO/Tools/PXE/ipxewimboot.ipxe. If you copied the boot.wim file to the default directory, just select the WinPE & Setup menu from iPXE.
If you need to boot into a .wim file other than the default path, just set the value for the wimfile variable. Press the s
key or access the Enter iPXE shell menu and enter the following command:
set wimfile /ADK/boot.wim goto wimboot exit
The above command will set the value of the wimfile variable to /ADK/boot.wim, of course, that this file must exist in order to be able to boot. Unlike Legacy mode, in UEFI mode, wimboot only works when the file is named boot.wim. This means that each boot.wim file should be in a separate directory.
You should use AIOCreator.exe to integrate WinPE if possible. Wish success!
FYI – the boot.wim can be any name. You need to use –name for UEFI grub2 menus, e.g.
initrd –name boot.wim file:/win/boot64.wim boot.wim
This will work for both UEFI and Legacy.
Thank you for sharing. I help me much but Can you show me how your WimBootx64.efi (named from ipxe.efi) built from source? I build mine to embed scripts but not work as your’s does.
What does not work? If you want to download the file directly from the disk without going through the network, call the file “
file:/path/to/file
“Thank you for your reply. I just don’t know how your ipxe.efi(named to WimBootx64.efi ) built. I built it from source with a embed scripts but not work.
I follow the steps here: Compile IPXE.
Got it! Thank u very much!!
Thanks,
Is this working also with a script?
Example : chainloader /path/to/ipxe.efi /path/to/myscript.ipxe
?
No, you need to embed the command “
chain /path/to/myscript.ipxe
” into ipxe.efi.Do you know how that works?
I don’t know how it works.
iPXE will execute the embedded script. To easily change scripts without having to rebuild iPXE.efi, chain to another external script file.
Hello,
How can I chainload from grub2 in ipxe with script?
Thanks
For wimboot UEFI?
Try this.
Sorry, i mean to chainload to ipxe
Download ipxe.efi.