In this guide, we will learn how to Install KVM Hypervisor Virtualization server on Debian 10 (Buster). KVM (Kernel-based Virtual Machine) is an open source full virtualization solution for Linux Systems running on x86 hardware with virtualization extensions (Intel VT or AMD-V).

For other systems: How to install KVM on Fedora, RHEL/CentOS 8, Ubuntu

KVM requires that you have the CPU on your computer which has a function Intel VT or AMD-V. KVM consists of a loadable kernel module,kvm.ko, that provides the core virtualization infrastructure and a processor specific module, kvm-intel.ko or kvm-amd.ko.

Install KVM / QEMU on Debian 10 (Buster)

Follow the steps below to install KVM Virtualization on Debian 10 (Buster) Linux system. All KVM packages for Debian are available on upstream repositories. The apt package manager is used for all packages installation.

sudo apt -y install qemu-kvm libvirt-daemon  bridge-utils virtinst libvirt-daemon-system

Load and enable the vhost_net module.

$ sudo modprobe vhost_net 
$ lsmod | grep vhost
vhost_net              24576  0
tun                    49152  1 vhost_net
vhost                  49152  1 vhost_net
tap                    28672  1 vhost_net

$ echo vhost_net | sudo tee -a /etc/modules 

Let’s also install useful Virtual Machine management tools.

sudo apt -y install virt-top libguestfs-tools libosinfo-bin  qemu-system virt-manager

This will give you tools similar to Linux ls, cat, top command for use with Virtual Machines.

Create KVM Bridge on Debian (Optional)

For your Virtual Machines to talk to the outside world, a Linux bridge is required. Installation of KVM on Debian 10 creates a Linux bridge called virbr0. This can be used for all test environments.

But if you want to your VMs to be accessible over the network, you’ll need to create a bridge on physical network interface attached to your machine.

Create one on your Debian server/workstation like below.

sudo nano /etc/network/interfaces

My bridge configuration uses a network interface (ens33) to create a Linux bridge called br1. Replace the values provided with yours.

# Primary network interface
auto ens33
iface ens3 inet manual

# Bridge definitions
auto br1
iface br1 inet static
bridge_ports ens33
bridge_stp off

Reboot your machine for the network configuration changes to take effect.

sudo reboot

Confirm ip network details.

$ ip addr

See screenshot below.

KVM Bridge Debian

Create Virtual Machine on KVM

You can use Virtual Machine Manager GUI to create an instance on KVM or via virt-install command line tool.

For virt-install, installation snippet is shared below.

$ sudo virt-install \
--name deb9-vm \
--ram 2048 \
--vcpus 2 \
--disk path=/var/lib/libvirt/images/deb9-vm.qcow2,size=20 \
--os-type linux \
--os-variant debian9 \
--network bridge=br1 \
--graphics none \
--console pty,target_type=serial \
--location '' \
--extra-args 'console=ttyS0,115200n8 serial'

This will download kernel and initrd image before starting installation.

deb installer kvm

The installation process will start shortly. Follow installation prompts for Debian system on KVM.

deb installer kvm 02
deb installer kvm 03

We also have a guide on Virtual Machine’s installation on KVM with Terraform.

Also check related KVM articles:

How to extend/increase KVM Virtual Machine (VM) disk size

How to Create CentOS / Fedora / RHEL VM Templates on KVM

How to run Minikube on KVM

Install VirtualBox on Debian 10

Your support is our everlasting motivation,
that cup of coffee is what keeps us going!

As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.


Please enter your comment!
Please enter your name here