Boot WinPE via WimBoot from Grub2 and iPXE

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:

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.

Boot wimboot from Grub2

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

Boot WinPE via wimboot with iPXE in UEFI mode

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!

Share this...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInPin on PinterestShare on RedditShare on TumblrShare on VKBuffer this pageDigg thisEmail this to someoneFlattr the authorPrint this pageShare on StumbleUponShare on Yummly