dockur / windows

Windows inside a Docker container.
MIT License
16.84k stars 1.42k forks source link

Error response from daemon: error gathering device information while adding custom device "/dev/kvm": no such file or directory #638

Closed DieALot36T9 closed 1 month ago

DieALot36T9 commented 1 month ago

Operating system

Fedora 40

Description

I have KVM and I use it with virt-manager but it doesnt work with docker. the kvm-ok is not available in fedora for me to show output.

Docker compose

services: windows: image: dockurr/windows container_name: windows environment: VERSION: "core11" REGION: "en-US" KEYBOARD: "en-US" DISK_SIZE: "40G" RAM_SIZE: "3G" CPU_CORES: "4" volumes:

Docker log

diealot@fedora:~/windows-docker$ docker compose up -d [+] Running 0/1 ⠸ Container windows Starting 0.2s Error response from daemon: error gathering device information while adding custom device "/dev/kvm": no such file or directory diealot@fedora:~/windows-docker$

Screenshots (optional)

No response

sirweazel commented 1 month ago

you can check if you have the kvm extensions running by running from your fedora host. egrep '^flags.*(vmx|svm)' /proc/cpuinfo

If it returns nothing and is just a line with no output, then you should check the bios or other options to make sure it is properly enabled. Sometimes this setting is in the bios under security.

Example screenshot showing output if virtualization extensions are detected: image

Additional info: https://docs.fedoraproject.org/en-US/quick-docs/virtualization-getting-started/

If you want to see if everything else is correct in your configuration, and it is indeed a kvm issue, then you could try disabling the kvm check with the environment variable below. But i say this with caution. It will run super slow and i did not see this in the docs and may not be officially supported. I would only attempt with XP just as a proof of concept or troubleshooting step. Then you will know the rest of your config is ok, and it is indeed related to a virtualization issue. If you see the os loading, then you can abort and work on the rest of your troubleshooting to figure out if or what needs done to enable kvm.

I wasn't sure how to format below, but you should be able to understand the context. environment: VERSION: "winxp" KVM: "N"