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/kvm
is accessibleRun the following command to check if
/dev/kvm
exists: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/kvm
Notice 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 $USER
Replace $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
$ make
cd kvm
./kvm bzImage initramfs-busybox-x86.cpio.gz