"/dev/kvm": no such file or directory #100

Closed
opened 2025-12-28 23:24:17 +01:00 by adam · 26 comments
Owner

Originally created by @xiaoqi7s on GitHub (Jan 18, 2021).

docker run --device /dev/kvm --device /dev/snd -v /tmp/.X11-unix:/tmp/.X11-unix -e "DISPLAY=${DISPLAY:-:0.0}" sickcodes/docker-osx:latest
docker: Error response from daemon: error gathering device information while adding custom device "/dev/kvm": no such file or directory.
ERRO[0000] error waiting for container: context canceled

Originally created by @xiaoqi7s on GitHub (Jan 18, 2021). docker run --device /dev/kvm --device /dev/snd -v /tmp/.X11-unix:/tmp/.X11-unix -e "DISPLAY=${DISPLAY:-:0.0}" sickcodes/docker-osx:latest docker: Error response from daemon: error gathering device information while adding custom device "/dev/kvm": no such file or directory. ERRO[0000] error waiting for container: context canceled
adam closed this issue 2025-12-28 23:24:17 +01:00
Author
Owner

@sickcodes commented on GitHub (Jan 18, 2021):

You need to install kvm https://github.com/sickcodes/Docker-OSX#requirements-kvm-on-the-host

@sickcodes commented on GitHub (Jan 18, 2021): You need to install kvm https://github.com/sickcodes/Docker-OSX#requirements-kvm-on-the-host
Author
Owner

@xiaoqi7s commented on GitHub (Jan 18, 2021):

My system is centos and I installed it with command :
sudo yum install libvirt qemu-kvm
sudo systemctl enable libvirtd.service
sudo systemctl enable virtlogd.service
sudo modprobe kvm
reboot

when I run docker,it's error:

docker: Error response from daemon: error gathering device information while adding custom device "/dev/kvm": no such file or directory.
ERRO[0000] error waiting for container: context canceled 
@xiaoqi7s commented on GitHub (Jan 18, 2021): My system is centos and I installed it with command : sudo yum install libvirt qemu-kvm sudo systemctl enable libvirtd.service sudo systemctl enable virtlogd.service sudo modprobe kvm reboot when I run docker,it's error: ``` docker: Error response from daemon: error gathering device information while adding custom device "/dev/kvm": no such file or directory. ERRO[0000] error waiting for container: context canceled ```
Author
Owner

@sickcodes commented on GitHub (Jan 25, 2021):

Is this a server or desktop? This happens when your CPU does not support hardware virtualization.

Try a different server, like Digital Ocean, which works perfectly.

@sickcodes commented on GitHub (Jan 25, 2021): Is this a server or desktop? This happens when your CPU does not support hardware virtualization. Try a different server, like Digital Ocean, which works perfectly.
Author
Owner

@ghasemikasra39 commented on GitHub (Apr 3, 2021):

I am getting the same error on Ubuntu 20.04.2.0 LTS . The command I run:

sudo docker run --device /dev/kvm --device /dev/snd -v /tmp/X11-unix:/tmp/X11-unix -e "DISPLAY=${DISPLAY:-:0.0}" sickcodes/docker-osx:latest

The output I get:

docker: Error response from daemon: error gathering device information while adding custom device "/dev/kvm": no such file or directory.
ERRO[0001] error waiting for container: context canceled 

What I tried:

sudo apt install qemu qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager

sudo systemctl enable --now libvirtd
sudo systemctl enable --now virtlogd

echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs

sudo modprobe kvm
@ghasemikasra39 commented on GitHub (Apr 3, 2021): I am getting the same error on `Ubuntu 20.04.2.0 LTS` . The command I run: ```bash sudo docker run --device /dev/kvm --device /dev/snd -v /tmp/X11-unix:/tmp/X11-unix -e "DISPLAY=${DISPLAY:-:0.0}" sickcodes/docker-osx:latest ``` The output I get: ```bash docker: Error response from daemon: error gathering device information while adding custom device "/dev/kvm": no such file or directory. ERRO[0001] error waiting for container: context canceled ``` What I tried: ```bash sudo apt install qemu qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager sudo systemctl enable --now libvirtd sudo systemctl enable --now virtlogd echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs sudo modprobe kvm ```
Author
Owner

