Skip to content

What Is KVM Virtualization and How Does a KVM VPS Work

6 min read

Applies to: Linux KVM on x86_64 servers and KVM VPS (checks tested on Fedora 44 with QEMU 10.2.2 and Ubuntu 24.04 with QEMU 8.2.2)

KVM (Kernel-based Virtual Machine) is the virtualization technology built into the Linux kernel. It lets a Linux server act as a hypervisor: the server's CPU runs several virtual machines side by side, and each one gets its own virtual CPUs, memory, disk and network card and boots its own operating system (Linux, Windows or another OS). A KVM VPS is one of those virtual machines, running on a hosting provider's physical server.

What does KVM stand for?

In servers and hosting, KVM means Kernel-based Virtual Machine. According to Red Hat, it was announced in 2006 and merged into the Linux kernel a year later, so it is part of the standard Linux kernel rather than a separate product.

Do not confuse it with a KVM switch (keyboard, video, mouse), the hardware that lets one keyboard and screen control several computers. Server remote consoles such as IPMI "iKVM" use that second meaning: see installing an OS with the Supermicro HTML5 iKVM console.

How KVM works

  • The kernel modules: kvm plus kvm_intel or kvm_amd, depending on the processor. They use the CPU's hardware virtualization extensions, Intel VT-x (CPU flag vmx) or AMD-V (svm).
  • /dev/kvm: the device the modules create. According to the Linux kernel documentation, programs open /dev/kvm and use it to create a virtual machine and its virtual CPUs.
  • QEMU: the user-space program that provides the rest of the virtual machine (disks, network cards, display, firmware). QEMU describes itself as an emulator and virtualizer: the CPU "may be fully emulated, or it may work with a hypervisor such as KVM". With KVM, guest code runs directly on the real CPU instead of being emulated, which is much faster.
  • Linux itself: according to Red Hat, every VM is "a regular Linux process, scheduled by the standard Linux scheduler". KVM reuses the kernel's memory management, scheduler, drivers and security features instead of reinventing them.

You can see the difference KVM makes from inside QEMU. In our lab (an Ubuntu 24.04 container with /dev/kvm passed through), the QEMU monitor command info kvm answered kvm support: enabled when QEMU was started with -accel kvm, and kvm support: disabled with -accel tcg. TCG is QEMU's software CPU emulation. It works without KVM, but much more slowly. Without /dev/kvm (a Fedora 44 container), asking for KVM failed:

qemu-system-x86_64: -accel kvm: Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory

KVM virtualization management tools

KVM itself has no user interface. You manage it with one of these layers:

  • libvirt: virsh on the command line (see virsh list: list KVM and QEMU virtual machines), virt-install and the virt-manager desktop app.
  • Cockpit (the "web console" in RHEL): with the cockpit-machines plug-in it adds a Virtual Machines page for creating, starting and configuring VMs in the browser, according to Red Hat.
  • Proxmox VE: according to Proxmox, "an open source server virtualization management solution based on QEMU/KVM and LXC".
  • Hosting control panels such as Virtualizor, which providers use to create, resize and reinstall customer VPSs.

How a KVM VPS works

The provider's physical server runs Linux with KVM. Each customer VPS is a virtual machine with a fixed allocation of virtual CPUs, RAM and disk. For you, this means:

  • Your own kernel: you can load kernel modules, run Docker, WireGuard and custom firewall rules, and choose your Linux distribution or Windows.
  • Full root or Administrator access, and a console (VNC) that works even when the network inside the VPS is broken. On Virtualizor, see accessing your VPS through VNC.
  • Isolation: other customers' VMs cannot see your files or processes, and a crash in their kernel does not take yours down.
  • Reinstall at any time: the panel can rebuild the virtual disk from an OS template.

KVM VPS compared with container-based VPS

Container platforms (OpenVZ, LXC) also sell "VPS" plans, but all containers share the host's kernel. You cannot load your own kernel modules or run Windows, and some software (certain VPNs, Docker, kernel tuning) may not work or needs the provider to enable it. With KVM each VPS boots its own kernel. Containers have less overhead; KVM gives more freedom and stronger separation.

How to check if your server is a KVM VPS

  1. Run systemd-detect-virt. On a KVM virtual machine it prints kvm. (Inside a container it prints the container type instead; systemd-detect-virt --vm shows the VM layer below it, which is how we ran it in the lab.)
  2. Run lscpu and look for the hypervisor lines. Lab example from a KVM VPS:
    Hypervisor vendor:                    KVM
    Virtualization type:                  full

How to check if a server can run KVM virtual machines

Use these checks before installing a hypervisor on a dedicated server (or inside a VPS):

  1. Count the CPU threads with virtualization extensions. 0 means VT-x or AMD-V is missing or switched off in the BIOS:
    grep -Eoc '(vmx|svm)' /proc/cpuinfo
  2. Check that the modules are loaded:
    lsmod | grep kvm
    Lab example (AMD processor):
    kvm_amd               241664  0
    ccp                   163840  1 kvm_amd
    kvm                  1400832  1 kvm_amd
  3. On Ubuntu, install cpu-checker and run kvm-ok. Lab output:
    INFO: /dev/kvm exists
    KVM acceleration can be used
  4. On Fedora, RHEL and similar systems, virt-host-validate qemu (from libvirt) runs a longer list of checks. Its first lines tell you what is missing, for example in a container without /dev/kvm:
    QEMU: Checking for hardware virtualization                                 : PASS
    QEMU: Checking if device '/dev/kvm' exists                                 : FAIL (Check that the 'kvm-intel' or 'kvm-amd' modules are loaded & the BIOS has enabled virtualization)

If the CPU flag is missing on a physical server, enable it in the firmware: how to enable Intel VT-x or AMD-V in the BIOS. Inside a VPS the checks only pass if the provider exposes the CPU extensions to the guest (nested virtualization). This is a host setting, so ask your provider before planning to run virtual machines inside a VPS.

When to choose a KVM VPS

  • You need a specific kernel feature, kernel module, VPN or Docker.
  • You want Windows Server or an operating system the provider does not offer as a container.
  • You want guaranteed RAM and isolation from other customers.

If you only host a few websites and do not want to manage a server, shared hosting is simpler.

Related articles: Virtual machine software for Linux and Ubuntu: KVM, VirtualBox, GNOME Boxes and more, convert a VMware VM to KVM (qcow2), reinstall the VPS operating system from the Ucartz client area.

Ucartz KVM VPS plans run on KVM with Virtualizor and are managed from the client area, with automated deployment about a minute once the order is approved.

Official documentation: Linux kernel: KVM API, About QEMU, Red Hat: What is KVM?

Was this answer helpful?

Still stuck? Open a ticket