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)

homelab
Searching Databaseโ€ฆ

53.6K ยทGitHub
What is this?dockur/windows runs a full, real Windows installation inside a Docker container, automatically downloading and installing it with no manual steps.
Am I getting a compatibility layer, or an actual Windows install?It is a real virtual machine, not an emulation layer - the container boots QEMU/KVM to run genuine Windows with near-native performance.
How do I get it running?Start the container with Docker Compose or the Docker CLI, then open port 8006 in your browser; Windows downloads and installs itself fully automatically.
What do I need on my host before trying this?Docker or Podman on a Linux host with KVM support (or Docker Desktop on Windows 11 with nested virtualization), plus at least 2 GB RAM and 32 GB free disk space.
Will this work with Docker Desktop on my Mac or Windows 10 box?No - Docker Desktop on Linux, macOS, and Windows 10 does not expose KVM to containers, so the virtual machine cannot be accelerated there.
Can I run Windows for ARM on something like an Apple Silicon Mac?Not with this image - it targets x86 KVM. For ARM64 Windows you need the companion project 'dockur/windows-arm'.
Which Windows versions can I actually install?Anything from Windows 95, 98, ME, 2000, XP, Vista, 7, 8.1, 10, 11, Windows Server (2003-2025), Tiny10/Tiny11, and even ReactOS, selected via the VERSION environment variable - or you can point it at a custom ISO URL.
How do I connect for day-to-day use instead of the web viewer?Use any Microsoft Remote Desktop client to connect to the container's IP with username 'Docker' and password 'admin' - RDP is more responsive and supports clipboard sharing, unlike the web viewer.
Can I share files or plug in a USB device?Yes - bind a host folder in the compose file to get a 'Shared' folder and Z: drive inside Windows, and you can pass through USB devices or raw disks/partitions directly.
Is running Windows this way actually legal?Yes, the project itself only contains open-source code and doesn't distribute Windows; any embedded product keys are Microsoft's generic trial keys, and you're responsible for having a valid Windows license.
Creator
dockur
Size
2.5 MB
Stars
53.6K
Age
2y
Commits ยท 90 Days