Windows PE is a lightweight version of Windows intended to be used for installation of Windows Vista and later versions of Windows, as well as for system maintenance. It runs entirely from memory and can be booted from the network.
Windows PE images are normally created in Windows using the Windows ADK. This page describes how customized Windows PE images can be created, and optionally published on the network, using an (Arch) Linux machine. This might be useful if :
- you need to install Windows from the network, or boot Windows PE from the network for system administration, using an Arch Linux-based server. This may be because you do not have a Windows-based server, or you prefer using a Linux server because of its improved security and configurability, or you are already using a Linux server for other purposes.
- you need to run a Windows environment to run Win32 programs, you do not have a Windows machine available, and you do not want to use Wine or the programs will not run correctly with Wine.
- you need to update firmware for which your device manufacturer only provides Windows binaries.
Creating a bootable Windows PE image
Obtain a Windows ISO or WAIK image
You need a copy of Windows installation media, in order to extract the
boot.wim file that contains the initial copy of Windows PE, along with some boot files. Different versions of Windows contain different versions of Windows PE. For the relationship between Windows versions and Windows PE versions, refer to Wikipedia.
The simplest method is to download the latest Windows 11 ISO.
- For a 32-bit version of Windows PE, download a Windows 10 iso, as Windows 11 has dropped support for 32-bit.
- For versions prior to Windows 8, you can download the Windows Automated Installation Kit (WAIK) image instead. See , 
- It may be possible to use httpfs to avoid downloading the entire image file.
Prepare a bootable Windows PE ISO
Mount the installation image, e.g.:
# mount --mkdir winimg.iso /media/winimg
mkwinpeimg script provided with to create a bootable Windows PE ISO :
$ mkwinpeimg --iso --windows-dir=/media/winimg winpe.iso
--overlay option to copy files into the image. You may want to do this to add additional Windows applications that you want to run in Windows PE, or to add any additional drivers that Windows PE needs. Drivers can be loaded using the
drvload command within Windows PE.
Unmount the source ISO:
# umount /media/winimg
Prepare a bootable Windows PE USB key for UEFI systems
mkwinpeimg cannot build a bootable UEFI system natively, but the necessary UEFI boot files are included in the Windows installation media and can be used by following the next steps:
/efi/boot/bootx64.efi. It is unknown whether a UEFI system would boot a x86 image of Windows this way. Please update this page if you can test.
winpe.iso file created by
mkwinpeimg, mount your USB key, and copy everything:
# mount --mkdir winpe.iso /media/winpe # mount --mkdir /dev/sdX1 /media/usb # cp -r /media/winpe/* /media/usb/
Finally, mount the original Windows ISO image and copy all boot files in
# mount winimg.iso /media/winimg # cp -r /media/winimg/efi /media/usb/
You can now umount all ISO and the USB key, your USB key is ready to boot.
Booting Windows PE
After creating a bootable ISO of Windows PE (
winpe.iso) as described in the previous section, you may want to boot Windows PE in the following ways:
In virtual machine
Run a virtual machine with
winpe.iso attached as a CD-ROM. Be sure to give it adequate memory, definitely more than the size of the ISO, since Windows PE runs from memory. See Category:Hypervisors for a list of available virtualization software.
From USB key
If you have prepared a USB key for UEFI systems according to the guide above, it should just boot. It may take some time to boot (10 to 20 seconds is not uncommon, depending on your USB key) because the loader seems to copy some/all data to RAM.
winpe.iso onto a CD, and you can boot from it.
Copy needed PXELINUX files to the TFTP server root directory.
# rsync -aq /usr/lib/syslinux/bios/ /var/tftpboot/
winpe.iso in the TFTP server root directory.
# mv winpe.iso /var/tftpboot
Create a configuration file for PXELINUX similar to the following:
UI menu.c32 MENU TITLE Network Boot TIMEOUT 50 LABEL winpe MENU LABEL Boot Windows PE from network KERNEL /memdisk INITRD winpe.iso APPEND iso raw LABEL localboot MENU LABEL Boot from local disk LOCALBOOT 0
Start the TFTP server.
Configure your DHCP server (such as Dhcpd or Dnsmasq) to point to
pxelinux.0 as the boot file, with the Linux server's IP address. Beware: if your DHCP server is on a router, it may not be possible to do this without installing custom firmware.
After completing the above steps, you should be able to boot Windows PE from the network.
winpe.iso, which may be 118MB or more and take about 30 seconds to load. Performance may be improved by using the
gpxelinux.0bootloader instead of
winpe.isousing HTTP rather than TFTP.
Installing Windows from Windows PE
Once booted into Windows PE, you can install Windows from an installation media.
The installation media can be a network share (Samba). See Samba for seting up a Samba server on another machine on the LAN. To share the installation image mounted at
/media/winimg, add the following share definition to
[REMINST] browsable = true read only = no guest ok = yes path = /media/winimg
Once booted into Windows PE command prompt, run the following command to initialize the network interface, obtain the IP of the Samba server (assuming Windows PE was booted over PXE from a machine that runs the DHCP, TFTP, and Samba server, the server IP will usually be the Gateway IP), mount the share, and launch the GUI setup:
> wpeinit > ipconfig > net use I: \\IP.ADDRESS.OF.SAMBA.SERVER\REMINST > I:\setup.exe
Tips and tricks
Update Intel Management Engine firmware
You will need to download :
- your manufacturer's Intel ME update tool
- drivers for the Intel Management Engine.
Store both extracted archives in a folder, e.g.
/vendor_files ├── me_driver └── update_tool
Proceed with #Creating a bootable Windows PE image but make sure to :
- choose a windows PE version for which your device vendor provides Intel ME drivers, i.e. 32-bit or 64-bit.
- include the device drivers and update tool with
--overlay, e.g. :
$ mkwinpeimg --iso --windows-dir=/media/winimg --overlay=vendor_files winpe.iso
Proceed with #Booting Windows PE, then load the drivers with:
X:\Windows\Systems32>cd \ X:\>drvload me_driver\...\heci.inf
Finally, update the Intel ME firmware by using the update tool.
Custom Windows PE images
Tools like Hiren's BootCD and others include Windows PE and are around half the size (~2.8GB) of a full Windows ISO. They are often fuller featured boot environments and can include Internet Explorer, which may be helpful to look up
bootrec commands to repair Windows boot manager.
Hiren's BootCd is already bootable, it only needs to be extracted to a USB.
dd bs=4M if=./HBCD_PE_x64.iso of=/dev/sdX status=progress && sync
Make sure the USB key uses a GPT partition table as described in #Prepare a bootable Windows PE USB key for UEFI systems.
System error 58 has occurred. The specified server cannot perform the requested operation
If you are getting the following error when using the
net use command:
System error 58 has occurred. The specified server cannot perform the requested operation.
1. Make sure you have not accidentally unmounted the
2. Add a
map to guest to
/etc/samba/smb.conf. Add the following at the top of the file:
[global] map to guest = Bad User ...
3. Restart the
4. Specify any username/password in the net use command:
net use I: \\IP.ADDRESS.OF.SAMBA.SERVER\REMINST /user:user pass
This is happening because Windows 10 connects to anonymous shares by checking some username and password to see if it is able to log in, and if so it allows an anonymous connection. Apparently whatever part hides this from the user did not make it into the PE build.