wimcast
Build Windows images for Foreman on Linux.
wimcast turns Windows ISOs into a Foreman-ready HTTP tree of per-edition WIM
files. It is a drop-in replacement for WIMan
/ GenerateWIM.ps1, running unprivileged on Linux: no Windows host, no
root, no mount(2), no FUSE, no ADK.
sources/<arch>/<name>/*.iso --> finalized/<arch>/<name>/
sources/
boot.wim
ServerStandard.wim
ServerDatacenter.wim
images.ini
drivers/...
wimboot
bootmgr, bootmgr.efi
boot/boot.sdi, boot/bcd
build.json
Why wimcast
| Problem | wimcast solution |
|---|---|
| WIMan needs Windows, the ADK and an admin shell | Any Linux machine, unprivileged |
| Serial builds, one ISO at a time | One command builds every leaf of the sources tree |
Downloads latest wimboot on every build (non-reproducible) |
Pinned, checksummed wimboot |
| Full re-export of unchanged ISOs | Content-addressed cache: unchanged ISO skips re-export |
| Driver tree never published (production bug in WIMan) | sources/drivers/ published for deploy-time DISM |
Quick start
uv tool install wimcast # or: pipx install wimcast
wimcast doctor # check prerequisites (safe, installs nothing)
wimcast probe sources/ # inspect your ISOs before building
wimcast build sources/ # build the finalized/ tree
ls finalized/ # ready to serve over HTTP
That's it. Three commands from zero to a deployable tree.
Installation
uv tool install wimcast
# or: pipx install wimcast
# or: python3.12 -m pip install --user wimcast
Debian/Ubuntu:
sudo apt install wimtools
uv tool install wimcast # pycdlib is installed as a dependency
wimcast doctor tells you exactly what is missing, and whether it is
required or only conditional.
Deploy to Foreman
The full walkthrough (deployment repo, CI pipeline, web server, Foreman setup with Ansible) is in docs/foreman-integration.md.
The 30-second version:
-
Create a deployment repo with your ISOs:
deploy-repo/ sources/<arch>/<name>/*.iso # your ISOs .gitlab-ci.yml # copy ci/examples/deploy-pipeline.yml wimcast.toml # optional, see ci/examples/wimcast.toml -
Configure 4 CI/CD variables:
WEB_SERVER,WEB_SERVER_URL,WEB_SERVER_USER,SSH_PRIVATE_KEY_B64. -
Push: the pipeline runs
init -> build -> deploy -> verifyand yourfinalized/tree lands on your web server. -
Configure Foreman (media, OS, provisioning template): see the Ansible playbook in docs/foreman-integration.md.
Ready-to-copy files:
| File | Purpose |
|---|---|
| ci/examples/deploy-pipeline.yml | GitLab CI for the deployment repo |
| ci/examples/wimcast.toml | Example configuration |
Consumable state contract
Every file of a finalized/<arch>/<name>/ tree is published atomically
(temp file + os.replace), and sources/images.ini is written last: the
tree is consumable if and only if sources/images.ini exists. A build
that crashes mid-way leaves only orphan files, which the next successful
build prunes (prune_tree). Incremental runs: newly published WIMs stay
invisible to consumers until images.ini references them.
Scheduling the build (k8s)
Run the build as a regular k8s Job, not as a helm post-upgrade hook. A
hook blocks the helm upgrade for the whole build (~15 min per tree), and
a crashed build fails the upgrade even when the rest of the release is
healthy. Trigger the Job explicitly and re-run it only when the build
manifest changes (ISO tree or wimcast.toml), not on every upgrade.
Worker pool ([jobs] workers)
The build runs as a bounded worker pool of child processes: one
wimcast build-one subprocess per source tree, at most [jobs] workers
at a time (default 2, practical cap 3: each worker runs a full wimlib
LZX pipeline). Each child's memory is purged at process exit, so the
build stays at O(workers × one tree) instead of O(sources × one tree),
and build latency is the max of the trees instead of their sum. Two
concurrent LZX exports killed a 2Gi container in 0.2.1; workers = 1
restores the 0.2.2 strictly-sequential profile (one tree at a time),
which remains the fallback if process spawning is unavailable.
Runtime directories (ephemeral-storage, k8s)
Children inherit the pod environment unchanged, so TMPDIR flows
through to tempfile everywhere. For charts that need explicit
placement (a 200Gi PVC for the workdir, an emptyDir for the cache):
| Env | Overrides | Fallback |
|---|---|---|
WIMCAST_WORKDIR |
the per-build workdir base | tempfile (TMPDIR) → /tmp |
WIMCAST_CACHE_DIR |
[cache] directory from the config |
config value |
Precedence: explicit env > config > tempfile/TMPDIR > /tmp.
Without these, a heavy build fills the container filesystem and the
kubelet evicts the pod (14.9 GB observed in-cluster).
Commands
| Command | What it does |
|---|---|
wimcast doctor |
Check the runtime contract (required + conditional tools) |
wimcast probe [path] |
Inspect ISO(s) without building: backend, WIM paths, per-index image metadata |
wimcast build [path] |
Build all sources into ./finalized |
wimcast build-one <arch>/<name> <sources_dir> |
Internal scheduler primitive: build one leaf, print its SourceResult as JSON (consumers use build) |
Global flags: --version, --config <path>, -v/--verbose.
Configuration
wimcast.toml in the working directory, all values optional. A missing
file yields the defaults; an invalid value is an error.
[winpe]
source = "iso" # "iso" (default): boot.wim index 1 from the ISO
# source = "file" # externally prepared WinPE (e.g. ADK-built)
# path = "assets/boot-winpe-amd64.wim"
# sha256 = "..."
iso_index = 1 # boot.wim index to export as WinPE base
[editions]
allowed = [] # substring match on image name; e.g. ["Standard", "Datacenter"]
[output]
filename_scheme = "installationtype" # or "editionid" or "install"
[wimboot]
version = "2.9.0" # pinned version, verified by checksum
# sha256 = "..." # required for an unpinned version; overrides the built-in digest
[jobs]
workers = 2 # concurrent source trees, one child process each; cap 3
cpu = 0 # accepted for config compatibility; unused since 0.2.2
[cache]
directory = ".cache" # content-addressed store; unset = no cache
[tools]
wimlib_imagex = "wimlib-imagex" # override binary path if not in PATH
sevenzip = "7z" # ISO fallback backend
wimboot is downloaded once from the pin's GitHub release and then cached.
The built-in SHA-256 is checked before use; override [wimboot] sha256 to
pin a different release, including offline mirrors.
Requirements
| Tool | Minimum | Package | Required |
|---|---|---|---|
| Python | 3.12 | python3 | yes |
wimlib-imagex |
1.13 | wimtools |
yes |
pycdlib |
1.20 | pip dependency | yes |
7zz |
- | p7zip-full |
no (ISO fallback backend) |
rsync |
- | rsync |
no (deployment pipeline) |
qemu-system-x86_64 |
- | qemu-system |
no (smoke test) |
Drivers
- boot.wim (WinPE): INF trees from
winpe/drivers/are added into the WIM under\Drivers\and loaded withdrvloadinstartnet.cmdbeforewpeinit. - install.wim (installed OS): the driver tree is published into
finalized/<arch>/<name>/sources/drivers/and applied at deploy time bydism /image:W:\ /add-driver /recurseinside WinPE. Offline injection intoinstall.wimneeds DISM, so it is not done on Linux.
Windows versions
Supported target: Windows Server 2016/2019/2022/2025 and Windows 10/11
(amd64). wimcast probe reports the backend actually used per ISO; the
live test matrix is maintained in
docs/compatibility.md.
Non-goals (deliberate)
- Offline update integration (
.msu/.cab):updates/is warned about and ignored. Patching happens after deployment (Ansible/WSUS/GPO). - Offline driver injection into
install.wim: drivers are published as a tree and injected by DISM inside WinPE at deploy time. - ISO authoring: the output is an HTTP tree, not bootable media.
Contributing
See CONTRIBUTING.md: architecture, module map, quality gates, conventions, release process.
License
Metadata
Release files for wimcast 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wimcast-0.4.0.tar.gz | 88.1 kB | Without provenance | Details for wimcast-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wimcast-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for wimcast-0.4.0-py3-none-any.whl |
Total release size: 132.6 kB
Release files / wimcast-0.4.0.tar.gz
| Download URL | wimcast-0.4.0.tar.gz |
|---|---|
| Size | 88.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
84279c017da24ac5c6a898ee8a57f1bee3eece734c07b05850df329f8fc51da7
|
|
BLAKE2b-256 checksum How to use checksums |
166322709c95ba3267bd525c70410fb696d4bd42b0cb996e1f2b8c8093b6b0dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.16
|
Release files / wimcast-0.4.0-py3-none-any.whl
| Download URL | wimcast-0.4.0-py3-none-any.whl |
|---|---|
| Size | 44.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2b380b2f5daec73b43278684963e73f890752299428a397d9b8a1129bd406eaf
|
|
BLAKE2b-256 checksum How to use checksums |
9abc6f36b0d18f283146c654a5a97973d29eed72803bb9d21442c9d3dcd9120c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.12.16
|
Security for wimcast 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.