windows README

The project's README from github.com/dockur/windows. As one markdown file: README.md.

Windows

Build Version Size Package Pulls

Windows inside a Docker container.

Features ✨

Video 📺

YouTube

Usage 🐳

Docker Compose:
services:
  windows:
    image: dockurr/windows
    container_name: windows
    environment:
      VERSION: "11"
    devices:
      - /dev/kvm
      - /dev/net/tun
    cap_add:
      - NET_ADMIN
    ports:
      - 8006:8006
      - 3389:3389/tcp
      - 3389:3389/udp
    volumes:
      - ./windows:/storage
    restart: always
    stop_grace_period: 2m
Docker CLI:
docker run -it --rm --name windows -e "VERSION=11" -p 8006:8006 --device=/dev/kvm --device=/dev/net/tun --cap-add NET_ADMIN -v "${PWD:-.}/windows:/storage" --stop-timeout 120 docker.io/dockurr/windows
Kubernetes:
kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/master/kubernetes.yml
Desktop applications

For a complete graphical desktop experience, see WinBoat, WinPodX, or WinApps. Each of these projects uses this container as its backend.

GitHub Codespaces:

Open in GitHub Codespaces

Requirements ⚙️

[!NOTE] Docker Desktop on Linux, macOS, and Windows 10 does not currently provide KVM access to containers and is therefore not supported.

FAQ 💬

How do I use it?

Very simple! These are the steps:

Enjoy your brand new machine, and don't forget to star this repo!

How do I select the Windows version?

By default, Windows 11 Pro will be installed. But you can add the VERSION environment variable to your compose file, in order to specify an alternative Windows version to be downloaded:

environment:
  VERSION: "10"

Select from the values below:

Value Version Size
11 Windows 11 Pro 7.9 GB
11l Windows 11 LTSC 4.7 GB
11e Windows 11 Enterprise 6.6 GB
10 Windows 10 Pro 5.7 GB
10l Windows 10 LTSC 4.6 GB
10e Windows 10 Enterprise 5.2 GB
8e Windows 8.1 Enterprise 3.7 GB
7u Windows 7 Ultimate 3.1 GB
vu Windows Vista Ultimate 3.0 GB
xp Windows XP Professional 0.6 GB
2k Windows 2000 Professional 0.4 GB
me Windows ME 0.5 GB
98 Windows 98 0.7 GB
95 Windows 95 0.6 GB
2025 Windows Server 2025 7.6 GB
2022 Windows Server 2022 6.0 GB
2019 Windows Server 2019 5.3 GB
2016 Windows Server 2016 6.5 GB
2012 Windows Server 2012 4.3 GB
2008 Windows Server 2008 3.0 GB
2003 Windows Server 2003 0.6 GB
core11 Tiny11 Core 3.0 GB
tiny11 Tiny11 5.3 GB
tiny10 Tiny10 3.6 GB
reactos ReactOS 0.1 GB

[!TIP] To install ARM64 versions of Windows use dockur/windows-arm.

How do I change the storage location?

To change the storage location, include the following bind mount in your compose file:

volumes:
  - ./windows:/storage

Replace the example path ./windows with the desired storage folder or named volume.

How do I change the size of the disk?

To expand the default size of 64 GB, add the DISK_SIZE setting to your compose file and set it to your preferred capacity:

environment:
  DISK_SIZE: "256G"

[!TIP] This can also be used to resize an existing disk to a larger capacity without any data loss. However, you will need to manually extend the disk partition afterwards, since the added disk space will appear as unallocated.

How do I share files with the host?

After installation there will be a folder called Shared on your desktop, which can be used to exchange files with the host machine.

To select a folder on the host for this purpose, include the following bind mount in your compose file:

volumes:
  -  ./example:/shared

Replace the example path ./example with your desired shared folder, which then will become visible as Shared on the desktop and as drive Z:.

How do I change the amount of CPU or RAM?

By default, Windows will be allowed to use 2 CPU cores and 4 GB of RAM.

If you want to adjust this, you can specify the desired amount using the following environment variables:

environment:
  RAM_SIZE: "8G"
  CPU_CORES: "4"

How do I enable audio?

Audio is disabled by default unless you are using RDP. To stream it to the browser, add the following environment variable:

environment:
  AUDIO: "Y"

Then enable Audio under Settings → Advanced in the web viewer. The stream is only active while this option is enabled, so it uses no extra bandwidth otherwise.

How do I connect using RDP?

The web viewer is mainly intended for use during installation, since it is less responsive than RDP and does not support features such as clipboard sharing.

So for a better experience you can connect using any Microsoft Remote Desktop client to the IP of the container, using the username Docker and password admin.

There is an RDP client for Android available from the Play Store and one for iOS in the Apple Store. For Linux you can use FreeRDP and on Windows just type mstsc in the search box.