@sickcodes commented on GitHub (Apr 4, 2021):

I am getting the same error on Ubuntu 20.04.2.0 LTS . The command I run:


sudo docker run --device /dev/kvm --device /dev/snd -v /tmp/X11-unix:/tmp/X11-unix -e "DISPLAY=${DISPLAY:-:0.0}" sickcodes/docker-osx:latest



The output I get:


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

ERRO[0001] error waiting for container: context canceled 

What I tried:


sudo apt install qemu qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager



sudo systemctl enable --now libvirtd

sudo systemctl enable --now virtlogd



echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs



sudo modprobe kvm

The server does not support KVM, which cloud is it?

@sickcodes commented on GitHub (Apr 4, 2021): > I am getting the same error on `Ubuntu 20.04.2.0 LTS` . The command I run: > > > > ```bash > > sudo docker run --device /dev/kvm --device /dev/snd -v /tmp/X11-unix:/tmp/X11-unix -e "DISPLAY=${DISPLAY:-:0.0}" sickcodes/docker-osx:latest > > > > ``` > > > > The output I get: > > ```bash > > docker: Error response from daemon: error gathering device information while adding custom device "/dev/kvm": no such file or directory. > > ERRO[0001] error waiting for container: context canceled > > ``` > > > > What I tried: > > > > ```bash > > sudo apt install qemu qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager > > > > sudo systemctl enable --now libvirtd > > sudo systemctl enable --now virtlogd > > > > echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs > > > > sudo modprobe kvm > > ``` The server does not support KVM, which cloud is it?
Author
Owner

@mgkha commented on GitHub (May 5, 2021):

I am getting the same error on Ubuntu 20.04.2.0 LTS . The command I run:

sudo docker run --device /dev/kvm --device /dev/snd -v /tmp/X11-unix:/tmp/X11-unix -e "DISPLAY=${DISPLAY:-:0.0}" sickcodes/docker-osx:latest

The output I get:

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

ERRO[0001] error waiting for container: context canceled 

What I tried:

sudo apt install qemu qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager



sudo systemctl enable --now libvirtd

sudo systemctl enable --now virtlogd



echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs



sudo modprobe kvm

The server does not support KVM, which cloud is it?

I got the same error on digital ocean.

@mgkha commented on GitHub (May 5, 2021): > > I am getting the same error on `Ubuntu 20.04.2.0 LTS` . The command I run: > > ```shell > > sudo docker run --device /dev/kvm --device /dev/snd -v /tmp/X11-unix:/tmp/X11-unix -e "DISPLAY=${DISPLAY:-:0.0}" sickcodes/docker-osx:latest > > ``` > > > > > > The output I get: > > ```shell > > docker: Error response from daemon: error gathering device information while adding custom device "/dev/kvm": no such file or directory. > > > > ERRO[0001] error waiting for container: context canceled > > ``` > > > > > > What I tried: > > ```shell > > sudo apt install qemu qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager > > > > > > > > sudo systemctl enable --now libvirtd > > > > sudo systemctl enable --now virtlogd > > > > > > > > echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs > > > > > > > > sudo modprobe kvm > > ``` > > The server does not support KVM, which cloud is it? I got the same error on digital ocean.
Author
Owner

@sickcodes commented on GitHub (May 9, 2021):

This sets you up on Digital Ocean,

https://github.com/sickcodes/Docker-OSX/blob/master/tests/test.sh

Just ignore the docker push commands at the end.

@sickcodes commented on GitHub (May 9, 2021): This sets you up on Digital Ocean, https://github.com/sickcodes/Docker-OSX/blob/master/tests/test.sh Just ignore the `docker push` commands at the end.
Author
Owner

@howthegodschill commented on GitHub (Oct 18, 2021):

Currently running Centos 7 with an Intel CPU and full virtualization support and am running into this same issue

