Skip to content

Installing QEMU / KVM on Ubuntu

Checking Prerequisites

Check if CPU supports virtualization

lscpu | grep Virtualization

:::info if the out put is

  1. Virtualization type: full then CPU supports virtualization.
  2. Virtualization: AMD-V or Virtualization: VT-x then CPU supports Virtualization also enabled :::

Confirming CPU Virtualization enabled in BIOS

egrep -c '(vmx|svm)' /proc/cpuinfo

:::info If output is 0 then CPU virtualization is disabled or not supported :::

Checking if KVM modules are loaded

lsmod | grep kvm

:::info If KVM modules are loaded the system starts acting as Hypervisor

If not loaded then performance is slow because of software emulation :::

Manually loading KVM modules

for intel CPU
sudo modprobe kvm
sudo modprobe kvm_intel
for AMD CPU
sudo modprobe kvm
sudo modprobe kvm_amd

:::info To get more information of kvm module

sudo modinfo kvm
:::


Installing QEMU/KVM

sudo apt install \
 qemu-kvm \
 qemu-system-x86 \
 qemu-utils \
 libvirt-daemon-system \
 bridge-utils \
 libvirt-clients \
 virtinst \
 qemu-utils \
 virt-manager \
 virt-viewer \
 ovmf \
 swtpm \
 guestfs-tools \
 libosinfo-bin

Explanation of the Packages Installed


Package RHEL / CentOS / Rocky Debian / Ubuntu
qemu-kvm qemu-system-x86
libvirt libvirt-daemon-system
virt-install virtinst

Post Installation

Validating the installation

sudo virt-host-validate qemu

Start and Enable the libvirt service

sudo systemctl start libvirtd
sudo systemctl enable libvirtd

Check the Status

systemctl status libvirtd

Add current user to libvirt and kvm group

sudo usermod -aG libvirt,kvm $USER

Start fresh session

su $USER

Validate kvm host

virt-host-validate