How do I configure the username and password?

By default, a user called Docker is created and its password is admin.

If you want to set up different credentials during installation, you can configure them in your compose file:

environment:
  USERNAME: "bill"
  PASSWORD: "gates"

When DOMAIN is set, these variables are used as domain credentials instead.

How do I join an Active Directory domain?

Windows can automatically join an Active Directory domain during installation. Specify the domain name in your compose file:

environment:
  DOMAIN: "example.com"
  DOMAIN_OU: "OU=Virtual Machines,OU=Servers,DC=example,DC=com"

Use the domain name, such as example.com, rather than a URL. The supplied account is added to the local Administrators group and automatically signed in after installation. DOMAIN_OU is optional and specifies where the computer account should be created.

Windows must be able to resolve and reach the domain controller through the domain's DNS server.

How do I select the Windows language?

By default, the English version of Windows will be downloaded.

But you can add the LANGUAGE environment variable to your compose file, in order to specify an alternative language to be downloaded:

environment:
  LANGUAGE: "French"

You can choose between: 🇦🇪 Arabic, 🇧🇬 Bulgarian, 🇨🇳 Chinese, 🇭🇷 Croatian, 🇨🇿 Czech, 🇩🇰 Danish, 🇳🇱 Dutch, 🇬🇧 English, 🇪🇪 Estonian, 🇫🇮 Finnish, 🇫🇷 French, 🇩🇪 German, 🇬🇷 Greek, 🇮🇱 Hebrew, 🇭🇺 Hungarian, 🇮🇹 Italian, 🇯🇵 Japanese, 🇰🇷 Korean, 🇱🇻 Latvian, 🇱🇹 Lithuanian, 🇳🇴 Norwegian, 🇵🇱 Polish, 🇵🇹 Portuguese, 🇷🇴 Romanian, 🇷🇺 Russian, 🇷🇸 Serbian, 🇸🇰 Slovak, 🇸🇮 Slovenian, 🇪🇸 Spanish, 🇸🇪 Swedish, 🇹🇭 Thai, 🇹🇷 Turkish and 🇺🇦 Ukrainian.

How do I select the keyboard layout?

If you want to set up a keyboard layout or locale that is not the default for your selected language, you can add KEYBOARD and REGION variables like this:

environment:
  REGION: "en-US"
  KEYBOARD: "en-US"

How do I install a custom image?

In order to download an unsupported ISO image, specify its URL in the VERSION environment variable:

environment:
  VERSION: "https://example.com/win.iso"

Alternatively, you can also skip the download and use a local file instead, by binding it in your compose file in this way:

volumes:
  - ./example.iso:/custom.iso

Replace the example path ./example.iso with the filename of your desired ISO file. The value of VERSION will be ignored in this case.

How do I run a command after installation?

To execute a single command during the final step of the automatic installation, add the COMMAND environment variable:

environment:
  COMMAND: 'reg add "HKLM\Software\Example" /v Enabled /t REG_DWORD /d 1 /f'

To run a script or include additional files, create a file called install.bat and place it in a folder together with any files it needs, such as software to be installed.

Then bind that folder in your compose file like this:

volumes:
  - ./example:/oem

The example folder ./example will be copied to C:\OEM and the install.bat file inside it will be executed during the final step of the automatic installation.

How do I assign an individual IP address to the container?

By default, the container uses bridge networking, which shares the IP address with the host.

If you want to assign an individual IP address to the container, you can create a macvlan network as follows:

docker network create -d macvlan \
    --subnet=192.168.0.0/24 \
    --gateway=192.168.0.1 \
    --ip-range=192.168.0.100/28 \
    -o parent=eth0 vlan

Be sure to modify these values to match your local subnet.

Once you have created the network, change your compose file to look as follows:

services:
  windows:
    container_name: windows
    ..<snip>..
    networks:
      vlan:
        ipv4_address: 192.168.0.100

networks:
  vlan:
    external: true

An added benefit of this approach is that you won't have to perform any port mapping anymore, since all ports will be exposed by default.

[!IMPORTANT]
This IP address won't be accessible from the Docker host due to the design of macvlan, which doesn't permit communication between the two. If this is a concern, you need to create a second macvlan as a workaround.

How can Windows acquire an IP address from my router?

After configuring the container for macvlan, it is possible for Windows to become part of your home network by requesting an IP from your router, just like a real PC.

To enable this mode, in which the container and Windows will have separate IP addresses, add the following lines to your compose file:

environment:
  DHCP: "Y"
devices:
  - /dev/vhost-net
device_cgroup_rules:
  - 'c *:* rwm'

How do I add multiple disks?

To create additional disks, modify your compose file like this:

environment:
  DISK2_SIZE: "32G"
  DISK3_SIZE: "64G"
volumes:
  - ./example2:/storage2
  - ./example3:/storage3

How do I pass through a disk?

