Skip to content

Instantly share code, notes, and snippets.

@gushmazuko
Forked from rikka0w0/pxe_win10_winpe.md
Created March 19, 2021 08:55
Show Gist options
  • Save gushmazuko/2cdf526e2b2a043a309b7a9a6cc63457 to your computer and use it in GitHub Desktop.
Save gushmazuko/2cdf526e2b2a043a309b7a9a6cc63457 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