Last week I gave you an overview of the spectrum of Linux virtualization technologies, and earlier this week we went deeper with Linux Containers (or LXC) and Docker. Those are adequate solutions for many situations, but what about these:
/dev/kmem
with a debugger on the host OS and search for memory pages of the qemu-kvm
processes containing memory pages of the kernel and processes running on the virtual machine. root
on the host gets you to the virtual machine. If this really matters to you, it’s time to buy dedicated hardware!We show you how to do the first three of those in Learning Tree’s new course on Linux virtualization. What is involved?
There are several ways of achieving those goals, but KVM and QEMU make a nice combination. KVM or Kernel-based Virtual Machine is a set of modules within the Linux kernel. Since it’s running in the kernel, right on top of the hardware, this makes it fast. For acceptable performance you will need hardware acceleration support. Recent Intel and AMD processes will have this support, but you may need to go into your firmware and enable it.
QEMU or the Quick Emulator is the collection of user-space tools to manipulate, control, and monitor virtual machines running on top of the OS. Unlike KVM, QEMU is not Linux-specific. I have used it to run Windows as a virtual machine on an OpenBSD laptop, but without the underlying support in the kernel the performance is pretty poor.
If you run Linux or Windows on x86-64 on top of Linux/x86-64 in the obvious and straightforward way, you don’t even notice that you are using QEMU and KVM. You simply define a new virtual machine, point its storage at an empty disk image file, and tell it that its CD/DVD drive is an ISO image of Linux or Windows install media. Or, you can tell it that its disk is an image file you already created, possibly in VMware or another virtualization product.
When you virtualize the architecture, providing an ARM (or SPARC, or MIPS, or M68k, or …) processor to the virtual machine, you realize that QEMU is involved as you have to install and run the appropriate qemu-system-*
command to simulate the processor.
Linux virtualization beyond chroot
is configured through XML files. The XML definition of a container or virtual machine also specifies how many Ethernet interfaces of which chipsets and MAC addresses, and how they are connected to virtual networks. Plus connections to the host’s USB ports, sound interface, and more. If you are familiar with VMware, this is like the whatever.vmx
file.
We show you how to manipulate the XML directly in Learning Tree’s course on Linux virtualization, so you can always get a virtual machine defined.
But once it’s defined, you can tie it and all these other virtualization technologies together in one easy-to-use interface. Check back next time for that!