@howthegodschill commented on GitHub (Oct 18, 2021): Currently running Centos 7 with an Intel CPU and full virtualization support and am running into this same issue
Author
Owner

@sickcodes commented on GitHub (Oct 18, 2021):

I am using compute optimized instances, I don't believe the lower image tiers support nested virtualization.

@sickcodes commented on GitHub (Oct 18, 2021): I am using compute optimized instances, I don't believe the lower image tiers support nested virtualization.
Author
Owner

@ZGuQing commented on GitHub (Apr 3, 2022):

You need to install kvm https://github.com/sickcodes/Docker-OSX#requirements-kvm-on-the-host
How to install kvm?

@ZGuQing commented on GitHub (Apr 3, 2022): > You need to install kvm https://github.com/sickcodes/Docker-OSX#requirements-kvm-on-the-host How to install kvm?
Author
Owner

@ZGuQing commented on GitHub (Apr 3, 2022):

You need to install kvm https://github.com/sickcodes/Docker-OSX#requirements-kvm-on-the-host
How to install kvm? macos

@ZGuQing commented on GitHub (Apr 3, 2022): > > You need to install kvm https://github.com/sickcodes/Docker-OSX#requirements-kvm-on-the-host > > How to install kvm? macos
Author
Owner

@dm-for-git commented on GitHub (Aug 7, 2022):

It seems a silly question but can I use this image on a Monterey macOS host machine running on a M1 pro macbook?
Because I got the same error when trying to install your Monterey image
error gathering device information while adding custom device "/dev/kvm": no such file or directory

@dm-for-git commented on GitHub (Aug 7, 2022): It seems a silly question but can I use this image on a Monterey macOS host machine running on a M1 pro macbook? Because I got the same error when trying to install your Monterey image ` error gathering device information while adding custom device "/dev/kvm": no such file or directory`
Author
Owner

@ghost commented on GitHub (Sep 19, 2022):

Hi everyone!

I'm trying to install BLISSOS on Linux Mint 20.3, Kernel 5.4.0-125, Intel i3-7100. Nvidia GP107, 8Gb RAM

I do every step as indicated in https://docs.blissos.org/install-bliss-os/run-from-docker

But I'm stucked on

docker run -it
--device /dev/kvm
-v /tmp/.X11-unix:/tmp/.X11-unix
-e RAM=4
-e "DISPLAY=${DISPLAY:-:0.0}"
-p 5555:5555
sickcodes/dock-droid:latest

docker: Error response from daemon: error gathering device information while adding custom device "/dev/kvm": **not a device node**.

ERRO[0000] error waiting for container: context canceled

Any help?

@ghost commented on GitHub (Sep 19, 2022): Hi everyone! I'm trying to install BLISSOS on Linux Mint 20.3, Kernel 5.4.0-125, Intel i3-7100. Nvidia GP107, 8Gb RAM I do every step as indicated in https://docs.blissos.org/install-bliss-os/run-from-docker But I'm stucked on docker run -it \ --device /dev/kvm \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e RAM=4 \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -p 5555:5555 \ sickcodes/dock-droid:latest docker: Error response from daemon: error gathering device information while adding custom device "/dev/kvm": **not a device node**. ERRO[0000] error waiting for container: context canceled Any help?
Author
Owner

@Areopagitics commented on GitHub (Dec 8, 2022):

I get the same error on PopOS (Ubuntu 22.04)

@Areopagitics commented on GitHub (Dec 8, 2022): I get the same error on PopOS (Ubuntu 22.04)
Author
Owner

@Tyree commented on GitHub (Dec 12, 2022):

Same. I'm no linux pro, but I've done everything I can find to do and I still get the "no such file or directory" for /dev/kvm. But it's there. I have taken ownership of it. kvm-ok says I'm good to go. Check CPU capabilities is good. I'm at a loss.

@Tyree commented on GitHub (Dec 12, 2022): Same. I'm no linux pro, but I've done everything I can find to do and I still get the "no such file or directory" for /dev/kvm. But it's there. I have taken ownership of it. kvm-ok says I'm good to go. Check CPU capabilities is good. I'm at a loss.
Author
Owner

