Skip to content

Instantly share code, notes, and snippets.

@rikka0w0
Last active March 27, 2024 13:59
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save rikka0w0/987d3e03c6f133802318669e85836870 to your computer and use it in GitHub Desktop.
Save rikka0w0/987d3e03c6f133802318669e85836870 to your computer and use it in GitHub Desktop.
Boot Windows 10 and WinPE from PXE (IPXE)

Pre-requests:

  1. TFTP server
  2. IPXE Make sure ipxe.lkrn is in the TFTP root.
  3. iSCSI target (Server) Assume we have an iSCSI target "1:net.cszombie.au:windows" that is ready to be connected. 1 is LUN id, "net.cszombie.au:windows" is the target name.
  4. HTTP server (To speed up loading boot.wim, http is faster than tftp, http is supported by IPXE, however this is optional)

1. Download wimboot to the root of the TFTP server

2. Create scripts:

ipxe_shell.ipxe (run the IPXE shell)

#!ipxe
echo This is the IPXE shell! (From ipxe_shell.ipxe)
shell

ipxe_winpe.ipxe (run the Windows Installer WinPE WIM)

#!ipxe
prompt --key 0x02 --timeout 2000 Press Ctrl-B for the iPXE command line... && shell ||

set keep-san 1
sanhook iscsi:192.168.x.x:tcp:3260:1:net.cszombie.au:windows

kernel wimboot
initrd boot/bcd         BCD
initrd boot/boot.sdi    boot.sdi
initrd http://192.168.x.x:PORT/sources/boot.wim boot.wim
boot

3. Add entries in pxelinux.cfg/default (If using pxelinux)

label ipxe_shell
        menu label I^PXE Shell
        kernel ipxe.lkrn
        append dhcp && chain ipxe_shell.ipxe

label ipxe_winpe
        menu label IPXE ^WinPE
        kernel ipxe.lkrn
        append dhcp && chain ipxe_winpe.ipxe

Once WinPE is ready, hit Shift+F10 to launch the command prompt and execute "wpeutil initializenetwork" to enable the network function, so that iSCSI volumes will become visible to the installer.

File Structure:

TFTP root (Also HTTP root here)
        |- boot
        ||- bcd
        ||- boot.sdi
        |- sources
        || - boot.wim
        |- ipxe.lkrn (The IPXE binary)
        |- ipxe_shell.ipxe
        |- ipxe_winpe.ipxe
        |- wimboot

References:

  1. How to install Windows (7 or 8) thru WINPE, via PXE, onto ISCSI
  2. WAIK: Add Microsoft iSCSI service to WinPE (Win7)
  3. Over-the-network Windows 10 installation into iSCSI LUN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment