What is KVM?
Kernel-based Virtual Machine (KVM) is an open source virtualization technology for Linux® operating systems. With KVM, Linux can function as a hypervisor that runs multiple, isolated virtual machines (VMs).
KVM was announced in 2006 and merged into the Linux kernel a year later. Many open source virtualization technologies, including Red Hat’s virtualization portfolio, depend on KVM as a component.
What does a hypervisor do?
Virtualization, which lets you run an operating system (OS) within another OS, is possible thanks to hypervisors. A hypervisor pools computing resources—like processing, memory, and storage—and reallocates them among VMs. A hypervisor can run multiple VMs at once, manage them, and support the creation of new ones. The physical hardware, when used as a hypervisor, is called the host, while the many VMs that use its resources are guests.
Hypervisors need operating system-level components—such as a memory manager, process scheduler, input/output (I/O) stack, device drivers, security manager, a network stack, and more—to run VMs. KVM has all these components because it’s part of the Linux kernel. Every VM is implemented as a regular Linux process, scheduled by the standard Linux scheduler, with dedicated virtual hardware like a network card, graphics adapter, CPU(s), memory, and disks.
Red Hat Resources
What are the benefits of virtualization?
Virtualization makes it possible to quickly start and stop different operating system environments on a single piece of hardware, bringing a host of benefits to your IT ecosystem.
Flexibility
You can divide a host machine into multiple VMs and allocate resources where they are needed. This way, you can maximize space, power consumption, and maintenance by hosting multiple VMs on a single piece of physical hardware.
Speed
Because VM configurations are defined by software, VMs are quick to create, remove, clone, and migrate. You can control a VM remotely, and you can automate the management of VMs.
Compatibility
You can use VMs to run software that wasn’t released for your OS. For example, you can launch an older operating system in a VM so you can keep existing software running on modern hardware.
Stability and safety
VMs also have safety advantages because each VM runs separately. A VM can become unstable without affecting the host OS or other VMs on the same host. You can test a new configuration without risking a compromise to your entire system.
What are the features of KVM?
With KVM, a VM is a Linux process, scheduled and managed by the kernel. VMs running with KVM benefit from the performance features of Linux, and users can take advantage of the fine-grained control provided by the Linux scheduler. KVM also brings features related to security, storage, hardware support, and live migration.
Security boundaries with SELinux and sVirt
KVM uses a combination of Security-Enhanced Linux (SELinux) and sVirt for enhanced VM security and isolation. SELinux establishes security boundaries around VMs. sVirt extends SELinux’s capabilities, allowing Mandatory Access Control (MAC) security to be applied to guest VMs and preventing manual labeling errors.
Storage flexibility
KVM is able to use any storage supported by Linux, including some local disks and network-attached storage (NAS). KVM also supports shared file systems so VM images may be shared by multiple hosts.
Support for multiple hardware architectures
KVM can run on a wide variety of hardware platforms. When used as part of Red Hat Enterprise Linux 9, KVM is supported with 64-bit AMD, Intel, and ARM architectures, as well as IBM z13 systems and later.
Live migration
KVM supports live migration, which is the ability to move a running VM between physical hosts with no noticeable service interruption. The VM remains powered on, network connections remain active, and applications continue to run while the VM is relocated. KVM also saves a VM's current state so it can be stored and resumed later.
How do you manage VMs with KVM?
When you’re running multiple VMs, a virtualization management tool is helpful for keeping track of them. Some VM management tools run from the command line, others provide graphical user interfaces (GUIs), and others are designed to manage VMs across large enterprise environments. Here are a few common virtualization management solutions for KVM.
libvirt and virsh
The libvirt project provides an API for managing virtualization platforms. Within libvirt, virsh is a command-line utility for creating, starting, listing, and stopping VMs, as well as entering a virtualization shell.
Virtual Machine Manager
Virtual Machine Manager (known as VMM or virt-manager) provides a desktop interface for VMs, and is available for major Linux distributions.
Web consoles
VM administrators can choose to manage their VMs using web-based interfaces. For example, Cockpit offers a solution that lets users manage VMs from a web interface. Red Hat Enterprise Linux offers a web console plug-in for virtualization.
KubeVirt
KubeVirt is a solution for managing large numbers of VMs in a Kubernetes environment, where VMs can be managed alongside containerized applications. Kubevirt provides the foundation for Red Hat OpenShift® Virtualization.
Why migrate to a KVM-based virtualization platform?
One of the benefits of VMs is flexibility–and portability. That portability makes it possible to move a VM from one virtualization provider to another to take advantage of lower costs, expanded capabilities, more control, or other advantages.
Developers consider KVM a mature technology, and enterprises trust it to handle VMs efficiently at scale. A migration to a KVM-based platform, such as Red Hat’s virtualization portfolio, is a way to preserve existing VM investments while choosing a solution with an open source foundation. Red Hat’s technologies also make it possible to manage a unified environment for VMs, containers, and serverless apps.
Why choose Red Hat for virtualization?
KVM is the hypervisor behind Red Hat’s virtualization portfolio. Get the flexibility and benefits of an open source hypervisor like KVM with the assurance of Red Hat’s enterprise support, security features, and stability.
Red Hat’s trusted products and partner ecosystem come together in 1 comprehensive virtualization solution. Migrate your virtual machines now to Red Hat OpenShift Virtualization, a modern application platform–based on the open source projects KVM and KubeVirt–that can run virtual machines and containers side by side. The included migration toolkit for virtualization provides the tools you need to start your migration in a few simple steps. Use automation to accelerate delivery with Red Hat Ansible® Automation Platform–from migration at scale to Day 2 operations and remediation. Monitor the security and performance of your VMs from a single console with Red Hat Advanced Cluster Management for Kubernetes. With additional support options and partner integrations for storage, backup and disaster recovery, and networking, you can rely on Red Hat to keep your virtual infrastructure running smoothly throughout the hybrid cloud–and help you modernize when you’re ready.
The official Red Hat blog
Get the latest information about our ecosystem of customers, partners, and communities.