How to Install KVM, QEMU and Libvirt on Debian 12 (Bookworm)
If you want to install KVM QEMU and Libvirt on Debian 12, this guide will help you step by step. We will use Debian GNU/Linux 12 (Bookworm) for all future examples in this series.
Therefore, make sure you install the correct Debian version. This ensures consistency across all tutorials.
Step 1: Create a Debian 12 Virtual Machine
Before you install KVM, you need a working Debian system.
You can create a VM using:
UTM (for macOS users)
VirtualBox (for Windows users)
Proxmox VE (if you already have a home lab server)
However, if you already run Linux on bare metal, you can skip this step.
Minimum VM Requirements
Use the following minimum specifications for Debian GNU/Linux 12 (Bookworm):
| Resource | Minimum Requirement | Recommended |
|---|---|---|
| CPU | 2 vCPU | 4 vCPU |
| RAM | 2 GB | 4 GB |
| Storage | 20 GB | 40 GB |
| Network | NAT or Bridged | Bridged |
Because virtualization needs resources, avoid using less than 2 GB RAM.
Step 2: Install Debian GNU/Linux 12 (Bookworm)
Download and install:
Debian GNU/Linux 12 (Bookworm)
Choose:
Standard system utilities
SSH server (recommended)
After installation, update the system:
```bashsudo apt update && sudo apt upgrade -y
1
2
3
4
5
6
7
8
9
This ensures your system has the latest security updates.
## Step 3: Verify CPU Virtualization Support
Before you install [KVM QEMU](https://www.qemu.org/documentation/) and Libvirt on Debian 12, check CPU support.
Run:
bxtgeek@Orion:~$ egrep -c ‘(vmx|svm)’ /proc/cpuinfo2
1
2
3
4
5
6
7
8
9
10
If the output is **1 or higher**, virtualization is supported.
If you see 0, enable virtualization in BIOS or UEFI.
## Step 4: Install KVM, QEMU and Libvirt
Now install the required packages:
```bashsudo apt install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils virtinst -y
This installs:
KVM kernel module
QEMU hypervisor
Libvirt service
Network bridge utilities
VM creation tools
After installation, enable and start libvirt:
```bashsudo systemctl enable libvirtdsudo systemctl start libvirtd
1
2
3
4
Then verify:
```bashsudo systemctl status libvirtd
Step 5: Add Your User to Libvirt Group
To avoid using sudo every time, add your user:
```bashsudo usermod -aG libvirt $USERsudo usermod -aG kvm $USER
1
2
3
4
5
6
7
8
9
10
Log out and log back in.
Because of this, you can manage VMs without root privileges.
## Step 6: Verify Installation
Check KVM support:
```bashvirsh list --all
If no error appears, the setup works correctly.
You can also verify:
1
lsmod | grep kvm
If you see kvm_intel or kvm_amd, KVM is active.
What Happens After Installation?
When you install KVM QEMU and Libvirt on Debian 12:
KVM provides hardware acceleration
QEMU runs virtual machines
Libvirt manages everything
Virsh allows CLI control
Therefore, you now have a complete virtualization stack.
FAQ Section
Why must I use Debian GNU/Linux 12 (Bookworm)?
Because all future examples in this series use Debian 12.
Can I install this on Debian 13?
Yes. However, commands may differ slightly.
Do I need a GUI?
No. You can manage everything using the terminal.
Is 2 GB RAM enough?
Yes, but 4 GB provides better performance.
Can I run this inside VirtualBox or UTM?
Yes. However, nested virtualization must be enabled.
Conclusion
In this guide, you learned how to install KVM QEMU and Libvirt on Debian 12 (Bookworm). You also created a proper virtual machine with minimum requirements.
Now your system is ready for virtualization. In the next article, we will create and manage virtual machines using virsh on Debian GNU/Linux 12.
