0% found this document useful (0 votes)
99 views3 pages

KVM + QEMU + Libvirt

The document provides an overview of the KVM, QEMU, and libvirt virtualization stack, explaining their roles and interactions. It includes command-line instructions for listing and creating VMs, checking if KVM is enabled, and installing QEMU on Debian/Ubuntu systems. Additionally, it outlines the necessary BIOS settings for enabling KVM functionality.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
99 views3 pages

KVM + QEMU + Libvirt

The document provides an overview of the KVM, QEMU, and libvirt virtualization stack, explaining their roles and interactions. It includes command-line instructions for listing and creating VMs, checking if KVM is enabled, and installing QEMU on Debian/Ubuntu systems. Additionally, it outlines the necessary BIOS settings for enabling KVM functionality.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

08/01/2025 09:21 KVM + QEMU + libvirt

KVM + QEMU + libvirt


The stack:

KVM: Linux kernel module that allows a user space program access to the hardware
virtualization features of various processors; allows the kernel to function as a hypervisor.
KVM itself emulates very little hardware, instead deferring to a higher level client
application such as QEMU.
QEMU: provides a set of different hardware and device models for the machine, supports
the emulation of various architectures; can boot many guest operating systems. QEMU =
Quick Emulator.
libvirt : the lib to manage KVM, Xen, VMware ESXi, QEMU.
virt-manager : using libvirt ; included in many linux distros.
kubevirt : brining VMs to k8s. Using libvirt + QEMU + KVM.

From Commandline

List VMs

Each VM started with qemu-system-x86_64 corresponds to a process on the host machine. This
means that a list of qemu-system-x86_64 processes corresponds to the list of VMs that are
currently running on the host.

$ ps -ef | grep qemu-system-x86_64

This will list all the qemu-system-x86_64 processes, their pids and the parameters used to start
the VM.

$ ps -ef | grep qemu-kvm

Create VMs

Emulates Intel x86 64-bit architecture.

$ qemu-system-x86_64

How to check if kvm is enabled?

[Link] 1/3
08/01/2025 09:21 KVM + QEMU + libvirt

Use kvm-ok to check if kvm is enabled?

$ kvm-ok

If kvm-ok is not available, you can get it by installing cpu-checker :

$ sudo apt install cpu-checker

If without kvm-ok :

$ ls /dev/kvm
$ lsmod | grep kvm

Check if CPU virtualization is enabled:

# Intel
# vmx=Virtual Machine Extensions
$ cat /proc/cpuinfo | grep vmx

# AMD
# svm=Secure Virtual Machine
$ cat /proc/cpuinfo | grep svm

How to enable KVM?

If you KVM is not running, make sure the virtualization features are enabled in BIOS:

SVM (Secure Virtual Machine) by AMD


Virtualization Technology by Intel
IOMMU: Input–output memory management unit

How to install QEMU?

On Debian / Ubuntu:

# Install qemu related packages

[Link] 2/3
08/01/2025 09:21 KVM + QEMU + libvirt

$ sudo apt install qemu-utils qemu-system-x86 qemu-system-gui

[Link] 3/3

You might also like