Windows installer - cesetxeberria/pxeserver GitHub Wiki

Prepare the server

First of all we have to prepare our PXE server using one of these bootloaders

Create a new folder to store windows installation files.

mkdir -p /home/tftp/windows

Get the Windows 10 installation iso. Get the link and download it using wget. Then mount it, copy it to the newly created folder and umount it.

wget iso_url
mkdir isodir
mount Win10_1909_English_x32.iso isodir
cp -r isodir /home/tftp/windows/WinInstaller
umount isodir
rmdir isodir
rm Win10_1909_English_x32.iso

Remember to replace iso_url with the actual iso url.

Load Windows PE img using memdisk (syslinux and grub bios only)

This method is for bios clients only. There's no way to boot a Windows PE image with memdisk in uefi mode.

As root user install wimtools, cabextract and syslinux.

apt-get install wimtools cabextract syslinux

Copy memdisk to /home/tftp/windows and create a minimal Windows PE image using mkwinpeimg.

cp /usr/lib/syslinux/memdisk /home/tftp/windows/
mkwinpeimg --windows-dir=/home/tftp/windows/WinInstaller /home/tftp/windows/winpe.img

Add Windows PE memdisk image to your boot menu.

Using syslinux

nano /home/tftp/syslinux/bios/pxelinux.cfg/default

label WindowsPE
 kernel tftp/windows/memdisk  
 initrd tftp/windows/winpe.img    
 append raw

Using grub

nano /home/tftp/grub/grub.cfg

menuentry "Windows PE img" {
 linux /systems/windows/memdisk raw
 initrd /systems/windows/winpe.img
}

Load Windows PE files using wimboot

This method doesn't work with syslinux or grub in efi clients. ipxe works on both bios and efi clients.

As root user install dnsmasq and atool. atool is just a script to extract compressed files easily. Download latest wimboot release, extract it and copy it to to /home/tftp/windows.

apt-get install atool
wget http://git.ipxe.org/releases/wimboot/wimboot-latest.zip
aunpack wimboot-latest.zip
cp wimboot-2.6.0-signed/wimboot /home/tftp/windows/
rm -R wimboot-2.6.0-signed

Now copy boot/bcd, boot/boot.sdi and sources/boot.wim files.

cp /home/tftp/windows/WinInstaller/boot/bcd /home/tftp/windows/
cp /home/tftp/windows/WinInstaller/boot/boot.sdi /home/tftp/windows/
cp /home/tftp/windows/WinInstaller/sources/boot.wim /home/tftp/windows/

Add wimboot to your boot menu.

Using syslinux

nano /home/tftp/syslinux/bios/pxelinux.cfg/default

LABEL wimbootpe
 com32 linux.c32
 append tftp/windows/wimboot initrdfile=tftp/windows/bcd,tftp/windows/boot.sdi,tftp/windows/boot.wim

Using grub

nano /home/tftp/grub/grub.cfg

menuentry "Windows PE" {
 linux /systems/windows/wimboot
 initrd /systems/windows/bcd
 initrd /systems/windows/boot.sdi
 initrd /systems/windows/boot.wim
}

Using ipxe

nano /home/tftp/ipxe/default.ipxe

:winpe
kernel /systems/windows/wimboot gui
initrd /systems/windows/bcd BCD
initrd /systems/windows/boot.sdi boot.sdi
initrd /systems/windows/boot.wim boot.wim
boot ||
goto MENU