How to boot a UEFI based Windows OS via a Linux PXE server
I would like to install a Windows OS on an UEFI machine via a linux PXE server. I can install Windows OS on a legacy machine by directing it to boot to memdisk and winpe iso image. I understand the memdisk is solely for legacy based machines and cannot be used for UEFI systems.
Should I load an alternative to the memdisk boot file?.
Note: The server I'm using for deployment is not an iPXE server.
If you can use the wimboot
utility from iPXE.org, you can do it. I made such an experiment with Windows PE 3.1.
You would configure the PXE server to initially send any PXE bootloader that can load Linux kernels. Then you'd configure that to load wimboot
in place of a Linux kernel. In place of an initrd file, you would then have a cpio
archive containing the following things from Windows installation media:
- /boot/BCD
- /boot/boot.sdi
- /boot/fonts/wgl4_boot.ttf
- /sources/boot.wim
I made a small Makefile that assumes that these files are placed into ./build
subdirectory relative to the location of the Makefile itself:
all: cpio
cpio: build/BCD build/boot.sdi build/wgl4_boot.ttf build/boot.wim
cd build; /bin/ls | cpio -o -H newc > ../winpe32-3.1.cpio
mount:
wimmountrw build/boot.wim /mnt
umount:
wimunmount --commit /mnt
If you have the wimlib tools from wimlib.net you can use make mount
and make umount
to edit the contents of the boot.wim
(e.g. to add drivers or tools) before running make
or make cpio
to create the "initrd" .cpio file.
As far as I know, there is no special "iPXE server". Any PXE server can, in principle, send the iPXE bootloader to a PXE client. For the PXE server, the iPXE bootloader is just a file the server must have accessible with TFTP, in the exact path specified in the DHCP options.
If you use my "wimboot
without iPXE" idea, be warned: loading the entire boot.wim
over TFTP is slow. Sending the iPXE bootloader to the client first, and then proceeding over HTTP is much faster.