@Areopagitics commented on GitHub (Dec 16, 2022):

Same. I'm no linux pro, but I've done everything I can find to do and I still get the "no such file or directory" for /dev/kvm. But it's there. I have taken ownership of it. kvm-ok says I'm good to go. Check CPU capabilities is good. I'm at a loss.

exactly the same

@Areopagitics commented on GitHub (Dec 16, 2022): > Same. I'm no linux pro, but I've done everything I can find to do and I still get the "no such file or directory" for /dev/kvm. But it's there. I have taken ownership of it. kvm-ok says I'm good to go. Check CPU capabilities is good. I'm at a loss. exactly the same
Author
Owner

@youssef-sobhy commented on GitHub (Dec 19, 2022):

has anyone been able to fix this issue? facing the same issue on PopOS 22.04

@youssef-sobhy commented on GitHub (Dec 19, 2022): has anyone been able to fix this issue? facing the same issue on PopOS 22.04
Author
Owner

@Areopagitics commented on GitHub (Dec 20, 2022):

I just tried it using the docker CLI and now it boots up to In Memory Stackshot Suceeded

STAY AWAY FROM DOCKER DESKTOP and make sure to use sudo before the docker command

https://docs.docker.com/engine/install/ubuntu/#set-up-the-repository
errors

@Areopagitics commented on GitHub (Dec 20, 2022): I just tried it using the docker CLI and now it boots up to `In Memory Stackshot Suceeded` STAY AWAY FROM DOCKER DESKTOP and make sure to use sudo before the docker command https://docs.docker.com/engine/install/ubuntu/#set-up-the-repository ![errors](https://user-images.githubusercontent.com/24683841/208550501-f1eb8126-a709-4241-89ef-599decf07970.jpg)
Author
Owner

@sickcodes commented on GitHub (Dec 20, 2022):

Can you show me which Docker version? I may need to update Docs about secomp and privileged use

@sickcodes commented on GitHub (Dec 20, 2022): Can you show me which Docker version? I may need to update Docs about secomp and privileged use
Author
Owner

@Areopagitics commented on GitHub (Dec 20, 2022):

docker -v outputs

Docker version 20.10.22, build 3a2c30b

I am also using PopOs 22.04 (Ubuntu based) on a Ryzen 9 4900h laptop (Asus TUF506IV)

@Areopagitics commented on GitHub (Dec 20, 2022): docker -v _outputs_ `Docker version 20.10.22, build 3a2c30b ` I am also using PopOs 22.04 (Ubuntu based) on a Ryzen 9 4900h laptop (Asus TUF506IV)
Author
Owner

@ChristopherSargent commented on GitHub (Jan 14, 2023):

If you are using a virtual machine the above error is likely due to nested virtualization being disabled (as the automatic selection by the hypervisor is usually to disable it). This can be enabled on KVM and VMware. Below are screenshots of examples.

vCenter with esxi host:
image

KVM ubuntu host:
image

Once enabled you will get the following when running the command:
echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs && modprobe kvm
1

instead of

echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs && modprobe kvm
INFO: Your CPU does not support KVM extensions KVM acceleration can NOT be used

or
kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used

instead of

kvm-ok
INFO: Your CPU does not support KVM extensions
KVM acceleration can NOT be used

