dockerdocker-composelinux-device-driverkvmmknod

Can you use /dev/kvm without adding it as a device?


If I add --device=/dev/kvm to the docker run command, I can access KVM. But is it also possible to do it without that parameter?

The reason I ask is because I recently found out I can access /dev/net/tun without specifying it as a --device just by using the mknod command to create that file from inside the container.

I hope its also possible to create /dev/kvm using mknod but I don't know how.


Solution

  • Have you tried mknod kvm c 10 232 ? you can find the major and minor number of any device by running ls -al /dev