Are you ready to turn your Linux system into a hypervisor that can run multiple isolated virtual machines? With Kernel-based Virtual Machine (KVM) technology, you can do just that! And in this step-by-step guide, we’ll show you how to configure and install KVM on Debian 11 Bullseye Linux.
Steps to Install and Enable KVM on Debian 11 Bullseye
1. Confirm Virtualization Support
Before embarking on configuring and installing KVM, let’s check if your system has the Intel VT or AMD-V function enabled. Run the command below in the terminal:
egrep -c ‘(vmx | svm)’ /proc/cpuinfogrep -E –color ‘(vmx | svm)’ /proc/cpuinfo
If the output is zero or less than expected, enable virtualization in the BIOS and then run the command again to confirm support.
2. Run System Update
Update your system by running the following command:
sudo apt update
3. Install QEMU-KVM and Libvirt on Debian 11 Bullseye
Let’s now install the required software on Debian 11 Bullseye:
sudo apt install qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virtinst libvirt-daemon
4. Install Virt-Manager GUI for KVM (Optional)
If you prefer using a graphical user interface, you can install Virt-Manager:
sudo apt install virt-manager -y
5. Make Network Active and Restart Automatically
Activate and set up the network automatically with the following commands:
sudo virsh net-start defaultsudo vrish net-autostart default
6. Add “vhost_net” (Optional)
You can add “vhost_net” kernel to improve network data transfer performance:
sudo modprobe vhost_net
Frequently Asked Questions
What is KVM?
Kernel-based Virtual Machine (KVM) is an open-source virtualization technology that allows you to create and run virtual machines on Linux systems by turning the Linux kernel into a hypervisor.
Is virtualization supported on my system?
You can check if your system has the Intel VT or AMD-V function enabled by running the command “egrep -c ‘(vmx | svm)’ /proc/cpuinfogrep -E –color ‘(vmx | svm)’ /proc/cpuinfo” in the terminal. If the output is more than zero, your system supports virtualization. Otherwise, enable virtualization in the BIOS and check again.