KVM

The Kernel-based Virtual Machine (KVM) is a full virtualization hypervisor for Linux. The work of the KVM hypervisor is handled by the Linux kernel. Each guest in KVM runs as a process and can be managed by Linux tools such as top and kill.

KVM isn’t a complete virtualization solution. It depends on both the libvirt tools for management and the open source processor emulator QEMU for hardware emulation. Therefore, you will need those installed as well.

KVM is the most popular hypervisor on Ubuntu distributions. Assuming you are using Ubuntu, you can use apt-get to install the necessary packages:

$ sudo apt-get install kvm libvirt-bin ubuntu-vm-builder qemu bridge-utils

You may also want the virt-viewer and virt-manager packages, though these will require the X Window System as well. As of Ubuntu version 8.10 (Intrepid) you can install the meta package ubuntu-virt-server for the basic tools mentioned previously and ubuntu-virt-mgmt for the GUI management tools.

You will likely want to provide your controlling user account with access to network devices created by libvirt. Use usermod to add your account to the libvirtd user group.

Restart your system. If all goes well, you should be able to run the following command without error:

$ virsh -c qemu:///system list

Also check to make sure KVM is working:

sudo kvm

This will confirm that you have enabled virtualization support in BIOS properly.

Get Linux in a Nutshell, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.