Home News How do you install Windows unattended over PXE with iPXE, wimboot and WinPE?
How do you install Windows unattended over PXE with iPXE, wimboot and WinPE?
Boot WinPE from the network with iPXE and wimboot, partition once with DiskPart, mount the full installation source over SMB, then run setup.exe with an answer file that picks the right image index. Call it done only after the first-logon handover and remote access are verified.
What does a Windows PXE installation actually involve?
Linux installers can load a kernel, an initrd and an answer file over HTTP. Windows cannot. A network-installed Windows server needs a small Windows Preinstallation Environment (WinPE) booted from the network, a full installation source it can read, and an answer file that Windows Setup accepts. In the TNTCloud PXE provisioning workflow the chain is:
- Network boot: DHCP hands the machine iPXE, and iPXE fetches a per-task boot script.
- WinPE boot: iPXE loads
wimboot, which boots WinPE (boot.wim) straight from RAM. - Preparation in WinPE: a deploy script downloads the answer file and the partition script for this machine and firmware type, then runs DiskPart.
- Installation: WinPE mounts the installation source over SMB and runs
setup.exe /unattend. - Handover: after first logon, an init program configures networking, sets the final password and reports success.
Each stage fails differently, so diagnose them separately. For the service side (DHCP, TFTP, HTTP, SMB), see our PXE server software overview.
1. Boot WinPE with iPXE and wimboot
wimboot is a small boot loader that lets iPXE start a Windows boot manager and WinPE without a Windows Deployment Services server. The boot script selects bootmgr.efi for UEFI and bootmgr for legacy BIOS:
#!ipxe
set base_url http://pxe.example.internal
iseq ${platform} efi && set bootfile bootmgr.efi || set bootfile bootmgr
kernel ${base_url}/downloads/wimboot
initrd ${base_url}/images/winPE/${bootfile} ${bootfile}
initrd ${base_url}/images/winPE/BCD BCD
initrd ${base_url}/images/winPE/boot.sdi boot.sdi
initrd ${base_url}/images/winPE/boot.wim boot.wim
boot
Before blaming the network or the firmware, check every file the script loads. In one of our lab runs WinPE never started: the CPU sat at 100% for minutes with no DHCP request and no disk writes. The cause was that wimboot on the server was a 9 KB HTML 404 page saved under the right name, and iPXE tried to run it as a kernel. Verify the type and checksum of the boot files whenever you copy them:
file downloads/wimboot # must be a PE32+/MZ binary, not "HTML document"
sha256sum downloads/wimboot images/winPE/*
2. Partition with DiskPart, not twice
Inside WinPE, startnet.cmd runs a deploy script. It works out whether the machine booted in UEFI or BIOS mode, downloads a DiskPart script made for that firmware, and applies it. A simplified version:
wpeinit
curl -o X:\autounattend.xml http://pxe.example.internal/osinstall/<mac>/unattend?firmware=uefi
curl -o X:\format.txt http://pxe.example.internal/osinstall/<mac>/format?firmware=uefi
diskpart /s X:\format.txt
net use Z: \\pxe.example.internal\public\win2022
Z:\setup.exe /unattend:X:\autounattend.xml
Two rules prevent most data-loss and "no usable free extent" problems:
- Partition in one place only. If DiskPart has already built the layout, the answer file must not contain
DiskConfiguration,WillWipeDisk,CreatePartitionsorModifyPartitions. Otherwise Windows Setup repartitions after DiskPart. Our server rejects answer files that contain these elements. - Never wipe a disk because detection failed. During a reinstall, format only the verified system partition and keep data partitions such as D:. If the layout can't be identified, or it doesn't match the firmware mode, stop and ask the operator, rather than running
clean. Wipe the whole disk only when it is explicitly requested, or when the disk is confirmed empty.
Size the system partition for the edition. Our standard layout gives C: 60 GiB and puts the rest into a data partition. A UEFI disk also keeps an EFI system partition and an MSR.
3. Serve the full installation source over SMB
setup.exe needs the complete installation tree (setup.exe, sources/, boot/ and the rest), not just install.wim. Mounting the ISO read-only and sharing it is enough. There is no need to unpack it a second time.
- Open TCP 445 from the provisioning network to the PXE server. A symptom we hit:
net usefailed in WinPE while the SMB server logged no connection at all. The host firewall was dropping 445 before the SMB server saw it. - Keep the share read-only and limited to the provisioning network. Guest access is convenient for WinPE, but don't expose it beyond that network.
- If the share root is a directory of symlinks, check that the SMB server follows them. Mounting each ISO directly under the share root avoids the problem.
4. Pick the right image index in the answer file
Many ISOs contain several editions in one install.wim. The answer file chooses one by index:
<ImageInstall>
<OSImage>
<InstallFrom>
<MetaData wcm:action="add">
<Key>/IMAGE/INDEX</Key>
<Value>2</Value>
</MetaData>
</InstallFrom>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>3</PartitionID>
</InstallTo>
</OSImage>
</ImageInstall>
List the images before writing the value, and don't reuse an index from another ISO:
wimlib-imagex info sources/install.wim
Two examples from our tests: a Windows 7 SP1 multi-edition ISO keeps Professional at index 3, while a Windows 11 Enterprise Evaluation ISO has only index 1. An evaluation edition also needs no ProductKey. Leave one in for the wrong edition and Setup stops.
5. Windows 11 hardware checks on servers and VMs
Windows 11 Setup checks for TPM 2.0 and Secure Boot. On test VMs and older servers without them, Setup stops at the system requirements page. In a lab, WinPE can write the LabConfig values before Setup starts:
reg add HKLM\SYSTEM\Setup\LabConfig /v BypassTPMCheck /t REG_DWORD /d 1 /f
reg add HKLM\SYSTEM\Setup\LabConfig /v BypassSecureBootCheck /t REG_DWORD /d 1 /f
Microsoft does not support this on hardware that doesn't meet the requirements. Use it only where your licensing and support policies allow, and prefer enabling a real TPM and Secure Boot on production hosts.
6. Finish the handover after first logon
The answer file can only set an initial password and run commands. A first-logon command (FirstLogonCommands) starts an init program that sets the static IP, replaces the temporary Administrator password with the real one and reports back to the server. Don't call the task done until these checks pass:
- The server has received the final success callback.
- Remote access works with the delivered credentials (for example RDP on 3389). A real login is the test. In our tests some RDP clients' "auth-only" exit codes were unreliable.
- Data partitions are intact after a reinstall: compare a sentinel file's hash from before and after.
- Passwords don't appear in installer, init or server logs.
Troubleshooting by symptom
- Stuck after iPXE, no WinPE screen: a corrupt or wrong
wimboot, BCD orboot.wim, or BIOS/UEFI boot files swapped. - WinPE starts, but nothing happens: WinPE has no driver for the network card, or the deploy script failed to download.
net usefails: port 445 is blocked, the share path is wrong, or the symlink isn't followed.- "No usable free extent": the disk is smaller than the partition script expects.
- Setup asks questions: the edition index or product key is wrong, or the answer file wasn't loaded.
Questions worth asking first
Do I need Windows Deployment Services (WDS) to PXE-install Windows?
No. iPXE with wimboot can boot WinPE over HTTP, and WinPE can run setup.exe from an SMB share.
Is install.wim alone enough for a network install?
Not for a setup.exe-based install. Setup needs the complete installation tree, so share the mounted ISO read-only.
Why does Windows Setup ask questions despite an answer file?
Usually the image index or product key doesn't match the ISO, or the answer file was never loaded. List the images in install.wim and check which file Setup used.
Should the answer file partition the disk?
Not if DiskPart already did. Partition in one place only; a DiskConfiguration section in the answer file can repartition the disk after DiskPart.
Why does WinPE never appear after iPXE?
Check the boot files first. A wimboot file that is actually an HTML error page, or BIOS and UEFI boot files swapped, causes exactly this.