You can pass through disk devices or partitions directly by adding them to your compose file in this way:

devices:
  - /dev/sdb:/disk1
  - /dev/sdc1:/disk2

Use /disk1 if you want it to become your main drive (which will be formatted during installation), and use /disk2 and higher to add them as secondary drives (which will stay untouched).

How do I pass through a USB device?

To pass through a USB device, first look up its vendor and product IDs via the lsusb command, then add them to your compose file like this:

environment:
  ARGUMENTS: "-device usb-host,vendorid=0x1234,productid=0x1234"
devices:
  - /dev/bus/usb

[!WARNING]
Adding a USB mass storage device before Windows Setup has finished may cause it to fail. Or worse: the drive can get formatted as the system disk, and all your data will be lost! So always keep them disconnected when launching the container for the first time.

How do I enable dynamic memory allocation?

By default, the VM is allocated the full amount of RAM configured via RAM_SIZE for its entire lifetime.

However, you can enable memory ballooning if you want the container to dynamically reclaim unused guest RAM based on host memory pressure.

Are these all available options?

No. For a complete overview of all supported settings, see the environment variables page.

How do I verify that KVM is available?

First, make sure your platform and container runtime meet the requirements listed above.

On a Linux host, install cpu-checker and run:

sudo apt install cpu-checker
sudo kvm-ok

A working configuration should report:

KVM acceleration can be used

You can also verify that the KVM device exists:

ls -l /dev/kvm

If KVM is unavailable, check whether:

If kvm-ok succeeds but the container still reports that KVM is unavailable, you can temporarily add privileged: true to your Compose file to rule out a permission or device-access issue.

How do I run macOS in a container?

You can use dockur/macos for that. It shares many of the same features, except for the automatic installation.

How do I run a Linux desktop in a container?

You can use qemus/qemu in that case.

Yes, this project contains only open-source code and does not distribute Windows itself. Any product keys found in the code are generic installation keys published by Microsoft for trial purposes and are not valid activation licenses.

You are responsible for ensuring that you have a valid Windows license and that your use complies with Microsoft's licensing terms.

Stars 🌟

Stargazers

Disclaimer ⚖️

The product names, logos, brands, and other trademarks referred to within this project are the property of their respective trademark holders. This project is not affiliated, sponsored, or endorsed by Microsoft Corporation.

windows (dockur/windows)

Searching Database…

53.6K ·GitHub
这是什么?dockur/windows 可以在 Docker 容器中运行一个完整、真实的 Windows 系统,并自动下载和安装,无需任何手动操作。
我得到的是兼容层,还是真正的 Windows 系统?这是真正的虚拟机,而不是模拟层——容器会启动 QEMU/KVM 来运行正版 Windows,性能接近原生。
我该怎样让它运行起来?用 Docker Compose 或 Docker CLI 启动容器,然后在浏览器中打开 8006 端口;Windows 会全自动下载并完成安装。
在尝试之前,我的主机需要准备什么?需要一台支持 KVM 的 Linux 主机并安装 Docker 或 Podman(或者在 Windows 11 上使用启用了嵌套虚拟化的 Docker Desktop),另外至少需要 2 GB 内存和 32 GB 可用磁盘空间。
我的 Mac 或 Windows 10 电脑上的 Docker Desktop 能运行这个吗?不能——Linux、macOS 和 Windows 10 上的 Docker Desktop 不会向容器开放 KVM,因此虚拟机在这些平台上无法获得硬件加速。
我能在 Apple Silicon Mac 之类的设备上运行 ARM 版 Windows 吗?这个镜像不支持,它面向 x86 KVM。若要运行 ARM64 版 Windows,需要使用配套项目 'dockur/windows-arm'。
我实际能安装哪些 Windows 版本?从 Windows 95、98、ME、2000、XP、Vista、7、8.1、10、11、Windows Server(2003-2025)、Tiny10/Tiny11,甚至 ReactOS,都可以通过 VERSION 环境变量选择,也可以指向自定义 ISO 地址。
日常使用时,怎样不通过网页查看器而是直接连接?使用任意 Microsoft 远程桌面客户端,连接到容器的 IP,用户名填 'Docker',密码填 'admin'。与网页查看器相比,RDP 响应更快,并且支持剪贴板共享。
我能共享文件或接入 USB 设备吗?可以。在 compose 文件中绑定一个主机文件夹,Windows 内就会出现 'Shared' 文件夹和 Z: 盘;你也可以把 USB 设备或原始磁盘/分区直接透传进去。
这样运行 Windows 合法吗?合法。项目本身只包含开源代码,不分发 Windows;其中内嵌的任何产品密钥都是微软的通用试用密钥,你需要自行拥有有效的 Windows 许可证。
Creator
dockur
Size
2.5 MB
Stars
53.6K
Age
2y
Commits · 90 Days