$ show dockur/windows
This repository provides a Docker container that runs a fully functional Windows virtual machine inside a Docker environment using KVM/QEMU hardware acceleration. It automates the entire lifecycle of a Windows VM, from downloading the correct ISO from Microsoft or mirror sources, performing an unattended installation using dynamically generated answer files, injecting optimized VirtIO drivers, to configuring remote access via a web-based noVNC interface or RDP. The architecture is a monolithic Docker container orchestrated by a series of modular Bash scripts sourced from a main entry point (`/run/entry.sh`). Key modules handle specific concerns: `mido.sh` scrapes Microsoft's ESD download portal, `image.sh` manipulates WIM/ISO images, `answer.sh` generates XML configuration, `display.sh` configures GPU acceleration, and `power.sh` manages graceful shutdown. This modularity, while in Bash, demonstrates strong systems engineering principles. The project supports an extensive range of Windows versions from Windows 95 to Windows Server 2025, including specialized editions like LTSC and IoT. It features robust error handling, checksum verification, state persistence across container restarts, and a comprehensive CI/CD pipeline that validates installations across multiple versions. The `assets/` directory contains per-version unattended answer files and post-install scripts that apply registry tweaks, disable unnecessary features, and install drivers. While the codebase exhibits high craftsmanship in its specialized modules, it faces medium technical drift risk due to its heavy reliance on hardcoded download URLs, SHA256 checksums, and specific external tool versions. The `mido.sh` scraping logic is particularly fragile against changes to Microsoft's infrastructure. Despite this, the project is actively maintained and represents a highly sophisticated piece of systems automation engineering.
The LLM identified 5 files worth highlighting for reuse:
Fetches Microsoft ESD catalogs (CAB/XML), parses SKU/language/architecture, and extracts download links with checksum verification. Handles Microsoft's anti-abuse logic (session registration, ov-df challenge). Reusable as a standalone pattern for scraping complex, changing web APIs with robust error handling and fallback logic.
Extracts ISO files, reads WIM/ESD headers and XML metadata, rebuilds images with injected drivers and answer files. Reusable for any Windows deployment pipeline requiring image manipulation, driver injection, or boot configuration (BIOS/UEFI). Demonstrates deep knowledge of Windows image formats.
Dynamically generates Autounattend.xml from environment variables, adjusting locale, user accounts, domain join, disk ID, and product key. Reusable pattern for generating complex XML configurations from environment variables using XPath editing (xmlstarlet), applicable to any Windows automation or configuration management task.
Handles Windows 9x (95/98/Me) unattended installation, including driver injection, system image creation, and registry patching. Contains embedded base64+gzip binaries and inline Python scripts for binary patching. Reusable pattern for legacy OS automation, embedded binary staging, and deep system image manipulation.
Monitors QEMU console output to detect boot completion and send ACPI shutdown signals; handles legacy Windows without ACPI via forced kill. Reusable pattern for robust VM lifecycle management, process monitoring, and graceful shutdown with fallback mechanisms.