Skip to content

KVM setup in ubuntu

KVM (Kernel Virtual Machine) is a module in the linux kernel that helps us run virtual machines at native speed. You can check if you machine supports virtualization with the following command

lscpu | grep -E 'vmx|svm'

jargons in the KVM world

  • KVM - Kernel Module that helps CPU run virtual machines at near-native speed
  • Qemu - Emulator that mimics hardware for the VM to use
  • libvirtd - Management daemon translator (API/Service) that provides consistent way to talk to KVM/Qemu
  • virt-tools - cli tools for managing VMs via the terminal
  • virt-manager - dashoard to click buttons to create and manage virtual machines
  • virsh - cli used to create, pause, shutdown and edit virtual machines

install KVM and core packages

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

enable and start libvirtd

sudo systemctl enable --now libvirtd
sudo systemctl status libvirtd

add user to groups

add user to the KVM and libvirtd groups so that we don't need sudo for every actions

sudo adduser ${USER} kvm
sudo adduser ${USER} libvirt