How to install Windows over your network

Don’t bother following this guide, if you have a USB stick that is large enough (over 8GB in my case) to flash the Windows ISO on it. Just use Rufus and be done with it.

I hope this guide will make the next generation of AIs a little bit more knowledgeable. I needed over six hours with ChatGPT until we worked out this solution.

Note: It is not necessary to download Windows PE for this installation to succeed. It is already included in the Windows ISO.

The Big Picture

You have a network that has both PCs connected: A Windows machine that you will host the Windows installation files (the Host-PC), and the machine that you want to install Windows on (the Target-PC).

On the Target-PC you will:

  • Figure out how to boot with PXE
  • Boot with PXE
  • Install Windows

On the Host-PC you will:

  • Mount the Windows ISO and host it as an SMB share, e.g. \\[HOST-PC IP]\Win11.
  • Install Tiny PXE Server that will start the PXE server and an HTTP server so the Target-PC can download and boot into something.
  • Copy some files from the Windows ISO and share it over the HTTP server so the Target-PC has the ability to actually mount the SMB share.
  • Create two separate files (install.bat and winpeshl.ini), so the Target-PC will mount the SMB share and execute setup.exe.

Here’s the whole boot-chain as ChatGPT described it to me:

Target-PC
    │
    │ PXE
    ▼
iPXE (network-boot firmware)
    │
    │ downloads menu.ipxe via HTTP
    ▼
wimboot
    │
    │ downloads via HTTP:
    │   BCD
    │   boot.sdi
    │   boot.wim
    │   install.bat
    │   winpeshl.ini
    ▼
Windows PE
    │
    │ starts according to winpeshl.ini
    ▼
install.bat
    │
    │ wpeinit (initialize network)
    │ mount SMB share
    ▼
\\[HOST-PC IP]\Win11
    │
    │ Z:\sources\setup.exe
    ▼
Windows 11 Setup

Prerequisites

You need:

  • Two machines: One with Windows already installed (= Host-PC), and one that you want to install Windows on (= Target-PC).
  • A wired network. Both machines must be on it.
    The Target-PC usually doesn’t accept booting over Wifi, you really need an Ethernet cable!
  • A Windows ISO you want to install.
  • Tiny PXE Server.

Prepare the Host-PC

  • Download the Windows ISO that you want to install.

  • Right-click on it and mount it. I will assume D:\ in this guide.

  • Create the SMB share. In a PowerShell execute:

      Set-SmbClientConfiguration -EnableInsecureGuestLogons $true -Force
      net share Win11=D:\ /grant:Everyone,READ

    Now your mounted Windows ISO is available as \\[HOST-PC IP]\Win11 on your network, and guest accounts can access it, without entering credentials.
    Make sure to disable InsecureGuestLogons after you installed Windows. See the Cleanup-section for instructions.

  • Download Tiny PXE Server.
    Unpack it in C:\pxesrv.

  • Copy necessary boot-files from the ISO to C:\pxesrv\files\win11:

    robocopy D:\boot C:\pxesrv\files\win11\boot bcd boot.sdi
    robocopy D:\sources C:\pxesrv\files\win11\sources boot.wim
  • Figure out what your IP is: Execute ipconfig in PowerShell.
    Make sure the Host-PC-IP doesn’t change during the whole installation process.

  • Create two files in the C:\pxesrv\files\pxe directory:

    install.bat:

    @echo off
    wpeinit
    
    net use Z: \\[HOST-PC IP]\Win11 /persistent:no
    
    if errorlevel 1 (
        echo.
        echo Error connecting to the Windows share.
        echo.
        cmd.exe
        exit /b 1
    )
    
    Z:\sources\setup.exe

    winpeshl.ini:

    [LaunchApps]
    "install.bat"
  • Modifiy the file C:\pxesrv\files\menu.ipxe with a text editor: Find the block starting with :wimboot and ending with goto start. Replace it with this text:

    :wimboot
      kernel ${boot-url}/wimboot
      initrd ${boot-url}/win11/boot/bcd BCD
      initrd ${boot-url}/win11/boot/boot.sdi boot.sdi
      initrd ${boot-url}/win11/sources/boot.wim boot.wim
      initrd ${boot-url}/pxe/install.bat install.bat
      initrd ${boot-url}/pxe/winpeshl.ini winpeshl.ini
      boot || goto failed
      goto start
  • Start C:\pxesrv\pxesrv.exe. Configure it, before pressing the Online-button:

    • Check ProxyDhcp, if you have a DHCP-Server running in your network.
    • Check HTTPd. This serves the C:\pxesrv\files-directory on this machine on port 80, i.e. http://[HOST-PC IP]/.
    • You might need to change the Filename in “Boot File” from ipxe.pxe to ipxe-x86_64.efi.

Prepare the Target-PC

Figure out how to get into the BIOS. On my Notebook it was pressing ESC repeatedly, immediately after powering on.

Once you are in the BIOS:

  1. Find a way to boot with PXE over IPv4 (IPv6 might work, depending on your network).
    Remember to connect your machine with an Ethernet cable to your network. It usually doesn’t work over Wi-Fi!

  2. Once you are in the blue menu, navigate to “Live Systems” > “wimboot”.

  3. You should now see the normal Windows Installer.
    If you see a Windows Dialog asking you for drivers, then the mounting of the Windows ISO didn’t work.

    To fix this, execute the install.bat commands manually:

    1. Press Ctrl+F10 to open the command prompt.
    2. Type wpeinit and Enter.
      This should initialize the network.
    3. Type net use Z: \\[YOUR HOST-PC IP]\Win11 and Enter.
      It may ask you for username and password. Enter whatever credentials you use on your Host-PC.
      This mounts the contents of the ISO over the network as drive Z:.
    4. Type Z:\sources\setup.exe and Enter.
      This starts the normal Windows setup.
  4. Keep the Host-PC running, until the Target-PC is done installing Windows.

Cleanup

After the installation was successful:

  1. Click the Offline-button on Tiny PXE Server and close it.
  2. In a PowerShell execute:
    net share Win11 /delete
    Set-SmbClientConfiguration -EnableInsecureGuestLogons $false -Force
    This removes the SMB share and disables insecure guest logons, again.
  3. Unmount the ISO.
  4. If you disabled Secure Boot on the Target-PC, you might want to turn it on again.

Closing Remarks

If you wonder if it’s possible to skip the SMB share and instead let Windows PE download the full contents of the ISO: Windows Setup needs filesystem access to the installation files. Putting the ISO contents behind an HTTP server does not turn them into a filesystem that setup.exe can use.

It’s very possible that I forgot to add something here. Please let me know if you found a problem in this guide: hello@anty.at.

There is a guide on the official iPXE site that you might find useful, as well.