sickcodes / Docker-OSX

Run macOS VM in a Docker! Run near native OSX-KVM in Docker! X11 Forwarding! CI/CD for OS X Security Research! Docker mac Containers.
https://hub.docker.com/r/sickcodes/docker-osx
GNU General Public License v3.0
48.79k stars 2.72k forks source link

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

Open iEscapedVim opened 8 months ago

iEscapedVim commented 8 months ago
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.

Mx772 commented 7 months ago

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

iEscapedVim commented 7 months ago

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.

sickcodes commented 7 months ago

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

iEscapedVim commented 7 months ago

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

The error was on debian

Masonchis commented 6 months ago

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.

iEscapedVim commented 6 months ago

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.

YtachY commented 1 month ago

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