Schichtdiagramm eines Servers: unten die Hardware mit CPU-Virtualisierungsfunktion VT-x/AMD-V, darüber der Linux-Kern mit dem KVM-Modul und QEMU als Geräteemulation, darüber drei nebeneinanderliegende virtuelle Maschinen mit je eigenem Betriebssystem und eigenen Anwendungen.

KVM

KVM is a technology in the Linux operating system that allows a single computer to behave like many independent computers. Almost all major cloud providers use KVM to rent out their servers' computing power to thousands of customers simultaneously.

KVM is an extension of Linux, a widely used operating system for servers. It allows multiple complete, separate computers to run on a single physical computer. Each of these artificial computers has its own operating system, its own hard drives, and its own memory. Such an artificial computer is called a virtual machine. The trick is that the software inside it doesn’t notice that it isn’t actually running on real hardware. The abbreviation stands for Kernel-based Virtual Machine, meaning a virtual machine that is anchored directly in the kernel of the operating system.

Why the cloud would look different without KVM

A modern server often has 64 or more processor cores and hundreds of gigabytes of memory. Hardly any single customer needs that much. Without virtualization, this machine would sit mostly idle most of the time. With KVM, the same hardware can be divided into dozens of small servers and rented out individually. That is exactly the business model behind names like Amazon Web Services, Google Cloud, or Hetzner.

Separation is crucial here. Under no circumstances should one customer be able to look into another customer’s data, even though both are working on the same physical hardware. KVM ensures this isolation at a very deep level of the system. If one virtual machine crashes, the others continue running undisturbed.

Economically interesting is also the fact that KVM is free software. It is firmly built into the Linux kernel, the central part of the operating system, and costs no license fees. Those who instead use commercial products like VMware pay per server. After Broadcom's acquisition of VMware, these prices rose sharply, and many companies considered switching to KVM. That is why the term also appears in business news.

What actually happens inside the processor

Earlier virtualization programs had to translate every instruction from a guest system. This was slow because a piece of software in between was constantly doing extra calculations. Modern processors from Intel and AMD have their own dedicated circuitry for this, called VT-x and AMD-V respectively. They can provide an isolated mode in which a guest system executes its instructions directly on the real hardware.

KVM is essentially the link to this hardware feature. It turns the Linux kernel itself into what is called a hypervisor, the management layer above the virtual machines. The big advantage: Linux already comes with memory management, scheduling, and drivers. KVM does not need to build all of that again from scratch. From Linux’s point of view, a virtual machine is simply an ordinary program that happens to contain an entire operating system.

KVM does not work entirely on its own, however. A companion program called QEMU simulates the surrounding devices, such as the network card, graphics output, and hard drive. A common misconception is that KVM is the same as a container, as known from Docker. Containers share a common operating system kernel and are therefore more lightweight, but less strictly separated. A virtual machine brings its own kernel and is therefore heavier, but more securely sealed off.

From AI data centers to your own laptop

Most often, one encounters KVM invisibly. Anyone who rents a cheap server on the internet or runs a website with a hosting provider is very likely working on a KVM machine. Android developers also use the technology: the emulator that simulates a phone on screen is accelerated by KVM.

In the AI field, an extension that passes through graphics cards plays a role. This gives a virtual machine direct access to a real graphics chip. This allows providers to rent out expensive AI accelerators by the hour, without customers having to share the same card at the same time.

KVM can also be tried out on your own computer. On Linux, programs like virt-manager let you start a second system in a window, for example Windows for testing purposes. Important to know: KVM requires Linux as its foundation. On Windows, the comparable technology is called Hyper-V, and on Apple computers there is a separate framework from the manufacturer.

Subscribe free. Unsubscribe the second it sucks.

High-signal news across AI, business, UX, and tech. Every morning.