"/dev/kvm": no such file or directory on Debian 12 #572

Open
opened 2025-12-29 01:22:16 +01:00 by adam · 7 comments
Owner

Originally created by @iEscapedVim on GitHub (Mar 8, 2024).

Linux Bimo 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux
:0
1
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_CODENAME=bookworm
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       466G   85G  381G  19% /mnt/myData
QEMU emulator version 7.2.9 (Debian 1:7.2+dfsg-7+deb12u5)
Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developers
libvirtd (libvirt) 9.0.0
               total        used        free      shared  buff/cache   available
Mem:           7.2Gi       6.3Gi       154Mi       2.1Gi       3.0Gi       884Mi
Swap:           14Gi       1.1Gi        13Gi
4
8
crw-rw----+ 1 root kvm 10, 232 Mar  8 10:10 /dev/kvm
total 16K
drwxrwxrwt  2 root root 4.0K Mar  8 10:01 .
drwxrwxrwt 21 root root  12K Mar  8 10:13 ..
srwxrwxrwx  1 root root    0 Mar  8 10:01 X0
zero       12430  0.0  0.0   6332  2120 pts/0    S+   10:16   0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox dockerd
kvm:x:104:zero
docker:x:996:zero
libvirt:x:129:zero
libvirt-qemu:x:64055:libvirt-qemu

Idk why am I getting this 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 

My device support virtualization it's an HP Elitebook 840 G3 6th Gen i5. docker is working kvm is ok user is add to both docker and kvm groups.

