EMZETT.
Login

Virtualisation with KVM and QEMU

In short: KVM turns the Linux kernel itself into a hypervisor, QEMU provides the virtual hardware. Together they run complete virtual machines at nearly native speed.

In more detail: The processor extensions Intel VT-x or AMD-V must be enabled in the BIOS. KVM is conveniently operated with virt-manager or virsh (libvirt).

In detail

  • Check: lscpu | grep -i virtualization, ls /dev/kvm.
  • Tools: virt-manager (graphical), virsh, GNOME Boxes (simple), Cockpit.
  • Disk formats: qcow2 (with snapshots), raw.
  • Network: NAT (default), bridge (VM like a device on the LAN).
  • Drivers: VirtIO for fast network and storage, SPICE for display.
  • GPU passthrough (VFIO): give a real graphics card to the VM, for example for Windows games.
  • Alternatives: VirtualBox (Oracle), VMware Workstation, Proxmox (server management), Xen, Hyper-V (Windows).
  • VM or container? VM: own kernel, other operating systems, stronger isolation. Container: lighter and faster.
  • Security: KVM escapes are possible but rare. Keep it up to date.

See also: Containers on Linux: namespaces and cgroups, The Linux kernel at a glance