m1k1o / win10-in-docker

Run WIN10 inside Docker, connect via VNC - lightweight repository.
28 stars 17 forks source link
docker kvm microsoft qemu-kvm vnc vnc-server windows-10

win10 in docker

Run headless container. Connect via VNC.

screenshot

Before you start

You must have enabled KVM on the host.

systemctl enable libvirtd.service
systemctl enable virtlogd.service
modprobe kvm_intel

Download Windows 10 ISO image

Get official Windows 10 ISO image from official source. This tutorial might come in handy.

Create HDD

Create HDD image, where system will be installed. Choose custom disk size.

docker build -t win10-hdd -f hdd.Dockerfile .
docker run --rm -v $PWD:/data win10-hdd 128G

Build and run container

In order to use KVM inside container, it needs to run as privileged. Do not forget to mount files we created earlier:

docker build -t win10 .
docker run -d --name win10-in-docker \
    -p 5901:5901 \
    --privileged --cap-add=ALL \
    -v /lib/modules:/lib/modules \
    -v /dev:/dev \
    -v $PWD/Win10_2004_English_x64.iso:/home/arch/win10_x64.iso \
    -v $PWD/win10_hdd.img:/home/arch/win10_hdd.img \
    win10

Inspired by:

Is This Legal?

You need to have valid licence and download Windows 10 ISO image from official sources. This contaier just helps with virtualization.