Win11 Unattended ISO Builder

Builds a minimal Windows 11 ISO: no Microsoft account, no Copilot, no Edge, no bloatware. Install a browser manually after setup. Future updates may reintroduce bloat, but you can rebuild anytime to stay clean.

autounattend.xml is fetched from UnattendedWinstall at build time.

TL;DR

Prerequisites

Warning: existing output ISO and local autounattend.xml are deleted before each run. The downloaded autounattend.xml is removed after completion.

You must manually download a Windows 11 ISO from Microsoft.

This project supports three build environments and their respective tools need to be installed:

  • Running script native (Linux/WSL): bash, curl, p7zip-full, xorriso
  • Running script native (Windows PowerShell): oscdimg (Windows ADK Deployment Tools). 7z is optional.
  • Docker: Docker only (all tools included; recommended for consistency, though native PowerShell is simpler on Windows)

Install Windows ADK Deployment Tools (oscdimg)

  1. Download ADK: https://go.microsoft.com/fwlink/?linkid=2337875
  2. Run adksetup.exe.
  3. Select only Deployment Tools.
  4. Install.
  5. Add oscdimg to PATH:
$adkBin = "${env:ProgramFiles(x86)}\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg"
[System.Environment]::SetEnvironmentVariable('PATH', "$env:PATH;$adkBin", 'User')
  1. Restart PowerShell and verify:
oscdimg /?

Usage

⚠️Note on all samples below⚠️

In my environment, I have a folder C:\MV-ISO that I use for all my ISO files (WSL paths: /mnt/c/MV-ISO). Adjust paths as needed for your environment.

Native Bash

bash build-winiso.sh <input_iso> <output_iso>

Example:

bash build-winiso.sh /mnt/c/MV-ISO/win11.iso /mnt/c/MV-ISO/win11-min.iso

Native PowerShell

git pwsh ./build-winiso.ps1 <input_iso> <output_iso>

Example:

pwsh ./build-winiso.ps1 C:\MV-ISO\win11.iso C:\MV-ISO\win11-min.iso

Docker (Bash)

docker build -t win11-unattend-iso .
docker run --rm -v /mnt/c/MV-ISO:/mnt/c/MV-ISO win11-unattend-iso /mnt/c/MV-ISO/win11.iso /mnt/c/MV-ISO/win11-min.iso

Docker (PowerShell)

Note: The PowerShell Dockerfile uses a Linux-based image, so use Linux-style paths (/mnt/c/...) even when running from a Windows host.

docker build -f Dockerfile.pwsh -t win11-unattend-iso-pwsh .
docker run --rm -v C:\MV-ISO:/mnt/c/MV-ISO win11-unattend-iso-pwsh /mnt/c/MV-ISO/win11.iso /mnt/c/MV-ISO/win11-min.iso

Compare Two ISOs

File-level diff between two ISOs — useful for verifying payload files are present and spotting unexpected path differences. Does not compare file contents or metadata.

bash compare-isos.sh <iso_a> <iso_b> [report_file]

Example:

bash compare-isos.sh /mnt/c/MV-ISO/win11.iso /mnt/c/MV-ISO/win11-min.iso /mnt/c/MV-ISO/iso-diff.txt

Docker Compare

docker build -f Dockerfile.compare -t win11-iso-compare .
docker run --rm -v /mnt/c/MV-ISO:/mnt/c/MV-ISO win11-iso-compare /mnt/c/MV-ISO/win11.iso /mnt/c/MV-ISO/win11-min.iso /mnt/c/MV-ISO/iso-diff.txt

Troubleshooting

Different ISO sizes between Linux and PowerShell outputs

Different ISO sizes do not always mean different payload files. ISO metadata/layout can vary by builder.

Use compare-isos.sh for file-level checks.

Why oscdimg uses -h in PowerShell build

Without -h, hidden files can be dropped on Windows builds (observed: sources/ws.dat).

The PowerShell script includes -h to preserve hidden files.

Expected remaining differences between xorriso and oscdimg

After fixing hidden-file handling, remaining differences can be builder-specific boot metadata entries:

  • [BOOT]/1-Boot-NoEmul.img
  • [BOOT]/2-Boot-NoEmul.img
  • boot/boot.cat

These are expected and do not indicate missing install payload files.

Why compare-isos.sh forces LC_ALL=C

comm requires stable sorted input. Locale-dependent sort order can break comparisons.

compare-isos.sh sets LC_ALL=C and explicitly sorts path lists for deterministic output.

Project Files

  • build-winiso.sh: Bash build path
  • build-winiso.ps1: PowerShell build path
  • Dockerfile: Linux image for Bash build
  • Dockerfile.pwsh: Linux PowerShell image for PowerShell build
  • Dockerfile.compare: Linux image for compare script
  • README.md: more detailed instructions and troubleshooting
  • compare-isos.sh: File-level ISO diff tool

Contains all project files. Download and extract to get started.

Win11-Unattend-ISO.zip