Short answer: KVM, the Kernel-based Virtual Machine, is the hypervisor built into the Linux kernel. Loading its module turns an ordinary Linux system into a host that runs virtual machines with hardware virtualisation (Intel VT-x or AMD-V), each with its own kernel and operating system — Linux, Windows or BSD. KVM has been part of mainline Linux since version 2.6.20 in 2007, it is free and open source, and it runs most of the world’s VPS hosting and a large part of the public cloud.
How does KVM work?
KVM is deliberately small. It does the parts only the kernel can do and leaves the rest to existing Linux pieces:
- The kernel modules.
kvm.koprovides the core, andkvm-intel.koorkvm-amd.kodrive the processor’s virtualisation extensions. Together they expose/dev/kvm, through which a program can create a VM, give it memory and run its virtual CPUs. - QEMU is that program in almost every setup. It sets up the virtual machine — firmware, disks, network cards, display — and calls into KVM to run the guest’s code directly on the CPU. Without KVM, QEMU emulates every instruction in software; with it, guests run at close to native speed.
- Linux itself does the rest. Each virtual machine is a normal process, each vCPU a thread of it, and guest RAM is that process’s memory. So the Linux scheduler, memory management, cgroups, NUMA placement and security modules (SELinux/AppArmor via sVirt) all apply to VMs for free.
Guests get the best I/O through virtio: paravirtual disk, network and memory-balloon devices designed for VMs rather than emulations of real hardware. Linux has the drivers built in; Windows guests need the virtio-win drivers from the Fedora project, which hosts usually preinstall in their templates.
KVM was written by Avi Kivity at Qumranet, announced in 2006 and merged into Linux quickly; Red Hat bought Qumranet in 2008. Because it is part of the kernel, it improves with every kernel release and runs on x86, Arm and other architectures.
Is KVM a type 1 or type 2 hypervisor?
Usually counted as type 1: the hypervisor is the Linux kernel itself, running on the hardware, not an application on top of an operating system. The argument for type 2 is that a full Linux userland runs on the host too. In practice the label matters less than what follows from it — KVM guests run directly on the CPU with hardware assistance, like those of Hyper-V or ESXi. The broader picture of types and how CPUs support them is in what is a hypervisor.
The KVM software stack
| Layer | What it is | Examples |
|---|---|---|
| Hypervisor | The kernel modules | kvm, kvm-intel, kvm-amd |
| VMM | Builds and runs each VM | QEMU; Firecracker and Cloud Hypervisor for micro-VMs |
| Management API | Defines, starts and stops VMs, networks and storage pools | libvirt (virsh, virt-install, virt-manager) |
| Platforms | Clusters, web UIs, multi-tenant clouds | Proxmox VE, OpenStack, oVirt, OpenNebula, KubeVirt |
Proxmox VE, which many people meet first, is a Debian-based distribution that puts a web interface, clustering and backups on top of KVM/QEMU (and LXC containers). The virtual machines underneath are plain KVM guests.
How do you check whether a machine can run KVM?
grep -Ec '(vmx|svm)' /proc/cpuinfo # >0: VT-x or AMD-V present
lsmod | grep kvm # kvm plus kvm_intel or kvm_amd loaded?
ls -l /dev/kvm # exists when KVM is usable
# Debian/Ubuntu: a one-line verdict
apt install -y cpu-checker && kvm-okIf the CPU flags are missing on a physical machine, enable Intel VT-x or AMD SVM in the firmware. Inside a VPS, the flags are only there when the provider enables nested virtualisation, so most VPS can run KVM guests only in slow, pure-emulation mode.
How do you create a KVM virtual machine?
On a Debian or Ubuntu host with libvirt:
apt install -y qemu-system-x86 libvirt-daemon-system virtinst
systemctl enable --now libvirtd
virt-install --name debian13 --memory 4096 --vcpus 2 \
--disk size=20 \
--cdrom /var/lib/libvirt/images/debian-13-amd64-netinst.iso \
--osinfo detect=on,require=off \
--network network=default --graphics vnc
virsh list --all # all defined VMs and their state
virsh dominfo debian13 # vCPUs, memory, state
virsh shutdown debian13 # ACPI shutdown, like pressing the power button
virsh autostart debian13 # start with the hostThe default network is a NAT-ed bridge (virbr0); for VMs that need their own public addresses you create a bridge on the host’s interface and attach VMs to it. That is also where a hosting provider’s job begins: IP allocation, storage, backups and isolation between customers.
What does KVM offer beyond running VMs?
- Live migration: a running VM can be copied to another host while it keeps working — memory is transferred in rounds, then the guest pauses for a moment and resumes on the new host. Providers use it to service hardware without shutting customers down.
- Snapshots: with qcow2 disk images or storage-level snapshots (LVM, ZFS, Ceph), a VM’s disk — optionally its memory too — can be saved and rolled back.
- Memory techniques: huge pages cut address-translation overhead for large guests, the virtio balloon driver lets the host reclaim memory a guest is not using, and KSM (kernel same-page merging) shares identical pages between guests.
- CPU control: vCPUs can be pinned to physical cores and NUMA nodes, and the CPU model presented to guests can be the host’s own (
host-passthrough) or a common baseline that allows migration between different processors. - Device passthrough: with an IOMMU, a GPU, NIC or NVMe drive can be handed to one guest through VFIO, at native speed.
What is a KVM VPS?
A VPS that is a KVM virtual machine: your own kernel, your own disk image, a fixed share of RAM and vCPUs, and the freedom to run any operating system and load kernel modules — WireGuard, Docker’s networking, custom firewalls. The alternative sold under the same “VPS” name is a container on a shared kernel, such as OpenVZ or LXC, which is cheaper to run and more limited. The practical differences, and how to tell which you have, are in KVM vs OpenVZ.
systemd-detect-virt # prints kvm on a KVM guest, openvz or lxc in a containerKVM compared with the other hypervisors
- Hyper-V is Microsoft’s equivalent, built into Windows Server; similar performance, Windows-centred tooling — see what is Hyper-V.
- VMware ESXi is a commercial, standalone hypervisor with the vSphere management suite.
- Xen runs beneath a privileged control domain; long used by clouds, today mostly found in XCP-ng and specialised systems.
- VirtualBox is a desktop (type 2) hypervisor for testing on a laptop.
For Linux hosting, KVM’s advantages are that it costs nothing, ships with every distribution, is driven by the same tools as the rest of the system and benefits from every kernel improvement — which is why providers standardised on it.
KVM at VMHeaven
All VMHeaven VPS lines are full KVM virtual machines: Standard KVM on Intel with DDR4 ECC, Hi-CPU KVM on AMD EPYC with ECC for workloads that lean on one or two cores, DMCA Ignored KVM and Pentesting KVM. Each has its own kernel, root access and a VNC console in the panel. To run KVM yourself — Proxmox or libvirt with your own guests — use a dedicated server, where the hardware virtualisation extensions are yours.
Frequently asked
Is KVM free?
Yes. KVM is part of the Linux kernel and open source, and so are QEMU and libvirt, which are normally used with it. Platforms built on it, such as Proxmox VE, add optional paid support.
What is the difference between KVM and QEMU?
KVM is the kernel part that runs guest code on the CPU with hardware virtualisation. QEMU is the user-space program that builds the virtual machine and its devices; with KVM it runs guests at near-native speed, without KVM it emulates them slowly.
Can a KVM VPS run Windows?
Yes. A KVM virtual machine has its own kernel and virtual firmware, so it can run Windows as well as any Linux distribution or BSD, given suitable drivers such as virtio-win.