KVM (Kernel-based Virtual Machine) is the virtualization technology built into the Linux kernel. On a VPS Linux Infrawire, it means your server behaves like a real machine with its own kernel, not like a simple folder isolated on someone else's system. This guide explains the difference with container-based technologies and shows how to verify it yourself.
📋 Prerequisites
- A Linux VPS (Ubuntu 24.04, Debian 12, AlmaLinux 9 or Rocky Linux 9)
- SSH access as root or a user with
sudo - Basic command-line knowledge
1. How KVM works
KVM turns the Linux kernel of the physical host into a hypervisor. Each virtual machine is a normal process managed by QEMU, but it sees emulated hardware: a CPU, RAM, a disk and a network card. Thanks to the CPU virtualization extensions (Intel VT-x, AMD-V), the guest code runs almost at native speed.
Inside the VM you install a complete operating system with its own kernel, its own init system and its own processes. From your point of view, it is a dedicated server.
2. KVM vs OpenVZ and LXC
Container technologies work differently:
- OpenVZ and LXC: all containers share the kernel of the host. You only get an isolated user space. You cannot change the kernel, load modules or choose the kernel version.
- KVM: full virtualization. Each VPS boots its own kernel and has its own memory and disk allocation.
A container is lighter, but it is limited by what the host kernel allows. A KVM VPS gives you freedom at the cost of a slightly larger memory footprint.
3. Why it matters on a VPS
With your own kernel you can:
- Load kernel modules such as WireGuard,
br_netfilterornf_conntrack - Run Docker and other container engines without restrictions (cgroups, overlay filesystem, iptables)
- Tune the system with
sysctl(network buffers, IP forwarding, BBR congestion control) - Use your own firewall, swap file and any filesystem you like
- Install a different kernel version from your distribution
Bash# Show the running kernel uname -r # Show the kernel tunables you can change sudo sysctl net.ipv4.ip_forward net.ipv4.tcp_congestion_control
4. Check that you are on KVM
The simplest way is systemd-detect-virt:
Bashsystemd-detect-virt # Expected output: kvm
If the command prints openvz, lxc or docker, you are in a container. none means a physical machine.
You can confirm with lscpu:
Bashlscpu | grep -iE 'hypervisor|virtualization type' # Hypervisor vendor: KVM # Virtualization type: full
And with the kernel boot messages:
Bashsudo dmesg | grep -i -E 'kvm|hypervisor' # Hypervisor detected: KVM
Finally, hostnamectl displays a Virtualization: kvm line.
5. Test what KVM gives you
Check that you can load a module and run containers:
Bash# Ubuntu 24.04 / Debian 12: WireGuard module sudo modprobe wireguard lsmod | grep wireguard # Install Docker from the distribution repository and run a test container sudo apt update && sudo apt install -y docker.io sudo docker run --rm hello-world
On AlmaLinux 9 or Rocky 9, use sudo dnf install -y wireguard-tools for the tools and follow the official Docker documentation (docs.docker.com) to install the engine.
🔧 Troubleshooting
dmesg: read kernel buffer failed: Operation not permitted
The kernel restricts dmesg to root. Run it with sudo, or use sudo journalctl -k.
modprobe: FATAL: Module wireguard not found
On some minimal images the extra modules are missing. On Ubuntu, install linux-modules-extra-$(uname -r). If you just upgraded the kernel, reboot first so that uname -r matches the installed modules.
systemd-detect-virt: command not found
The image has no systemd, or it is very minimal. Use lscpu or dmesg instead, or install the systemd package.
Docker complains about cgroups or iptables
Check that the service is running with systemctl status docker, and that you did not disable nf_tables or iptables in a custom firewall setup.
🚀 You now know what KVM brings to your VPS: a real kernel, full control and no hidden limits from the host.