How To

Introduction to KVM Virtualization

1 – Kernel Modules

  • kvm.ko: This is the core module in KVM and it allows for the communication with the underlying hardware and enables guest execution.
  • kvm-intel.ko or kvm-amd.ko: These are processor-specific modules. They provide CPU hardware virtualization extensions. kvm-intel.ko is pecific to Intel VT and kvm-amd.ko for AMD-V architectures.

2 – User-space Utilities

  • QEMU (Quick Emulator): This is a free and open source, user-space machine emulator. It can emulate virtual hardware devices like disks, network cards, USB devices, graphics cards, integrated systems on a chip (SoCs), or display devices such as standard VGA for the VMs. QEMU provides a complete virtual environment where guest operating systems can run.
  • Libvirt: It is a collection of libraries that make it easy to manage Virtual Machines. It provides a unified API for managing multiple virtualization hypervisors such as KVM, QEMU, Xen and LXC. It allows for the creation, management, and the overall control of VMs using tools like virsh, virt-manager, etc. Libvirt is composed of libvirt API (C API), libvirtd (daemon), and virsh (command-line utility).

3 – Guest Environment

  • Guest OS: Operating system that has been installed on the Virtual Machine provisioned in KVM. This can be Windows, Linux, or any OS compatible with the KVM architecture.
  • Virtual Hardware: The guest OS interacts with virtualized hardware resources like CPU, memory, storage, and networking provided by KVM.

Key Features KVM

The following are some key features of KVM virtualization solution.

Original content from computingforgeeks.com - post 87482
Cost Effectiveness
  • KVM is a free and open-source solution eliminating licensing costs often associated with proprietary virtualization software solutions available in the market such as VMware.
  • Being an open source solution, the end user has the ability to do deep customizations and any third party integrations with other open-source tools, making KVM adaptable to specific customer needs.
Security
  • KVM is secure by design as it incorporates robust security measures provided by the Linux kernel
  • It uses Security-Enhanced Linux (SELinux) / AppArmor to enforce strict access though Mandatory Access Control (MAC) and prevent unauthorized access
  • Secure virtualization (sVirt) also enhances the isolation and the security for virtual machines
Management Tools
  • A number of KVM management tools are available, such as Libvirt, virsh, virt-manager, and Cockpit.
  • With these tools it becomes easy to perform comprehensive management of the VMs, including VM creation, storage and network configurations, and monitoring.
Storage Management
  • KVM can use any storage provided Linux supports it, this include local disks, , network-attached storage (NAS), and storage area networks (SANs), and object storage solutions such as Ceph.
Performance & Scalability
  • With KVM you enjoy the performance features of the Linux kernel. The hardware virtualization extensions (Intel VT or AMD-V) significantly improves the guest VM performance.
  • The Linux kernel does well in the efficient resource allocation to the VMs (CPU, memory, storage). This leads to high performance than other virtualization platforms.
  • KVM is capable of handling a large number of virtual machines within a single physical machine. With this you can maximize hardware utilization and prevent resource undertutilization.
Hardware Support and Flexibility
  • Wide Support for Hardware: KVM has a wide support for server hardware vendor solutions. It works with a vast range of x86 processors with hardware virtualization extensions, offering broad compatibility.
  • Live Migration: With KVM you can migrate running virtual machines between physical hosts without encountering downtime. This enables you to perform maintenance on a host and better workload balancing.
  • Snapshot Feature: In KVM it is possible to take VM snapshots of its state. This allows you to revert to a previous working state if any runtime issues are encoutered and as a disaster recovery strategy.
Maturity
  • KVM has been under active development since its first introduction in the Linux kernel in 2007
  • The long-standing development history of KVM is an indications of its high level of maturity and stability.
  • It also benefits for from a large and diverse community of contributors, including developers from major technology companies. This ensures there is ongoing enhancements to KVM and bug fixes within time.

Virtual Machine XML configuration

In KVM, the virtual machine configurations are kept in a host-based XML configuration file (also known as domain XML file). This configuration file contain the settings for the virtual machine and define the devices attached.

XML configuration file includes:

  • Virtual machine metadata information such as the instance name, and other information about the VM.
  • All the devices attached to the VM. This include memory, virtual CPUs (vCPUS), storage devices, network interface cards, input/output devices, and any other hardware.
  • Specific virtual machine settings like the maximum amount of memory it can use, and other VM settings.

Related Articles

Virtualization How To Install VirtualBox 7.0 on Kali Linux / Linux Mint KVM How to Configure a Filesystem Storage Pool in KVM Proxmox Create Users, Groups and Assign Permissions in Proxmox VE KVM How To Create Bridged Network in Libvirt

Leave a Comment

Press ESC to close