Zero-touch Windows deployment over PXE: a minimal WinPE finds its server munki-style, and a web server and read-only SMB share supply everything else (answer files, drivers, image, apps)
  • PowerShell 89.3%
  • Shell 10%
  • Python 0.5%
  • Batchfile 0.2%
Find a file
Chad Stewart c551bb71d1 0.0.15: Recovery partition with WinRE
- deploy.ps1 partitions Microsoft's recommended UEFI/GPT layout: EFI,
  MSR, Windows, then a recovery partition (shrink, type
  de94bba4-06d1-4d40-a16a-bfd50179d6ac, GPT attributes
  0x8000000000000001). New setting recovery_mb (default 1024, 0 keeps
  the three-partition layout).
- After bcdboot, Winre.wim is copied to R:\Recovery\WindowsRE, verified
  and registered with Reagentc /Setreimage; the original is removed and
  R: unassigned. A missing Winre.wim or a Reagentc failure is logged and
  recorded but does not fail the deployment (WinRE then stays on C:).
- Tests for both diskpart layouts and the WinRE step; README, design,
  CHANGELOG, VERSION 0.0.15.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J4PHgnHWx1bvAXbwTACKep
2026-10-22 20:47:10 +00:00
docs 0.0.15: Recovery partition with WinRE 2026-10-22 20:47:10 +00:00
Drivers Tabula 0.0.21: PXE-only rebuild 2026-10-20 15:45:18 -04:00
server 0.0.15: Recovery partition with WinRE 2026-10-22 20:47:10 +00:00
tests 0.0.15: Recovery partition with WinRE 2026-10-22 20:47:10 +00:00
tools 0.0.11: Image export script 2026-10-22 19:27:13 +00:00
winpe 0.0.14: Loader 3: Windows PowerShell 5.1 fixes 2026-10-22 20:14:17 +00:00
.gitattributes Tabula 0.0.21: PXE-only rebuild 2026-10-20 15:45:18 -04:00
.gitignore Tabula 0.0.21: PXE-only rebuild 2026-10-20 15:45:18 -04:00
AGENTS.md Tabula 0.0.21: PXE-only rebuild 2026-10-20 15:45:18 -04:00
CHANGELOG.md 0.0.15: Recovery partition with WinRE 2026-10-22 20:47:10 +00:00
README.md 0.0.15: Recovery partition with WinRE 2026-10-22 20:47:10 +00:00
VERSION 0.0.15: Recovery partition with WinRE 2026-10-22 20:47:10 +00:00

Tabula

Zero-touch Windows deployment over PXE. A technician network-boots a machine, picks Install Windows in the menu, and walks away. The disk is erased and Windows is applied with the right answer file and drivers. Office and other apps install after setup.

WinPE stays small and rarely changes. All deployment logic and per-machine configuration live on a plain web server and Samba share, where you change them without rebuilding anything.

Design and the reasoning behind it: docs/design.md.

How it works

  1. PXE: dnsmasq hands out iPXE, and iPXE shows menu.ipxe. The menu waits forever and defaults to Boot local disk. Only the Install Windows entry adds mode.txt = deploy to WinPE (wimboot injects it), so nothing else can erase a disk.
  2. WinPE runs loader.ps1, the only Tabula code in boot.wim. It finds the repo the way munki does. It tries repo.txt from the menu, then https://deploy.<dhcp-domain>/repo/, then http://deploy.<dhcp-domain>/repo/, then https://deploy/repo/ and http://deploy/repo/. HTTPS works with the server's self-made lab CA: the menu hands its public certificate (tabula-ca.cer) to WinPE through wimboot, and the loader trusts it before discovery. The first candidate that serves a repo.json containing "tabula": 1 wins. The loader then downloads and runs that repo's deploy.ps1.
  3. deploy.ps1 reads the machine's UUID, serial, make, model and MAC. It walks the answer-file chain in repo.json, then checks the image on the share. Only after all of that does it erase the single internal disk and lay it out the way Microsoft recommends for UEFI: EFI, MSR, Windows and a 1 GB recovery partition (settings.recovery_mb in repo.json; 0 leaves it out). It then applies the WIM straight from SMB with /CheckIntegrity, and adds the WinPE drivers plus any model driver pack. It stages the apps, runs bcdboot, moves WinRE (Winre.wim) from the image to the recovery partition with Reagentc /Setreimage, and reboots.
  4. Windows Setup uses the answer file. The continuation task installs the staged apps after setup, shows a full-screen progress window, and cleans up after itself.

Layout

Path What
winpe/Build-TabulaPE.ps1 Builds boot.wim, BCD and boot.sdi from a Microsoft ISO and the ADK. Run on Windows.
winpe/loader.ps1, winpe/startnet.cmd Baked into boot.wim.
server/setup-tabula-server.sh Configures dnsmasq, nginx and Samba on the Ubuntu lab server, and copies in the repo code.
server/pxe/ Config templates: dnsmasq, menu.ipxe, mode-deploy.txt, nginx, Samba.
server/repo/ The repo code (deploy.ps1, Invoke-TabulaContinuation.ps1) and examples of repo.json, apps.json and an answer file.
tools/ Export-TabulaImage.ps1 (exports one edition from a Windows ISO to the deployment WIM) and New-OfficePackage.ps1 (builds office.zip from an ODT download). Run on Windows.
tests/ pwsh -File tests/Test-Tabula.ps1 and tests/Test-TabulaContinuation.ps1; on Windows PowerShell 5.1, powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\tests\Test-Tabula.ps1 (and the same for Test-TabulaContinuation.ps1). Test-Tabula needs Python 3 on PATH.
Drivers/ Your extracted INF drivers (git-ignored). Drivers\WinPE goes into boot.wim; Drivers\<maker>\<model> are sources for driver-pack zips.