Originally created by @iEscapedVim on GitHub (Mar 8, 2024). ``` Linux Bimo 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux :0 1 PRETTY_NAME="Debian GNU/Linux 12 (bookworm)" NAME="Debian GNU/Linux" VERSION_CODENAME=bookworm Filesystem Size Used Avail Use% Mounted on /dev/sda1 466G 85G 381G 19% /mnt/myData QEMU emulator version 7.2.9 (Debian 1:7.2+dfsg-7+deb12u5) Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developers libvirtd (libvirt) 9.0.0 total used free shared buff/cache available Mem: 7.2Gi 6.3Gi 154Mi 2.1Gi 3.0Gi 884Mi Swap: 14Gi 1.1Gi 13Gi 4 8 crw-rw----+ 1 root kvm 10, 232 Mar 8 10:10 /dev/kvm total 16K drwxrwxrwt 2 root root 4.0K Mar 8 10:01 . drwxrwxrwt 21 root root 12K Mar 8 10:13 .. srwxrwxrwx 1 root root 0 Mar 8 10:01 X0 zero 12430 0.0 0.0 6332 2120 pts/0 S+ 10:16 0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox dockerd kvm:x:104:zero docker:x:996:zero libvirt:x:129:zero libvirt-qemu:x:64055:libvirt-qemu ``` Idk why am I getting this 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 ``` My device support virtualization it's an **HP Elitebook 840 G3** 6th Gen i5. docker is working kvm is ok user is add to both docker and kvm groups.
Author
Owner

@Mx772 commented on GitHub (Apr 7, 2024):

I know you opened this a month ago; but you likely don't have virtualization enabled in your bios.

@Mx772 commented on GitHub (Apr 7, 2024): I know you opened this a month ago; but you likely don't have virtualization enabled in your bios.
Author
Owner

@iEscapedVim commented on GitHub (Apr 7, 2024):

I have it enabled idk what the issue was I switched to Arch, I wanted to try using Debian because stable, but switched because of this issue.

@iEscapedVim commented on GitHub (Apr 7, 2024): I have it enabled idk what the issue was I switched to Arch, I wanted to try using Debian because stable, but switched because of this issue.
Author
Owner

@sickcodes commented on GitHub (Apr 8, 2024):

Installing extra/libvirt from Arch will give you this feature.

@sickcodes commented on GitHub (Apr 8, 2024): Installing `extra/libvirt` from Arch will give you this feature.
Author
Owner

@iEscapedVim commented on GitHub (Apr 8, 2024):

Installing extra/libvirt from Arch will give you this feature.

The error was on debian

@iEscapedVim commented on GitHub (Apr 8, 2024): > Installing `extra/libvirt` from Arch will give you this feature. The error was on debian
Author
Owner

@Masonchis commented on GitHub (May 6, 2024):

The error was on debian

were you able to figure it out, i seem to be having the same problem. I have Kvm installed, i have virtualization enabled in bios. I've ran a Mac OS virtual machine normally but I'm now trying to do it through docker as the USB connection seems simpler.

@Masonchis commented on GitHub (May 6, 2024): > The error was on debian were you able to figure it out, i seem to be having the same problem. I have Kvm installed, i have virtualization enabled in bios. I've ran a Mac OS virtual machine normally but I'm now trying to do it through docker as the USB connection seems simpler.
Author
Owner

@iEscapedVim commented on GitHub (May 11, 2024):

The error was on debian

were you able to figure it out, i seem to be having the same problem. I have Kvm installed, i have virtualization enabled in bios. I've ran a Mac OS virtual machine normally but I'm now trying to do it through docker as the USB connection seems simpler.

Am afraid I wasn't able to, I had to deliver work so I just hopped back to Arch.

@iEscapedVim commented on GitHub (May 11, 2024): > > The error was on debian > > were you able to figure it out, i seem to be having the same problem. I have Kvm installed, i have virtualization enabled in bios. I've ran a Mac OS virtual machine normally but I'm now trying to do it through docker as the USB connection seems simpler. Am afraid I wasn't able to, I had to deliver work so I just hopped back to Arch.
Author
Owner

@YtachY commented on GitHub (Oct 15, 2024):

Same problem here.

What happen with Debian 12 bookworms and Ubuntu 24.04?

I create VM in GCP and there some issues:

  1. Install necessary packages
sudo apt install **qemu** qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager libguestfs-tools

then get the output

Note, selecting 'qemu-system-x86' instead of 'qemu-kvm'
Package qemu is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'qemu' has no installation candidate
  1. Find qemu repo and change it via https://www.qemu.org/download/#linux
sudo apt install **qemu-system** qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager libguestfs-tools

then nothing happen and there is no folder '/dev/kvm' were created.

  1. Then, enable libvirt and load the KVM kernel module:
sudo systemctl enable --now libvirtd
sudo systemctl enable --now virtlogd

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

sudo modprobe kvm

the output is

tee: /sys/module/kvm/parameters/ignore_msrs: No such file or directory
1
  1. Reboot machine and there still no folder '/dev/kvm' so that when run docker there was error
Error response from daemon: error gathering device information while adding custom device "/dev/kvm": no such file or directory
@YtachY commented on GitHub (Oct 15, 2024): Same problem here. What happen with Debian 12 bookworms and Ubuntu 24.04? I create VM in GCP and there some issues: 1. Install necessary packages ``` sudo apt install **qemu** qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager libguestfs-tools ``` then get the output ``` Note, selecting 'qemu-system-x86' instead of 'qemu-kvm' Package qemu is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'qemu' has no installation candidate ``` 2. Find qemu repo and change it via https://www.qemu.org/download/#linux ``` sudo apt install **qemu-system** qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager libguestfs-tools ``` then nothing happen and there is no folder '/dev/kvm' were created. 3. Then, enable libvirt and load the KVM kernel module: ``` sudo systemctl enable --now libvirtd sudo systemctl enable --now virtlogd echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs sudo modprobe kvm ``` the output is ``` tee: /sys/module/kvm/parameters/ignore_msrs: No such file or directory 1 ``` 4. Reboot machine and there still no folder '/dev/kvm' so that when run docker there was error ``` Error response from daemon: error gathering device information while adding custom device "/dev/kvm": no such file or directory ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Docker-OSX#572