MKWINPEIMG(1)

✨ MKWINPEIMG(1) ✨

okay so bestie, you're reading the manual page for mkwinpeimg β€” that's a User Command, and it lives in the wimlib family of tools. grab a snack, this one's a whole vibe πŸŽ€


🌸 NAME 🌸

mkwinpeimg β€” Make a customized bootable image of Windows PE πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

mkwinpeimg [OPTIONS] IMAGE

πŸ’– DESCRIPTION πŸ’–

so basically, mkwinpeimg can make a bootable image of Windows PE by taking files from a mounted Windows installation ISO image (Vista or later), or from the mounted ISO image for the Windows Automated Installation Kit (WAIK) or the WAIK supplement. The --windows-dir and --waik-dir options are how you tell it where those mounted ISOs are chilling. You only need one or the other, not both, ok?

The files that mkwinpeimg will retrieve are boot.wim, bootmgr, boot.sdi, and bcd. And if you're making an ISO image, the file etfsboot.com gets retrieved too. ✨ Microsoft owns the rights to these files and they are not distributed with wimlib. just so we're clear πŸ’€

mkwinpeimg can make two types of bootable images:

  • The default is to make a bootable disk image. This image is not partitioned and is formatted into a FAT filesystem. syslinux(1) is required to make this type of image, because it's used to chainload bootmgr. Also, mtools(1) is required so that the FAT filesystem can be created without root privileges. no root, no problem 🫢
  • The other type is a bootable ISO image. To make this one, give the --iso option. mkisofs(1) is required for this. And in --iso mode you can specify IMAGE as - to write the ISO image to standard output. iconic. πŸ‘‘

If you make a disk image, you could put it on a USB drive, and if you make an ISO image, you could put it on a CD. In addition, both types of images can be loaded by the SYSLINUX or PXELINUX bootloaders using the MEMDISK module. slay πŸ’…

Windows PE itself is contained in the boot.wim file. mkwinpeimg can modify this file before embedding it in a bootable image. The most useful modification is to specify an executable or batch file for Windows PE to execute as soon as it starts up β€” use the --start-script FILE option to specify such a file. You may also add arbitrary files to boot.wim by putting them in a directory, then specifying the --overlay DIR option. However, for more extensive modifications, consider modifying the boot.wim file separately using wimmountrw(1) or wimupdate(1), then providing it to mkwinpeimg using the --wim option. iykyk ✨

mkwinpeimg can also make only a modified boot.wim, rather than a bootable ISO or disk image, if the --only-wim option is given.


πŸ’… OPTIONS πŸ’…

  • -i, --iso β€” Make an ISO image instead of a disk image. πŸŽ€
  • -o, --only-wim β€” Make neither a disk image nor an ISO image; instead, only make a modified boot.wim file.
  • -W, --windows-dir=DIR β€” Use DIR as the location of the mounted Windows installation ISO image. If neither --windows-dir nor --waik-dir is specified, then the script looks for the mounted ISO in the following default locations: /mnt/windows, /mnt/windows7, /mnt/windows8, and /mnt/windows10. it goes looking for you, bestie πŸ•΅οΈβ™€οΈ
  • -A, --waik-dir=DIR β€” Get the boot files and boot.wim from the ISO of the Windows Automated Installation Kit mounted on DIR instead of from a Windows installation ISO. This also works if the mounted ISO is for the WAIK supplement rather than the WAIK itself. πŸ’œ
  • -s, --start-script=FILE β€” Add FILE to the root directory of Windows PE image and adjust \Windows\System32\winpeshl.ini to execute FILE when Windows PE starts up. main character energy fr fr πŸ”₯
  • -w, --wim=WIM β€” Use WIM as the "boot.wim" file. This defaults to the appropriate WIM file from the Windows ISO, WAIK, or WAIK supplement.
  • -O, --overlay=DIR β€” Adds all the files in DIR to the Windows PE image. πŸ“
  • -t, --tmp-dir=DIR β€” Use DIR for temporary files. Defaults to a directory made using "mktemp -d".
  • -a, --arch=ARCH β€” Use the Windows PE version from the Windows Automated Installation Kit (or the WAIK supplement) that has the CPU architecture ARCH. Only valid with --waik-dir. Possible values: "x86" or "amd64". Default is "x86". Note: the WAIK also contains a Windows PE image for the ia64 (Itanium) architecture; however, this is not supported by this script. 🧚
  • -h, --help β€” Display help. we love a helpful king 🫢
  • -v, --version β€” Show version information. ✨

🌈 EXAMPLES 🌈

Create a bootable disk image of Windows PE from the Windows (Vista or later) installation media mounted on /media/windows:

mkwinpeimg --windows-dir=/media/windows winpe.img

Create a bootable ISO of Windows PE from the WAIK (or WAIK supplement) mounted on /media/waik, and add all the files in "winpe_overlay" to Windows PE's filesystem:

mkwinpeimg --iso --waik-dir=/media/waik --overlay=winpe_overlay winpe.iso

Create a bootable image of Windows PE from the Windows installation media mounted on /media/windows, add and make it execute "install.cmd" when it starts up. In this example the image is created in the root directory of the TFTP server for network booting.

mkwinpeimg --start-script=install.cmd --windows-dir=/media/windows /var/tftpboot/winpe.img

πŸŽ€ NOTES πŸŽ€

Microsoft's licenses may limit the things that Windows PE can be used for, and they may limit your rights to redistribute customized versions of Windows PE. read the fine print bestie, no cap 😭

😭 REPORTING BUGS 😭

Report bugs to https://wimlib.net/forums/. they wanna hear from you πŸ’–


πŸ‘‘ SEE ALSO πŸ‘‘

wimlib-imagex(1)


and that's the whole page!! this was wimlib 1.14.5, from January 2026 β€” thanks for reading, ily, go make a Windows PE image πŸ¦‹βœ¨πŸ’…

πŸ“¦ where this page comes from