KVM
KVM (Kernel-based Virtual Machine) is a Linux kernel module that allows you to create virtual machines on your physical machine. It’s a type-1 hypervisor, which means it runs directly on top of the Linux kernel, rather than being a separate layer like a traditional guest operating system.
The use of KVM is to run multiple virtual machines (also known as guests) on a single physical host, each with its own operating system and resources. This can be useful for:
- Testing and development: create a sandbox environment for testing software without affecting the host machine
- Virtualization: run multiple OSes on a single machine, reducing the need for separate hardware
- Server consolidation: reduce the number of physical servers needed by running multiple virtual machines on one host
As for special hacks, here are a few:
- Live migration: you can live-migrate a VM from one host to another without disrupting its operation. This is done using the
qemu-kvm
command with the-migrate
option. - CPU pinning: you can specify which CPU(s) a VM should run on, using the
cpus
option in the/etc/libvirt/qemu.conf
file. - Memory overcommitting: you can allow KVM to allocate more memory to a VM than is physically available on the host machine. This is done by setting
memory_overcommit=1
in the same configuration file.
This command would be necessary for intermediate to advanced Linux users, with some knowledge of virtualization and kernel internals. The basics of using KVM are relatively straightforward, but more complex tasks like live migration and memory overcommitting require a good understanding of how KVM works under the hood.
Experience level required: Intermediate (you should have basic knowledge of Linux, virtualization, and kernel concepts)
No tags for this post.