1

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.

  • There is no specific "PXE server" software, it is all a combination of different services. The question is which PXE loader you are using in the legacy case, PXELINUX? The DHCP server need to be configured to give valid efi binaries for EFI boot, and in this case, sending out iPXE for EFI and then using wimboot is probably your best option. (actually wimboot is your best option over all) – NiKiZe Jul 16 '21 at 06:18

1 Answers1

1

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.

telcoM
  • 4,448
  • 15
  • 25
  • I tried this method. When I select the Windows entry in my PXE menu I see output similar to linux, i.e, "Trying to allocate 12 pages for vmlinuz". Then the server goes for a reboot. Here is the windows content in the efidefault file. title Windows 2012 R2 Manual Install root (nd) kernel /wimboot initrd /winpe32-3.1.cpio The wimboot and cpio files are in the /var/lib/tftpboot directory. Am I missing something in the configuration? – Venkata Chalapathy Jun 06 '18 at 08:25
  • You said "efidefault file". I'm a bit uncertain what should be using that. Exactly what software are you using as the initial PXE bootloader, i.e. what is the file your DHCP boot options tell the PXE firmware to download first? – telcoM Jun 06 '18 at 09:51
  • The first file PXE firmware downloads is the BOOTX64.efi. Here are the contents of the dhcpd file instructing which file to download based on the client architecture. if option arch = 00:06 { filename "/bootia32.efi"; } else if option arch = 00:07 { filename "/BOOTX64.efi"; } else if option arch = 00:0b { filename "/bootaa64.efi"; } else { filename = "/pxelinux.0"; – Venkata Chalapathy Jun 07 '18 at 03:25
  • So, is that an UEFI version of PXELINUX bootloader, then? Or is it some different UEFI bootloader? I did my testing with the iPXE bootloader and a UEFI network capable version of GRUB, so I don't know your specific case so well... it might be some interaction between the bootloader and the wimboot binary that causes something to go wrong and trigger a reboot. – telcoM Jun 07 '18 at 05:37
  • Yes. I had used the same one when I was deploying Linux Operating systems on my clients. The weird thing is that I don't see an entry like "Loading wimboot......ok" while booting the Windows OS. I see something similar to Linux "Trying to allocate 12 pages for vmlinuz". – Venkata Chalapathy Jun 07 '18 at 10:13
  • The PXELINUX bootloader will download a configuration file that will tell it which files to download. It will generate the name of the first configuration file it attempts to download based on the MAC address of the client system. If such a file is not available, it will remove one digit from the end of the name and try again. If this produces no results, it will finally try a file named `default`. Perhaps this process is causing it to download a different configuration file than the one you expect? – telcoM Jun 07 '18 at 12:26
  • wimboot does not read/use the cpio format in EFI mode. But one great thing with recent wimboot is that you don't really need any of the additional files any more (as long as they are embedded in the .wim) so wimboot boot.wim might do the trick. – NiKiZe Jul 16 '21 at 06:20