@ChristopherSargent commented on GitHub (Jan 14, 2023): If you are using a virtual machine the above error is likely due to nested virtualization being disabled (as the automatic selection by the hypervisor is usually to disable it). This can be enabled on KVM and VMware. Below are screenshots of examples. vCenter with esxi host: ![image](https://user-images.githubusercontent.com/75126362/212473469-8db7f15e-95b4-4e8c-8c16-64b3fdeef95f.png) KVM ubuntu host: ![image](https://user-images.githubusercontent.com/75126362/212470332-73ae1ab6-d324-406d-b0f1-23b84924b3ff.png) Once enabled you will get the following when running the command: echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs && modprobe kvm 1 instead of echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs && modprobe kvm INFO: Your CPU does not support KVM extensions KVM acceleration can NOT be used or kvm-ok INFO: /dev/kvm exists KVM acceleration can be used instead of kvm-ok INFO: Your CPU does not support KVM extensions KVM acceleration can NOT be used
Author
Owner

@AZetZ commented on GitHub (Jan 26, 2024):

To solve problem you can go to BIOS and change settings. For my AMD processor I needed to enabled the AMD V Technology.

@AZetZ commented on GitHub (Jan 26, 2024): To solve problem you can go to BIOS and change settings. For my AMD processor I needed to enabled the AMD V Technology.
Author
Owner

@CrypticGuru commented on GitHub (Mar 3, 2024):

To solve problem you can go to BIOS and change settings. For my AMD processor I needed to enabled the AMD V Technology.

I also had to enable virtualization in my BIOS for this to work (sudo kvm-ok hinted to me that it wasn't enabled). You'll have to google how to do this for your specific BIOS version, but this solved it for me!

@CrypticGuru commented on GitHub (Mar 3, 2024): > To solve problem you can go to BIOS and change settings. For my AMD processor I needed to enabled the AMD V Technology. I also had to enable virtualization in my BIOS for this to work (`sudo kvm-ok` hinted to me that it wasn't enabled). You'll have to google how to do this for your specific BIOS version, but this solved it for me!
Author
Owner

@heruit777 commented on GitHub (Mar 14, 2024):

I just tried it using the docker CLI and now it boots up to In Memory Stackshot Suceeded

STAY AWAY FROM DOCKER DESKTOP and make sure to use sudo before the docker command

https://docs.docker.com/engine/install/ubuntu/#set-up-the-repository errors

I used sudo before docker command and it worked for me. Thank you!

@heruit777 commented on GitHub (Mar 14, 2024): > I just tried it using the docker CLI and now it boots up to `In Memory Stackshot Suceeded` > > STAY AWAY FROM DOCKER DESKTOP and make sure to use sudo before the docker command > > https://docs.docker.com/engine/install/ubuntu/#set-up-the-repository ![errors](https://user-images.githubusercontent.com/24683841/208550501-f1eb8126-a709-4241-89ef-599decf07970.jpg) I used sudo before docker command and it worked for me. Thank you!
Author
Owner

@ChronSyn commented on GitHub (Jul 22, 2024):

In case anyone is searching for an Unraid-specific solution, make sure VM support is enabled (Settings -> VM Management).

If enabled is set to 'false', the /dev/kvm path isn't present, and this container and other 'InDocker'-like containers will fail to start due to the missing path.

To resolve, set 'enabled' to 'true'.

@ChronSyn commented on GitHub (Jul 22, 2024): In case anyone is searching for an Unraid-specific solution, make sure VM support is enabled (Settings -> VM Management). If enabled is set to 'false', the `/dev/kvm` path isn't present, and this container and other '<OS>InDocker'-like containers will fail to start due to the missing path. To resolve, set 'enabled' to 'true'.
Author
Owner

@chriscarrollsmith commented on GitHub (Dec 2, 2024):

I just tried it using the docker CLI and now it boots up to In Memory Stackshot Suceeded
STAY AWAY FROM DOCKER DESKTOP and make sure to use sudo before the docker command
https://docs.docker.com/engine/install/ubuntu/#set-up-the-repository errors

I used sudo before docker command and it worked for me. Thank you!

This fixed it for me; thank you!

@chriscarrollsmith commented on GitHub (Dec 2, 2024): > > I just tried it using the docker CLI and now it boots up to `In Memory Stackshot Suceeded` > > STAY AWAY FROM DOCKER DESKTOP and make sure to use sudo before the docker command > > https://docs.docker.com/engine/install/ubuntu/#set-up-the-repository ![errors](https://user-images.githubusercontent.com/24683841/208550501-f1eb8126-a709-4241-89ef-599decf07970.jpg) > > I used sudo before docker command and it worked for me. Thank you! This fixed it for me; thank you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Docker-OSX#100