feat: Add winctl.sh management script and multi-version setup

Add winctl.sh with 12 commands for managing Windows Docker containers:
- start, stop, restart, status, logs, shell, stats
- build, rebuild, list, inspect, monitor, check
- Interactive menus, prerequisites checking, color output
- Support for 22 Windows versions across 4 categories

Multi-version compose structure:
- Split base.yml into base-modern.yml (8G) and base-legacy.yml (2G)
- Add .env.example for configuration
- Update all compose files to use env_file
- Add unique port mappings per version
- Update README with winctl.sh documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Michel Abboud 2026-01-28 23:14:45 +00:00
parent c1d3f8e886
commit effdbe0f6f
25 changed files with 1332 additions and 58 deletions

40
.env.example Normal file
View File

@ -0,0 +1,40 @@
# Windows Docker VM Configuration
# Copy this file to .env and customize
# ===========================================
# MODERN SYSTEMS (Windows 10/11, Server 2016+)
# ===========================================
MODERN_RAM_SIZE=8G
MODERN_CPU_CORES=4
MODERN_DISK_SIZE=128G
# ===========================================
# LEGACY SYSTEMS (Windows 7/8, Vista, XP, 2000, Server 2003-2012)
# ===========================================
LEGACY_RAM_SIZE=2G
LEGACY_CPU_CORES=2
LEGACY_DISK_SIZE=32G
# ===========================================
# COMMON SETTINGS (applies to all)
# ===========================================
# User Credentials
USERNAME=Docker
PASSWORD=admin
# Language & Region
LANGUAGE=en
REGION=en-US
KEYBOARD=en-US
# Display
WIDTH=1280
HEIGHT=720
# Network
DHCP=N
SAMBA=Y
# Debug
DEBUG=N

3
.gitignore vendored
View File