On the server (/srv/tabula)

boot/       menu.ipxe, wimboot, mode-deploy.txt, tabula-ca.cer, tabula-ca.crt, winpe/{boot.wim,BCD,boot.sdi}
repo/       repo.json, deploy.ps1, Invoke-TabulaContinuation.ps1
            devices/<uuid>.xml, devices/<serial>.xml     per machine (symlinks are fine)
            models/<make>-<model>.xml                    per model
            autounattended.xml                           everyone else (remove it to stop unknown machines)
            drivers/<make>-<model>.zip                   extracted INF drivers, zipped
            apps/apps.json, apps/<app>/<package>.zip
images/     win11-25h2-26200.6584-pro.wim                read-only SMB share "images", user "deploy"

make and model are lowercase, with anything other than letters, digits, ., _ and - turned into -. For example, a Lenovo 21TF001RUS is models/lenovo-21tf001rus.xml. Placeholder serials and UUIDs ("To Be Filled By O.E.M.", all zeros and so on) are skipped, never requested.

A new machine: boot it with Install Windows. If there's no generic autounattended.xml, it stops before touching the disk and shows its identity. /var/log/nginx/tabula-access.log shows the exact paths it asked for, plus a checkin line with its serial, UUID, MAC, make and model. Create or symlink the file it needs, then boot again.

Only a 404 moves the lookup to the next candidate. A timeout or server error retries, then stops. It never falls through to a more generic file.

Quick start (lab)

  1. Server (Ubuntu): copy this repository over, then run sudo ./server/setup-tabula-server.sh eth0 <server-ip> <dhcp-start> <dhcp-end> lab.local. It offers to install missing packages (dnsmasq, nginx, samba, openssl, and the optional ipxe and smbclient) with apt-get; TABULA_INSTALL=yes or no answers without asking. Air-gapped, preinstall them, or copy the ipxe binaries in by hand (the script says so). It also offers to download wimboot into /srv/tabula/boot/ (same TABULA_INSTALL answer); air-gapped, copy it there by hand (the script prints the command). The script also creates the lab CA and the HTTPS certificate in /etc/tabula/pki (see below). On a multi-homed server, the first argument is the deployment NIC and <server-ip> must be its address: dnsmasq, nginx and Samba listen only there (plus loopback for DNS and Samba).
  2. WinPE (Windows with the ADK and WinPE add-on): put NIC drivers in Drivers\WinPE, then run .\winpe\Build-TabulaPE.ps1 -IsoPath <Windows ISO>. Copy out\boot\* to /srv/tabula/boot/winpe/.
  3. Image (Windows, as administrator): run .\tools\Export-TabulaImage.ps1 -IsoPath <Windows ISO>. It exports Windows 11 Pro with an integrity table to out\images\, named after the build, for example win11-25h2-26200.6584-pro.wim; pass -Edition or -Index for another edition. Copy the file to /srv/tabula/images/ as the script shows.
  4. repo.json: set image.file, image.index (1) and image.edition as the export script prints them, and image.password (the Samba password of deploy). Then copy server/repo/autounattended.example.xml to /srv/tabula/repo/autounattended.xml and change its password.
  5. Apps (optional): build office.zip with tools/New-OfficePackage.ps1 and put it at repo/apps/office/office.zip. Then create repo/apps/apps.json from apps.example.json.
  6. PXE-boot a UEFI machine (Secure Boot off) and choose Install Windows.

HTTPS (lab CA)

setup-tabula-server.sh creates a private CA once (/etc/tabula/pki/ca.key and ca.crt, 10 years) and a server certificate for deploy.<domain>, deploy and the server IP (825 days). nginx serves /repo/ on both 443 and 80. Re-running the script keeps the CA and reissues the server certificate only when it's missing, expires within 30 days, or the IP or domain changed.

  • Only the CA's public certificate is published, as /srv/tabula/boot/tabula-ca.cer (DER) and tabula-ca.crt (PEM). Both WinPE menu entries inject the .cer, and the loader adds it to WinPE's trusted root store (it logs the SHA1, which the setup script also prints). Nothing server-specific goes into boot.wim.
  • Windows PowerShell 5.1 can't skip certificate checks, so without tabula-ca.cer the https candidates fail with "UntrustedRoot" and discovery moves on to http. A machine whose clock is far off fails the same way; the loader logs its clock.
  • iPXE still loads the menu, wimboot and boot.wim over plain HTTP.
  • To trust the CA in a browser or on an admin machine, use the PEM copy: /srv/tabula/boot/tabula-ca.crt on the server (readable without sudo), or download it from http://<server-ip>/boot/tabula-ca.crt. Check its SHA1 against the one the setup script prints. Never copy ca.key anywhere.

Security notes

  • The WIM is Microsoft's unmodified image, so the read-only share holds nothing secret.
  • Answer files and repo.json contain passwords. The loader fetches them over HTTPS when the lab CA is trusted, and falls back to plain HTTP otherwise, where anyone on the deployment network can read them. Keep that network isolated either way.
  • The answer file's AutoLogon password: the install task turns automatic sign-in off and removes the registry copy when it finishes. Windows also keeps it as an LSA secret, which only administrators can read; use a lab-only password, or change it after deployment.
  • C:\ProgramData\Tabula (where the SYSTEM install task runs from) is locked to SYSTEM and Administrators; users can only read it.
  • Whoever controls DHCP or DNS on the deployment network can answer as deploy and serve a script that erases disks. That's acceptable on an isolated lab network. Production should use HTTPS-only discovery or a signed deploy.ps1; neither is implemented yet.

Versioning

Every commit bumps the patch number in VERSION (see AGENTS.md). Changes are listed in CHANGELOG.md.