What KVM virtualisation is and how it works
Virtualisation on Linux is built on KVM, a kernel module that turns the kernel into a hypervisor. QEMU processes run on top of it, one per virtual machine. The machines are managed by libvirt or by the Proxmox VE platform, which adds a web interface, clustering and backups.
Layers: from hardware to guest
KVM needs a processor with hardware virtualisation: Intel VT-x or AMD-V on x86. Without hardware support the module does not work. With KVM loaded, the Linux kernel gives each QEMU process a share of the processor and memory so that the guest OS believes it is running on separate hardware.
QEMU is a computer emulator: a QEMU process presents the guest with a motherboard, disks and network cards. KVM accelerates only the processor and memory; QEMU emulates the other devices itself. libvirt is a common API and toolset for managing virtualisation; virsh and virt-manager work through it.
Proxmox VE is a platform built on Debian with its own management layer: a web interface, a REST API and the qm and pct commands. It also adds a cluster of several nodes, live migration and backups without separate tools. It runs LXC containers on the same kernel: a container has no kernel of its own, and its processes run on the host kernel.
Virtual machine and LXC container
Both isolate a workload, but in different ways: a machine carries its own kernel and a full OS, while a container shares the host kernel with other containers.
| Feature | Virtual machine | LXC container |
|---|---|---|
| Kernel | its own for each machine | the host kernel, shared |
| What is inside | a full OS: kernel, drivers, programs | application processes and files |
| Isolation | KVM hardware virtualisation | host kernel namespaces |
| Overhead | higher: the kernel and OS take memory | low |
| OS inside | Linux, Windows, BSD | Linux only |
| Backup | the whole disk, including the guest OS | the file system, without a kernel |
Choose a machine when you need a different OS, a kernel of your own or full isolation: a Windows server, a separate kernel for a firewall, a RouterOS CHR router. Choose a container when the guest is Linux and saving resources matters: databases, web applications, services. The two are often combined: machines for foreign operating systems and strict isolation, containers for services on the same host.
Which to choose
Choose Proxmox VE when you have several servers and need to manage them as a fleet: a cluster, live migration, backups and a web interface. It also suits a single node: all administration is done in the browser, and you can add the cluster later.
Choose libvirt without Proxmox VE when you have a single host and need automation: virsh in scripts, an API for your own code. There is no web panel; libvirt can also manage a remote host over secure protocols.
# check the processor for hardware virtualisationlscpu | grep -E 'VT-x|AMD-V' # list the machines on a libvirt hostvirsh list --allVirtIO and the guest agent
The guest recognises paravirtualised VirtIO devices and works with them in cooperation with the hypervisor: disk and network are noticeably faster than with emulated devices. The guest agent (QEMU Guest Agent) inside the guest passes OS details and IP addresses to the host, freezes the file system before a snapshot or backup, and shuts the machine down cleanly.
What to know beforehand
- The Linux command line: files, permissions, processes (see the Linux reference).
- Networking: addressing, bridges and VLANs (see the Linux reference, “Networking” section).
- Disks and file systems: LVM, ZFS (see the Linux reference).
Section sources
the section is written from these pages- Introduction — Proxmox VE Administration Guidepve.proxmox.com/pve-docs/chapter-pve-intro.html(opens in a new tab)
- QEMU/KVM Virtual Machines — Proxmox VE Administration Guidepve.proxmox.com/pve-docs/chapter-qm.html(opens in a new tab)
- Terminology and goalslibvirt.org/goals.html(opens in a new tab)
- Introduction — QEMU documentationqemu.org/docs/master/system/introduction.html(opens in a new tab)
- System requirements — Proxmox VEpve.proxmox.com/wiki/System_Requirements(opens in a new tab)