WinPE

The Windows Preinstallation Environment (WinPE) is a lightweight version of Windows that can be used for many tasks. It was originally designed as a 32-bit replacement for DOS - for windows deployment, backup and recovery. WinPE is a complete, standalone operating system and will work independently of any other operating systems already installed. See here for more information.

This document covers PXE booting WinPE in RAM via a .wim file - the most common WinPE setup. Flat-boot WinPE is not covered. This page contains instructions for booting WinPE directly from a .wim file - booting from a WinPE ISO file is covered elsewhere in this document (see here).

MistyPE screenshot (MistyPE is a winbuilder project - this particular build uses WinPE 3.1 source files) -

Required Files

You will need to build your own WinPE as the files are Non-redistributable. Two simple methods include -

The main WinPE files required for PXE Boot are -

Various configurations can be used for PXE booting WinPE - the files listed above are the bare minimum used in testing. The location and name of the .wim and .sdi files are set in the Boot Configuration Data store (the BCD file) - consequently names and paths can be changed. The path to the BCD store is hardcoded to \boot\BCD (with this path being relative to the root directory of the TFTP server), however this can be changed by specifying a different path in opt252 (in config.ini). In the scope of this guide the following files and paths are used -

Tiny PXE Server directory structure -

To obtain bootmgr.exe and pxeboot.n12 you will need to extract them from boot.wim - they can be located in the \Windows\Boot\PXE\ directory within the mounted .wim image. Various methods can be used to extract these files, including -

Remember that pxeboot.0 is a (renamed) copy of pxeboot.n12. A batch file to extract bootmgr.exe and pxeboot.n12 using wimlib-imagex is available here (customise it to suit your own needs).

Now add a menu entry for your preferred Network Bootstrap Program -

Or directly load the WinPE Network Bootstrap Program (see here)

WinPE Network Bootstrap Program

The WinPE network bootstrap program (pxeboot.0) can be specified as the Tiny PXE Server boot file (filename option in config.ini) - avoiding the need to chainload it from Grub4dos/iPXE/PXELINUX.

Click on one of the following for sample config.ini settings (edit to reflect your own setup) -

To specify a path to the BCD store other than the default /boot/BCD, add an opt252 entry (e.g. opt252=boot\x86\BCD)

Screenshot (detail) of the WinPE boot.wim file being loaded via TFTP during the PXE boot process -

pxelinux settings

Remember to ensure that the required files are copied to your Tiny PXE Server root directory -

Add the following to C:\pxesrv\files\pxelinux.cfg\default (create this file if required) -

Click on one of the following for sample config.ini settings (edit to reflect your own setup) -

To specify a path to the BCD store other than the default /boot/BCD, add an opt252 entry (e.g. opt252=boot\x86\BCD)

grub4dos settings

Remember to ensure that the required files are copied to your Tiny PXE Server root directory -

Add the following to C:\pxesrv\files\menu.lst\default (create this file if required) -

Click on one of the following for config.ini settings (edit to reflect your own setup) -

To specify a path to the BCD store other than the default /boot/BCD, add an opt252 entry (e.g. opt252=boot\x86\BCD)

iPXE settings

Remember to ensure that the required files are copied to your Tiny PXE Server root directory -

Add the following to the menu section of C:\pxesrv\files\ipxe_menu.txt (create this file if required) -

Add the following to the menu options section of C:\pxesrv\files\ipxe_menu.txt -

E.g. -

NOTE - remember to change set boot-url http://${dhcp-server} if using ProxyDHCP.

Click on one of the following for config.ini settings (edit to reflect your own setup) -

To specify a path to the BCD store other than the default /boot/BCD, add an opt252 entry (e.g. opt252=boot\x86\BCD)

iPXE Scripts

iPXE menus are essentially complicated scripts. It's also possible to specify a script using the altfilename option in config.ini. NOTE - remember to change set boot-url http://${dhcp-server} if using ProxyDHCP.

Sample iPXE script -

Document date - 28th February 2017(DRAFT)