Repository navigation
Windows ISO WIM Splitting and AutoUnattend
Modern Windows 10 and Windows 11 installation ISOs ship a sources/install.wim archive that frequently exceeds FAT32's 4 GiB (4,294,967,295-byte) single-file limit. Instead of formatting NTFS and bundling a third-party UEFI NTFS driver (which breaks strict UEFI Secure Boot on many machines unless unsigned drivers are allowed), Cinderboot builds a 100% Microsoft-native GPT + FAT32 UEFI USB that boots directly under strict Secure Boot with zero third-party bootloaders.
Implemented in internal/flash/iso_fat32.go, the windows-fat32 (and iso-fat32) pipeline performs every step in pure Go:
flowchart TD
ISO["Windows 10/11 ISO (UDF 1.02 or ISO9660)"]
Walk["Enumerate Entries & Validate Drive Capacity (+64 MiB headroom)"]
GPT["Write Protective MBR + Single 1 MiB-Aligned GPT Partition (GPTTypeBasicData)"]
FAT["Format FAT32 Volume (FAT32Writer)"]
Loop["For Each Entry in ISO"]
Small["File <= 4 GiB - 1 Byte -> Stream Directly to FAT32"]
WIM["File > 4 GiB and ends with .wim -> Lossless Streaming Split (.swm)"]
Auto["Optional: Generate & Write /autounattend.xml"]
Close["Flush Directories, FAT1/FAT2, FSInfo, Boot/Backup Boot Sectors & Sync()"]
ISO --> Walk --> GPT --> FAT --> Loop
Loop --> Small --> Auto
Loop --> WIM --> Auto
Auto --> Close
Key pipeline details:
-
UDF 1.02 First:
image.OpenImageFStriesOpenUDFbeforeOpenISO9660, because official MicrosoftoscdimgISOs store full paths and>4 GiBinstall.wimfiles in UDF 1.02. -
Headroom Check: Verifies
totalBytes + 64 MiB <= diskSizebefore writing. -
Volume Label: Uses
--labelif specified, otherwise the ISO's UDF/ISO9660 volume label, otherwiseCINDERBOOT(sanitized to 11 uppercase FAT32-safe characters). -
Non-WIM Files
>4 GiB: If a file larger than4,294,967,295bytes is not a.wimarchive (for instance, a solid.esdor other oversized file), Cinderboot fails clearly rather than silently truncating it.
Windows Setup natively recognizes spanned WIM archives (sources/install.swm, sources/install2.swm, sources/install3.swm, ...) on FAT32 partitions. Cinderboot's pure-Go splitter (internal/wim/split.go) produces spec-compliant .swm files without decompressing or recompressing any LZX/XPRESS payloads and without using temporary disk space.
-
Header Validation: Reads the 208-byte
MSWIM\0\0\0header (wimHeaderSize = 208) viaio.ReaderAtdirectly out of the ISO's UDF extents.- Rejects solid ESD archives (
version == 0x00000E00) withErrSolidESD, because solid compressed chunks cannot be split without full decompression and recompression.
- Rejects solid ESD archives (
-
Lookup Table & XML Loading: Loads the 50-byte-per-entry resource lookup table (
wimResEntrySize = 50) and XML metadata into memory (typically only a few MiB). -
Metadata vs. Data Partitioning:
- Separates metadata resources (
resFlagMetadata = 0x02) from data resources. - Places all metadata resources into Part 1 first (required by Windows Setup), updating
bootMetadataandbootIndexoffsets accordingly. - Packs data resources greedily across Part 1..N while keeping each part's total size (208-byte header + resource payloads + part lookup table + XML metadata) under
DefaultMaxPartSize= 3,800 MiB (safely below FAT32's 4 GiB limit).
- Separates metadata resources (
-
Zero-Temp-Disk Streaming via
io.Pipe:- Because each planned
PartSpeccomputes its exact final byte size (TotalSize) up front,flash/iso_fat32.goknows the exact FAT32 cluster chain length before writing byte 0. - For each part,
wim.Splitinvokes the consumer with(partNum, totalParts, exactSize, streamFn). -
iso_fat32.goconnectsstreamFntoFAT32Writer.WriteFileCtxover an in-memoryio.Pipe(), streaming 1 MiB chunks directly from the source ISO into the USB drive's FAT32 clusters.
- Because each planned
-
Spanned Header & Naming Convention:
- Sets
FLAG_HEADER_SPANNED(0x00000008), writespartNumberandtotalParts, rewrites every entry'soffsetandpartNumber, clears the integrity table on split parts, and appends each part's lookup table and XML metadata. - Names output files using Microsoft Windows Setup's exact convention (
PartFileName):- Part 1 →
sources/install.swm - Part 2 →
sources/install2.swm - Part 3 →
sources/install3.swm(and so on)
- Part 1 →
- Sets
Note
If sources/install.wim (or sources/install.esd) is ≤ 4,294,967,295 bytes, no splitting is needed and the file is copied verbatim into sources/ on the FAT32 partition.
When any Windows customization option is enabled (in the UI or CLI), unattend.Generate builds a UTF-8 Microsoft Windows Setup autounattend.xml document, validates its XML syntax with Go's encoding/xml decoder, and writes it to the USB root directory (/autounattend.xml). If no options are enabled, no autounattend.xml file is written.
| CLI Flag | JSON Field (unattend.*) |
Setup Pass & Component | Exact Action Written to autounattend.xml
|
|---|---|---|---|
--win-bypass-req |
bypass_requirements |
windowsPE / Microsoft-Windows-Setup (RunSynchronous) |
Sets REG_DWORD = 1 under HKLM\SYSTEM\Setup\LabConfig for BypassTPMCheck, BypassSecureBootCheck, BypassRAMCheck, and BypassStorageCheck
|
--win-bypass-msa |
bypass_msa |
specialize / Microsoft-Windows-Deployment (RunSynchronous) |
Sets HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OOBE\BypassNRO = 1 (REG_DWORD) |
--win-no-bitlocker |
disable_bitlocker |
specialize / Microsoft-Windows-Deployment (RunSynchronous) |
Sets HKLM\SYSTEM\CurrentControlSet\Control\BitLocker\PreventDeviceEncryption = 1 (REG_DWORD) |
--win-skip-privacy |
skip_privacy |
oobeSystem / Microsoft-Windows-Shell-Setup (OOBE) |
Sets HideEULAPage=true, HideLocalAccountScreen=false, HideOnlineAccountScreens=true, HideWirelessSetupInOOBE=true, ProtectYourPC=3
|
--win-user <name> |
local_username |
oobeSystem / Microsoft-Windows-Shell-Setup (UserAccounts/LocalAccounts) |
Adds a local account in the Administrators group with an empty initial password (PlainText=true) |
-
XML Escaping: All descriptions, commands, and usernames are escaped through
xml.EscapeText. -
Username Sanitization (
sanitizeLocalUsername): Trims whitespace, truncates to 20 characters, and strips any character outside[A-Za-z0-9\-_ ]. -
Schema Validation: Every generated document is parsed token-by-token through
xml.NewDecoderbefore returning; malformed XML causes the flash step to fail safely.
Warning
When --win-user is set, the generated local Administrator account is created with a blank password so first-boot OOBE completes unattended. Set a strong password immediately after Windows finishes installing.
Source code is licensed under the GNU General Public License v3.0 (GPL-3.0) — by Buntato (buntatoes.dev). The Cinderboot name, flame-USB logo, icons, and branding remain All Rights Reserved.
Getting Started
Core Engine
- Architecture and Pure-Go Design
- Flashing Modes and Multiboot
- Windows ISO, WIM Splitting, and AutoUnattend
Safety, Platforms & Development
Links