Hardware

Does your hardware even support virtualization (Intel VT-x Vanderpool or AMD-V Pacifica or VIA VT)?

$ dmesg | grep ^kvm
kvm: Nested Virtualization enabled
kvm: Nested Paging enabled

Here’s some stuff to check:

$ grep --color '\(vmx\|svm\| ept\|vpid\|vnmi\)' /proc/cpuinfo
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt
pdpe1gb rdtscp lm constant_tsc rep_good nonstop_tsc extd_apicid
aperfmperf pni monitor ssse3 cx16 popcnt lahf_lm cmp_legacy **svm**
extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch ibs skinit wdt
cpb npt lbrv **svm**_lock nrip_save pausefilter

Note that SVM is AMD’s "Secure Virtual Machine".

Xen

Xen is a high performance VM strategy that allows specially modified guest kernels to run concurrently on the same hardware. Control is shared among the competing running OS instances by the "hypervisor" (which is the Xen software specifically). The hypervisor is responsible for booting the dom0 or domain 0 which is the only instance that has direct access to the real physical hardware. Guest operating systems (domU or domain Unprivileged) negotiate with the hypervisor for resources. Xen is like an operating system for your operating systems in the same way that the normal Linux kernel is an operating system for your processes.

Xen is notable for being able to manage VMs at a low level on hardware that does not support native VM switching. I think that modern CPUs are capable of handling a lot of the functionality of the Xen dom0. I’m not sure how this affects the added utility of Xen in the modern world. I think it would be hard for CPU based virtualization technologies to do live migrations of a domU from one machine to another. This may be the compelling advantage that Xen maintains. Xen also can target processors not traditionally equipped for native VM operations (XenARM).

Kernel-based Virtual Machine (KVM)

KVM is a Linux kernel feature (kvm.ko) that provides a /dev/kvm interface which can be used to populate and control guest VMs. This requires hardware CPU VM support. QEMU is required to manage the VMs. QEMU tries to use this if the hardware supports it but can also use other virtualization backends.

Here is the official home page.

QEMU

QEMU does both virtualization and emulation. The virtualization is done using KVM and is apparently very efficient. The machine emulation, while slower, allows for tricks such as running programs designed for a different CPU architecture. QEMU specifically is a hypervisor process which manages hardware virtual machine instances. QEMU can also allow user processes compiled for different architectures to run in a user mode emulation.

Here is QEMU’s main page. Here is a more proper documentation page.

VirtualBox

Some words from the Wikipedia page stood out: Oracle, Microsoft, Sun, Licensing… Ok, next. Oh and from the Ubuntu Wiki on VirtualBox: "The free edition only allows usage of a 32-bit operating system (as the guest OS) whereas the subscription edition allows a 64-bit guest OS. (Both require registration.)" There seems to be limitations on USB3 support and some other things. Some licenses are free only for personal or evaluation purposes.

This is where I will make a note of how to purge Ubuntu of all intrinsic knowledge of VirtualBox… Once I figure out how.

VMWare

Proprietary and either very expensive or very inexpensive. GUI management of guests. Easy like proprietary software can be. Difficult like proprietary software can be.

UserModeLinux (UML)

This is an interesting idea, basically you run the Linux kernel as a user process in a currently running Linux system. To me this seems like a slightly more wholesome way to think of VMs. My top level criticism of VMs is, if you configured your computer properly to begin with, why would you need to trick it with VMs? But this method seems to treat "running an OS" as just another thing that an OS can run.

Here’s the official homepage. Notes on getting this to work on Ubuntu. Gentoo people seem to find this interesting.

Docker

Could it be that UML is semi-obsolete? Docker gets an atom bomb’s worth of hype and it does look relatively sane if you really need "lightweight containers". What exactly that means is not always easy to ascertain. My best understanding is they’re like Gentoo overlays.

The Wikipedia Software container article is interesting.