windows icon indicating copy to clipboard operation
windows copied to clipboard

❯ ERROR: Please bind '/dev/kvm' as a volume in the optional container settings when using Docker Desktop.

Open TheItschi opened this issue 4 months ago • 5 comments

Operating system

Windows 11 Pro & Docker Desktop

Description

After starting with "docker-compose up -d" the OS is downloaded but after a while the conainer stops with "❯ ERROR: Please bind '/dev/kvm' as a volume in the optional container settings when using Docker Desktop."

Docker compose

services:
  windows:
    image: dockurr/windows
    container_name: windows
    privileged: true
    environment:
      VERSION: "11"
      LANGUAGE: "German"
      REGION: "de-DE"
      KEYBOARD: "de-DE"
      USERNAME: "xyz"
      PASSWORD: "xyz"
    devices:
      - /dev/kvm
      - /dev/net/tun
    cap_add:
      - NET_ADMIN
    ports:
      - 8006:8006
      - 3389:3389/tcp
      - 3389:3389/udp
    volumes:
      - ./windows:/storage
      - ./windows:/
    restart: always
    stop_grace_period: 2m

Docker log

❯ Starting Windows for Docker v5.03...

❯ For support visit https://github.com/dockur/windows⁠

❯ CPU: Intel N95 | RAM: 6/8 GB | DISK: 317 GB (v9fs) | KERNEL: 6.6.87.2-microsoft-standard-WSL2...


❯ ERROR: Please bind '/dev/kvm' as a volume in the optional container settings when using Docker Desktop.

❯ Starting Windows for Docker v5.03...

❯ For support visit https://github.com/dockur/windows⁠

❯ CPU: Intel N95 | RAM: 6/8 GB | DISK: 317 GB (v9fs) | KERNEL: 6.6.87.2-microsoft-standard-WSL2...

Screenshots (optional)

No response

TheItschi avatar Sep 24 '25 16:09 TheItschi

It means it cannot find /dev/kvm and the most common reason is that people launch the container from Docker Desktop without using a compose file, and in that case you must go to "Optional containers settings" in Docker Desktop and bind a volume called /dev/kvm. So the error message explains what you need to do.

But in your case /dev/kvm is included in your compose file, so I think the reason might be this weird - ./windows:/ line in your compose file, that should not be there

kroese avatar Sep 24 '25 17:09 kroese

- ./windows:/

Hm, that is exactly what's listed as example yaml of the documentation. However, I deleted the volumes section but the error stys the same.

TheItschi avatar Sep 24 '25 18:09 TheItschi

No?? That is not written anywhere in the documentation? The only example I see is below:

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.

In any case, I have no idea why KVM is not working on your Docker Desktop installation. If you use WSL2 as the backend it should be available, as many people run this container succesfully in Docker Desktop. But I do not have experience with it myself, so I have no tips how you can figure out what setting is wrong.

kroese avatar Sep 24 '25 18:09 kroese

Well, I only installed docker desktop with no other distro on that pc. The distro listed in WSL ist therefore "docker-desktop'. Up to know I had no need to install a real distro. Maybe that's the problem?

TheItschi avatar Sep 24 '25 20:09 TheItschi

I am seeing this exact issue with the MacOS version. And windows version. I am using docker desktop, but I couldn't find a setting like the error says, for setting container settings (basic or optional).

SeikojinSama avatar Oct 15 '25 23:10 SeikojinSama