@ -1,3 +1,6 @@
# Environment file (contains local settings)
.env
# Ignore data folder contents but keep structure # Ignore data folder contents but keep structure
data/* data/*
!data/*/ !data/*/

37
CHANGELOG.md Normal file
View File

@ -0,0 +1,37 @@
# Changelog
All notable changes to this project will be documented in this file.
## [1.0.0] - 2026-01-28
### Added
- **winctl.sh**: Management script for Windows Docker containers
- 12 commands: start, stop, restart, status, logs, shell, stats, build, rebuild, list, inspect, monitor, check
- Interactive menus for version selection
- Prerequisites checking (Docker, Compose, KVM, TUN, memory, disk)
- Color-coded output with professional table formatting
- Safety confirmations for destructive operations
- Support for all 22 Windows versions across 4 categories
- Multi-version compose structure with organized folders (`compose/`)
- Environment file configuration (`.env` / `.env.example`)
- Two resource profiles: modern (8G RAM, 4 CPU) and legacy (2G RAM, 2 CPU)
- Per-version data folders under `data/`
- Pre-configured compose files for all Windows versions:
- Desktop: Win 11, 10, 8.1, 7 (with Enterprise variants)
- Legacy: Vista, XP, 2000
- Server: 2003, 2008, 2012, 2016, 2019, 2022, 2025
- Tiny: Tiny11, Tiny10
- Unique port mappings for each version (no conflicts)
- CLAUDE.md for Claude Code guidance
### Changed
- Default storage location changed from `./windows` to `./data/`
- Compose files now use `env_file` for centralized configuration
- Restart policy changed from `always` to `unless-stopped`
### Resource Profiles
| Profile | RAM | CPU | Disk | Used By |
|---------|-----|-----|------|---------|
| Modern | 8G | 4 | 128G | Win 10/11, Server 2016+ |
| Legacy | 2G | 2 | 32G | Win 7/8, Vista, XP, 2000, Server 2003-2012, Tiny |

View File

@ -1,25 +1,27 @@
# Default compose file - Windows 11 Pro # Default compose file - Windows 11 Pro
# For more versions, see compose/ folder # For more versions, see compose/ folder
# Configure settings in .env file
x-common: &common
image: dockurr/windows
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
restart: unless-stopped
stop_grace_period: 2m
services: services:
windows: windows:
<<: *common image: dockurr/windows
container_name: windows container_name: windows
env_file: .env
environment: environment:
VERSION: "11" VERSION: "11"
RAM_SIZE: ${MODERN_RAM_SIZE:-8G}
CPU_CORES: ${MODERN_CPU_CORES:-4}
DISK_SIZE: ${MODERN_DISK_SIZE:-128G}
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports: ports:
- 8006:8006 - 8006:8006
- 3389:3389/tcp - 3389:3389/tcp
- 3389:3389/udp - 3389:3389/udp
volumes: volumes:
- ./data/win11:/storage - ./data/win11:/storage
restart: unless-stopped
stop_grace_period: 2m

23
compose/base-legacy.yml Normal file
View File

@ -0,0 +1,23 @@
x-legacy: &legacy
image: dockurr/windows
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
restart: unless-stopped
stop_grace_period: 2m
environment:
RAM_SIZE: ${LEGACY_RAM_SIZE:-2G}
CPU_CORES: ${LEGACY_CPU_CORES:-2}
DISK_SIZE: ${LEGACY_DISK_SIZE:-32G}
USERNAME: ${USERNAME:-Docker}
PASSWORD: ${PASSWORD:-admin}
LANGUAGE: ${LANGUAGE:-en}
REGION: ${REGION:-en-US}
KEYBOARD: ${KEYBOARD:-en-US}
WIDTH: ${WIDTH:-1280}
HEIGHT: ${HEIGHT:-720}
DHCP: ${DHCP:-N}
SAMBA: ${SAMBA:-Y}
DEBUG: ${DEBUG:-N}

23
compose/base-modern.yml Normal file
View File

@ -0,0 +1,23 @@
x-modern: &modern
image: dockurr/windows
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
restart: unless-stopped
stop_grace_period: 2m
environment:
RAM_SIZE: ${MODERN_RAM_SIZE:-8G}
CPU_CORES: ${MODERN_CPU_CORES:-4}
DISK_SIZE: ${MODERN_DISK_SIZE:-128G}
USERNAME: ${USERNAME:-Docker}
PASSWORD: ${PASSWORD:-admin}
LANGUAGE: ${LANGUAGE:-en}
REGION: ${REGION:-en-US}
KEYBOARD: ${KEYBOARD:-en-US}
WIDTH: ${WIDTH:-1280}
HEIGHT: ${HEIGHT:-720}
DHCP: ${DHCP:-N}
SAMBA: ${SAMBA:-Y}
DEBUG: ${DEBUG:-N}

View File

@ -1,9 +0,0 @@
x-common: &common
image: dockurr/windows
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,10 +1,11 @@
include: include:
- ../base.yml - ../base-modern.yml
services: services:
win10: win10:
<<: *common <<: *modern
container_name: win10 container_name: win10
env_file: ../../.env
environment: environment:
VERSION: "10" VERSION: "10"
ports: ports:
@ -15,8 +16,9 @@ services:
- ../../data/win10:/storage - ../../data/win10:/storage
win10e: win10e:
<<: *common <<: *modern
container_name: win10e container_name: win10e
env_file: ../../.env
environment: environment:
VERSION: "10e" VERSION: "10e"
ports: ports:
@ -27,8 +29,9 @@ services:
- ../../data/win10e:/storage - ../../data/win10e:/storage
win10l: win10l:
<<: *common <<: *modern
container_name: win10l container_name: win10l
env_file: ../../.env
environment: environment:
VERSION: "10l" VERSION: "10l"
ports: ports:

View File

@ -1,10 +1,11 @@
include: include:
- ../base.yml - ../base-modern.yml
services: services:
win11: win11:
<<: *common <<: *modern
container_name: win11 container_name: win11
env_file: ../../.env
environment: environment:
VERSION: "11" VERSION: "11"
ports: ports:
@ -15,8 +16,9 @@ services:
- ../../data/win11:/storage - ../../data/win11:/storage
win11e: win11e:
<<: *common <<: *modern
container_name: win11e container_name: win11e
env_file: ../../.env
environment: environment:
VERSION: "11e" VERSION: "11e"
ports: ports:
@ -27,8 +29,9 @@ services:
- ../../data/win11e:/storage - ../../data/win11e:/storage
win11l: win11l:
<<: *common <<: *modern
container_name: win11l container_name: win11l
env_file: ../../.env
environment: environment:
VERSION: "11l" VERSION: "11l"
ports: ports:

View File

@ -1,10 +1,11 @@
include: include:
- ../base.yml - ../base-legacy.yml
services: services:
win7: win7:
<<: *common <<: *legacy
container_name: win7 container_name: win7
env_file: ../../.env
environment: environment:
VERSION: "7u" VERSION: "7u"
ports: ports:
@ -15,8 +16,9 @@ services:
- ../../data/win7:/storage - ../../data/win7:/storage
win7e: win7e:
<<: *common <<: *legacy
container_name: win7e container_name: win7e
env_file: ../../.env
environment: environment:
VERSION: "7e" VERSION: "7e"
ports: ports:

View File

@ -1,10 +1,11 @@
include: include:
- ../base.yml - ../base-legacy.yml
services: services:
win81: win81:
<<: *common <<: *legacy
container_name: win81 container_name: win81
env_file: ../../.env
environment: environment:
VERSION: "8" VERSION: "8"
ports: ports:
@ -15,8 +16,9 @@ services:
- ../../data/win81:/storage - ../../data/win81:/storage
win81e: win81e:
<<: *common <<: *legacy
container_name: win81e container_name: win81e
env_file: ../../.env
environment: environment:
VERSION: "8e" VERSION: "8e"
ports: ports:

View File

@ -1,10 +1,11 @@
include: include:
- ../base.yml - ../base-legacy.yml
services: services:
vista: vista:
<<: *common <<: *legacy
container_name: vista container_name: vista
env_file: ../../.env
environment: environment:
VERSION: "vu" VERSION: "vu"
ports: ports:

View File

@ -1,10 +1,11 @@
include: include:
- ../base.yml - ../base-legacy.yml
services: services:
win2k: win2k:
<<: *common <<: *legacy
container_name: win2k container_name: win2k
env_file: ../../.env
environment: environment:
VERSION: "2k" VERSION: "2k"
ports: ports:

View File

@ -1,10 +1,11 @@
include: include:
- ../base.yml - ../base-legacy.yml
services: services:
winxp: winxp:
<<: *common <<: *legacy
container_name: winxp container_name: winxp
env_file: ../../.env
environment: environment:
VERSION: "xp" VERSION: "xp"
ports: ports:

View File

@ -1,10 +1,11 @@
include: include:
- ../base.yml - ../base-legacy.yml
services: services:
win2003: win2003:
<<: *common <<: *legacy
container_name: win2003 container_name: win2003
env_file: ../../.env
environment: environment:
VERSION: "2003" VERSION: "2003"
ports: ports:

View File

@ -1,10 +1,11 @@
include: include:
- ../base.yml - ../base-legacy.yml
services: services:
win2008: win2008:
<<: *common <<: *legacy
container_name: win2008 container_name: win2008
env_file: ../../.env
environment: environment:
VERSION: "2008" VERSION: "2008"
ports: ports:

View File

@ -1,10 +1,11 @@
include: include:
- ../base.yml - ../base-legacy.yml
services: services:
win2012: win2012:
<<: *common <<: *legacy
container_name: win2012 container_name: win2012
env_file: ../../.env
environment: environment:
VERSION: "2012" VERSION: "2012"
ports: ports:

View File

@ -1,10 +1,11 @@
include: include:
- ../base.yml - ../base-modern.yml
services: services:
win2016: win2016:
<<: *common <<: *modern
container_name: win2016 container_name: win2016
env_file: ../../.env
environment: environment:
VERSION: "2016" VERSION: "2016"
ports: ports:

View File

@ -1,10 +1,11 @@
include: include:
- ../base.yml - ../base-modern.yml
services: services:
win2019: win2019:
<<: *common <<: *modern
container_name: win2019 container_name: win2019
env_file: ../../.env
environment: environment:
VERSION: "2019" VERSION: "2019"
ports: ports:

View File

@ -1,10 +1,11 @@
include: include:
- ../base.yml - ../base-modern.yml
services: services:
win2022: win2022:
<<: *common <<: *modern
container_name: win2022 container_name: win2022
env_file: ../../.env
environment: environment:
VERSION: "2022" VERSION: "2022"
ports: ports:

View File

@ -1,10 +1,11 @@
include: include:
- ../base.yml - ../base-modern.yml
services: services:
win2025: win2025:
<<: *common <<: *modern
container_name: win2025 container_name: win2025
env_file: ../../.env
environment: environment:
VERSION: "2025" VERSION: "2025"
ports: ports:

View File

@ -1,10 +1,11 @@
include: include:
- ../base.yml - ../base-legacy.yml
services: services:
tiny10: tiny10:
<<: *common <<: *legacy
container_name: tiny10 container_name: tiny10
env_file: ../../.env
environment: environment:
VERSION: "tiny10" VERSION: "tiny10"
ports: ports:

View File

@ -1,10 +1,11 @@
include: include:
- ../base.yml - ../base-legacy.yml
services: services:
tiny11: tiny11:
<<: *common <<: *legacy
container_name: tiny11 container_name: tiny11
env_file: ../../.env
environment: environment:
VERSION: "tiny11" VERSION: "tiny11"
ports: ports:

117
readme.md
View File

@ -70,6 +70,123 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/mas
[![Download WinBoat](https://github.com/dockur/windows/raw/master/.github/winboat.png)](https://winboat.app) [![Download WinBoat](https://github.com/dockur/windows/raw/master/.github/winboat.png)](https://winboat.app)
## Multi-Version Setup 🗂️
This repository includes pre-configured compose files for all Windows versions with optimized resource profiles.
### Management Script (winctl.sh)
Use `winctl.sh` for easy container management:
```bash
# Check prerequisites
./winctl.sh check
# Start a container (interactive menu if no version specified)
./winctl.sh start win11
./winctl.sh start # Shows interactive menu
# View status of all containers
./winctl.sh status
# Stop containers (with confirmation)
./winctl.sh stop win11
# View logs
./winctl.sh logs win11 -f
# List all available versions
./winctl.sh list
./winctl.sh list desktop # Filter by category
# Real-time monitoring dashboard
./winctl.sh monitor
# Rebuild container (preserves data)
./winctl.sh rebuild win11
# Full help
./winctl.sh help
```
### Quick Start (Manual)
```bash
# Copy environment template
cp .env.example .env
# Run default (Windows 11)
docker compose up
# Run specific version
docker compose -f compose/desktop/win11.yml up win11
docker compose -f compose/legacy/winxp.yml up winxp
# Run all desktop versions
docker compose -f compose/desktop.yml up
# Run everything
docker compose -f compose/all.yml up
```
### Configuration
Edit `.env` to customize resources for all VMs:
```bash
# Modern systems (Win 10/11, Server 2016+)
MODERN_RAM_SIZE=8G
MODERN_CPU_CORES=4
MODERN_DISK_SIZE=128G
# Legacy systems (Win 7/8, Vista, XP, 2000, Server 2003-2012, Tiny)
LEGACY_RAM_SIZE=2G
LEGACY_CPU_CORES=2
LEGACY_DISK_SIZE=32G
# Common settings
USERNAME=Docker
PASSWORD=admin
LANGUAGE=en
```
### Folder Structure
```
compose/
├── base-modern.yml # High-resource profile
├── base-legacy.yml # Low-resource profile
├── all.yml # All versions
├── desktop.yml # Desktop versions
├── legacy.yml # Vista, XP, 2000
├── server.yml # Server versions
├── tiny.yml # Tiny versions
├── desktop/ # Individual desktop configs
├── legacy/ # Individual legacy configs
├── server/ # Individual server configs
└── tiny/ # Individual tiny configs
data/ # VM storage (per-version folders)
├── win11/
├── winxp/
└── ...
```
### Port Reference
| Version | Web UI | RDP |
|---------|--------|-----|
| win11 | 8011 | 3311 |
| win10 | 8010 | 3310 |
| win81 | 8008 | 3308 |
| win7 | 8007 | 3307 |
| vista | 8006 | 3306 |
| winxp | 8005 | 3305 |
| win2k | 8000 | 3300 |
| win2025 | 8025 | 3325 |
| win2022 | 8022 | 3322 |
| tiny11 | 8111 | 3111 |
## FAQ 💬 ## FAQ 💬
### How do I use it? ### How do I use it?

1016
winctl.sh Executable file

File diff suppressed because it is too large Load Diff