mirror of
https://github.com/dockur/windows.git
synced 2026-02-03 17:27:21 +00:00
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:
parent
c1d3f8e886
commit
effdbe0f6f
40
.env.example
Normal file
40
.env.example
Normal 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
3
.gitignore
vendored
@ -1,3 +1,6 @@
|
||||
# Environment file (contains local settings)
|
||||
.env
|
||||
|
||||
# Ignore data folder contents but keep structure
|
||||
data/*
|
||||
!data/*/
|
||||
|
||||
37
CHANGELOG.md
Normal file
37
CHANGELOG.md
Normal 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 |
|
||||
24
compose.yml
24
compose.yml
@ -1,25 +1,27 @@
|
||||
# Default compose file - Windows 11 Pro
|
||||
# For more versions, see compose/ folder
|
||||
|
||||
x-common: &common
|
||||
image: dockurr/windows
|
||||
devices:
|
||||
- /dev/kvm
|
||||
- /dev/net/tun
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
restart: unless-stopped
|
||||
stop_grace_period: 2m
|
||||
# Configure settings in .env file
|
||||
|
||||
services:
|
||||
windows:
|
||||
<<: *common
|
||||
image: dockurr/windows
|
||||
container_name: windows
|
||||
env_file: .env
|
||||
environment:
|
||||
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:
|
||||
- 8006:8006
|
||||
- 3389:3389/tcp
|
||||
- 3389:3389/udp
|
||||
volumes:
|
||||
- ./data/win11:/storage
|
||||
restart: unless-stopped
|
||||
stop_grace_period: 2m
|
||||
|
||||
23
compose/base-legacy.yml
Normal file
23
compose/base-legacy.yml
Normal 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
23
compose/base-modern.yml
Normal 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}
|
||||
@ -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
|
||||
@ -1,10 +1,11 @@
|
||||
include:
|
||||
- ../base.yml
|
||||
- ../base-modern.yml
|
||||
|
||||
services:
|
||||
win10:
|
||||
<<: *common
|
||||
<<: *modern
|
||||
container_name: win10
|
||||
env_file: ../../.env
|
||||
environment:
|
||||
VERSION: "10"
|
||||
ports:
|
||||
@ -15,8 +16,9 @@ services:
|
||||
- ../../data/win10:/storage
|
||||
|
||||
win10e:
|
||||
<<: *common
|
||||
<<: *modern
|
||||
container_name: win10e
|
||||
env_file: ../../.env
|
||||
environment:
|
||||
VERSION: "10e"
|
||||
ports:
|
||||
@ -27,8 +29,9 @@ services:
|
||||
- ../../data/win10e:/storage
|
||||
|
||||
win10l:
|
||||
<<: *common
|
||||
<<: *modern
|
||||
container_name: win10l
|
||||
env_file: ../../.env
|
||||
environment:
|
||||
VERSION: "10l"
|
||||
ports:
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
include:
|
||||
- ../base.yml
|
||||
- ../base-modern.yml
|
||||
|
||||
services:
|
||||
win11:
|
||||
<<: *common
|
||||
<<: *modern
|
||||
container_name: win11
|
||||
env_file: ../../.env
|
||||
environment:
|
||||
VERSION: "11"
|
||||
ports:
|
||||
@ -15,8 +16,9 @@ services:
|
||||
- ../../data/win11:/storage
|
||||
|
||||
win11e:
|
||||
<<: *common
|
||||
<<: *modern
|
||||
container_name: win11e
|
||||
env_file: ../../.env
|
||||
environment:
|
||||
VERSION: "11e"
|
||||
ports:
|
||||
@ -27,8 +29,9 @@ services:
|
||||
- ../../data/win11e:/storage
|
||||
|
||||
win11l:
|
||||
<<: *common
|
||||
<<: *modern
|
||||
container_name: win11l
|
||||
env_file: ../../.env
|
||||
environment:
|
||||
VERSION: "11l"
|
||||
ports:
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
include:
|
||||
- ../base.yml
|
||||
- ../base-legacy.yml
|
||||
|
||||
services:
|
||||
win7:
|
||||
<<: *common
|
||||
<<: *legacy
|
||||
container_name: win7
|
||||
env_file: ../../.env
|
||||
environment:
|
||||
VERSION: "7u"
|
||||
ports:
|
||||
@ -15,8 +16,9 @@ services:
|
||||
- ../../data/win7:/storage
|
||||
|
||||
win7e:
|
||||
<<: *common
|
||||
<<: *legacy
|
||||
container_name: win7e
|
||||
env_file: ../../.env
|
||||
environment:
|
||||
VERSION: "7e"
|
||||
ports:
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
include:
|
||||
- ../base.yml
|
||||
- ../base-legacy.yml
|
||||
|
||||
services:
|
||||
win81:
|
||||
<<: *common
|
||||
<<: *legacy
|
||||
container_name: win81
|
||||
env_file: ../../.env
|
||||
environment:
|
||||
VERSION: "8"
|
||||
ports:
|
||||
@ -15,8 +16,9 @@ services:
|
||||
- ../../data/win81:/storage
|
||||
|
||||
win81e:
|
||||
<<: *common
|
||||
<<: *legacy
|
||||
container_name: win81e
|
||||
env_file: ../../.env
|
||||
environment:
|
||||
VERSION: "8e"
|
||||
ports:
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
include:
|
||||
- ../base.yml
|
||||
- ../base-legacy.yml
|
||||
|
||||
services:
|
||||
vista:
|
||||
<<: *common
|
||||
<<: *legacy
|
||||
container_name: vista
|
||||
env_file: ../../.env
|
||||
environment:
|
||||
VERSION: "vu"
|
||||
ports:
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
include:
|
||||
- ../base.yml
|
||||
- ../base-legacy.yml
|
||||
|
||||
services:
|
||||
win2k:
|
||||
<<: *common
|
||||
<<: *legacy
|
||||
container_name: win2k
|
||||
env_file: ../../.env
|
||||
environment:
|
||||
VERSION: "2k"
|
||||
ports:
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
include:
|
||||
- ../base.yml
|
||||
- ../base-legacy.yml
|
||||
|
||||
services:
|
||||
winxp:
|
||||
<<: *common
|
||||
<<: *legacy
|
||||
container_name: winxp
|
||||
env_file: ../../.env
|
||||
environment:
|
||||
VERSION: "xp"
|
||||
ports:
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
include:
|
||||
- ../base.yml
|
||||
- ../base-legacy.yml
|
||||
|
||||
services:
|
||||
win2003:
|
||||
<<: *common
|
||||
<<: *legacy
|
||||
container_name: win2003
|
||||
env_file: ../../.env
|
||||
environment:
|
||||
VERSION: "2003"
|
||||
ports:
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
include:
|
||||
- ../base.yml
|
||||
- ../base-legacy.yml
|
||||
|
||||
services:
|
||||
win2008:
|
||||
<<: *common
|
||||
<<: *legacy
|
||||
container_name: win2008
|
||||
env_file: ../../.env
|
||||
environment:
|
||||
VERSION: "2008"
|
||||
ports:
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
include:
|
||||
- ../base.yml
|
||||
- ../base-legacy.yml
|
||||
|
||||
services:
|
||||
win2012:
|
||||
<<: *common
|
||||
<<: *legacy
|
||||
container_name: win2012
|
||||
env_file: ../../.env
|
||||
environment:
|
||||
VERSION: "2012"
|
||||
ports:
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
include:
|
||||
- ../base.yml
|
||||
- ../base-modern.yml
|
||||
|
||||
services:
|
||||
win2016:
|
||||
<<: *common
|
||||
<<: *modern
|
||||
container_name: win2016
|
||||
env_file: ../../.env
|
||||
environment:
|
||||
VERSION: "2016"
|
||||
ports:
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
include:
|
||||
- ../base.yml
|
||||
- ../base-modern.yml
|
||||
|
||||
services:
|
||||
win2019:
|
||||
<<: *common
|
||||
<<: *modern
|
||||
container_name: win2019
|
||||
env_file: ../../.env
|
||||
environment:
|
||||
VERSION: "2019"
|
||||
ports:
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
include:
|
||||
- ../base.yml
|
||||
- ../base-modern.yml
|
||||
|
||||
services:
|
||||
win2022:
|
||||
<<: *common
|
||||
<<: *modern
|
||||
container_name: win2022
|
||||
env_file: ../../.env
|
||||
environment:
|
||||
VERSION: "2022"
|
||||
ports:
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
include:
|
||||
- ../base.yml
|
||||
- ../base-modern.yml
|
||||
|
||||
services:
|
||||
win2025:
|
||||
<<: *common
|
||||
<<: *modern
|
||||
container_name: win2025
|
||||
env_file: ../../.env
|
||||
environment:
|
||||
VERSION: "2025"
|
||||
ports:
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
include:
|
||||
- ../base.yml
|
||||
- ../base-legacy.yml
|
||||
|
||||
services:
|
||||
tiny10:
|
||||
<<: *common
|
||||
<<: *legacy
|
||||
container_name: tiny10
|
||||
env_file: ../../.env
|
||||
environment:
|
||||
VERSION: "tiny10"
|
||||
ports:
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
include:
|
||||
- ../base.yml
|
||||
- ../base-legacy.yml
|
||||
|
||||
services:
|
||||
tiny11:
|
||||
<<: *common
|
||||
<<: *legacy
|
||||
container_name: tiny11
|
||||
env_file: ../../.env
|
||||
environment:
|
||||
VERSION: "tiny11"
|
||||
ports:
|
||||
|
||||
117
readme.md
117
readme.md
@ -70,6 +70,123 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/mas
|
||||
|
||||
[](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 💬
|
||||
|
||||
### How do I use it?
|
||||
|
||||
Loading…
Reference in New Issue
Block a user