How to setup KVM on Debian Bullseye

In this article I will show how to setup Kernelbased Virtual Machine on Debian Bullseye. KVM is a virtualization environment that can be used to create and run virtual machines on a linux host.

First you need to check if your System has the Intel-VT or AMD-V instruction set. KVM can not run without it. You can check if your system supports the instruction set by running following commands:

su root
apt-get install msr-tools
/usr/sbin/modprobe msr
/usr/sbin/rdmsr 0x3a

If the result of the last command is 3 or 5 then the instruction set is supported and you can continue to install the hypervisor:

apt-get install qemu-kvm

If you have xorg installed and running, you can also install the KVM GUI which allows a more comfortable configuration:

apt-get install virt-manager
You now can configure and run virtual machines from the GUI.

When you try to start a virtual machine and get following message

failed to initialize: permission denied

you maybe resolve this problem by restarting the KVM kernel modules:

rmmod kvm_intel
rmmod kvm
modprobe kvm
modprobe kvm_intel

Related articles