1 min read

How to Create a Bootable WinPE Media for UEFI Systems

If you're looking to create a bootable Windows Preinstallation Environment (WinPE) media for UEFI systems, follow these simple steps! It doesn't matter if you're a tech newbie or a seasoned pro, this guide will help you get the job done smoothly.

Step 1: Download Windows ISO Image

First, download the Windows ISO image from the official Microsoft website.

Step 2: Install Wimtools or Wimlib

Depending on your system, install the appropriate package:

  • For Debian: wimtools
  • For Arch: wimlib

Step 3: Mount the ISO File

Mount your ISO file using the following command:

$ mount --mkdir <ISO> /media/winimg

Step 4: Create a Legacy Bootable ISO

Next, create a legacy bootable ISO with this command:

$ mkwinpeimg --iso --windows-dir=/media/winimg winpe.iso

Step 5: Prepare Bootable WinPE Media for UEFI

To prepare the media for UEFI, follow these steps:

$ mount --mkdir winpe.iso /media/winpe
$ cp -r /media/winpe/* winpe_uefi
$ cp -r /media/winimg/efi winpe_uefi
$ umount /media/winimg
$ umount /media/winpe

Step 6: Create ISO (Optional)

If you wish to create an ISO (optional), use this command:

$ mkisofs \
    -no-emul-boot \
    -b "efi/microsoft/boot/efisys.bin" \
    -iso-level 4 \
    -udf \
    -joliet \
    -disable-deep-relocation \
    -omit-version-number \
    -relaxed-filenames \
    -output "winpe_uefi.iso" \
    winpe_uefi

Step 7: Create a USB Key for UEFI Systems

First, create or format the USB to have a GPT partition table with a single partition of type EFI System. Then format the partition to FAT32. After that, execute the following:

$ mount --mkdir /dev/sdXX /media/usb
$ cp -r winpe_uefi/* /media/usb

Step 8: Boot the Device

Finally, boot your device using the USB key you've created.

And there you have it! Your bootable WinPE media for UEFI systems is all set up. Happy computing! 🚀