Before using KVM, you need to ensure that you have the necessary permissions to access /dev/kvm. This requires adding your user to the kvm group.
Follow these steps to add your user to the kvm group:
-
Check if
/dev/kvmis accessibleRun the following command to check if
/dev/kvmexists:ls -l /dev/kvm
If it exists, you should see something like this:
crw-rw----+ 1 root kvm 10, 232 Aug 17 12:34 /dev/kvmNotice that the group associated with /dev/kvm is kvm.
- Add your user to the kvm group:
Use the following command to add your user to the kvm group:
sudo usermod -aG kvm $USERReplace $USER with your username if you're not running the command as the intended user.
- Apply the changes
After adding yourself to the kvm group, you need to log out and log back in for the changes to take effect.
Alternatively, you can apply the changes immediately using:
newgrp kvm$ git clone https://github.com/x86driver/kvm
$ cd kvm
$ makecd kvm
./kvm bzImage initramfs-busybox-x86.cpio.gz