Windows PE (Windows Preinstallation Environment, also known as WinPE) is a lightweight Windows version that runs from memory and can be booted from the network, used to deploy workstations and servers or for system maintenance.
Windows PE can may be needed for various reasons, like installing Windows from the network, booting Windows PE from the network or simply running some Windows application without installing Windows or using WINE.
I needed a live Windows PE ISO to be able to update my Dell BIOS, because all the other methods of updating the BIOS on my Dell XPS L702x from Linux I found had failed (and I don’t have Windows installed on my laptop). Whatever reason you have to build a customized bootable Windows PE image, here’s how to create it from Linux.
Create a bootable Windows PE ISO in Linux
To create a bootable Windows PE image in Linux (no Windows machine is necessary), you need a Windows 7 or 8 DVD or you can download the Windows Automated Installation Kit (WAIK) ISO from Microsoft’s website
In my test, I’ve used the Windows Automated Installation Kit (WAIK) ISO and not a Windows 7 / 8 DVD.
2. The live Windows PE ISO will be created using Wimlib so you need to install this tool. In Ubuntu, you can install the latest Wimlib by using the main WebUpd8 PPA:
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install wimtools
If you’re not using Ubuntu, search for Wimlib / wimtools in your Linux distribution repositories or, alternatively, download the source from SourceForge.
3. Only if you’ve you’ve downloaded the Windows AIK (KB3AIK_EN.iso) ISO from Microsoft’s website:
Firstly, you need to create a folder where we’ll mount the downloaded WAIK (KB3AIK_EN.iso) ISO:
Then, mount KB3AIK_EN.iso using the following command:
sudo mount KB3AIK_EN.iso $HOME/waik
4. Now let’s create the customized live Windows PE ISO. For this, we’ll use the “mkwinpeimg” tool included in Wimlib:
a) If you’ve used a Windows 7 or 8 DVD:
mkwinpeimg --iso --windows-dir=/mnt/windows winpe.iso
b) If you’ve used the WAIK (KB3AIK_EN.iso) ISO:
mkwinpeimg --iso --waik-dir=$HOME/waik winpe.iso
you can now unmount the WAIK ISO:
sudo umount $HOME/waik
Here’s what the “mkwinpeimg” options above do:
- “–iso” – it specifies the tool to make an ISO image instead of a disk image
- “--windows-dir=/mnt/windows” – if using the Windows 7 or 8 DVD only: this is the Windows mount path, usually /mnt/Windows or /mnt/Windows7 but check the path to make sure
- “–waik-dir=$HOME/waik” – if using the WAIK ISO only: this specifies the path to where the WAIK ISO was mounted, $HOME/waik in our case.
If you want to add some files to the bootable Windows PE image, you can use “–overlay=/path/to/some/folder“ (replace /path/to/some/folder with the path to a folder that contains the files you want included on the custom Windows PE image) – this will included all the files under /path/to/some/folder on the Windows PE image, in the root directory (under X:).
Run “man mkwinpeimg” in a terminal for more info on mkwinpeimg and all the available options.