Virtualization is a feature to support dividing a single physical machine into multiple virtual machines (VM), each of which can run an independent operating system.
Red Hat Enterprise Linux supports KVM (Kernel-based Virtual Machine), a full virtualization solution that is built into the standard Linux kernel. KVM can run multiple Windows and Linux guest operating systems.
In Red Hat Enterprise Linux, you can manage KVM from the command line with the virsh command, or graphically with the web console's Virtual Machines tool.
KVM virtual machine technology is available across all Red Hat products, from stand-alone physical instances of Red Hat Enterprise Linux to the Red Hat OpenStack Platform:
Physical hardware systems run Red Hat Enterprise Linux to provide KVM virtualization. Red Hat Enterprise Linux is typically a thick host, a system that supports VMs and also providing other local and network services, applications, and management functions.
Red Hat Virtualization (RHV) provides a centralized web interface that administrators can use to manage an entire virtual infrastructure. It includes advanced features such as KVM migration, redundancy, and high availability. A Red Hat Virtualization Hypervisor is a tuned version of Red Hat Enterprise Linux solely for provisioning and supporting VMs.
Red Hat OpenStack Platform (RHOSP) provides the foundation to create, deploy, and scale a public or a private cloud.
Red Hat OpenShift Virtualization includes RHV components to enable deployment of containers on bare metal.
On systems where SELinux is enabled, sVirt isolates guests and the hypervisor. Each virtual machine process is labeled and is automatically allocated a unique level, and the associated virtual disk files are given matching labels.
Two main virtual machine types are available to install the guest operating system on. The earlier of the two uses the i440FX chip set, and provides ISA and PCI bridges, an IDE controller, and VGA and Ethernet adapters. The Q35 machine type is the later of the two, and should be used in most cases. It supports later virtual hardware interfaces such as PCIe and SATA, and includes an SM Bus controller.
In Red Hat Enterprise Linux 8 and later versions, UEFI and Secure Boot support for virtual machines is provided by Open Virtual Machine Firmware (OVMF), in the edk2-ovmf package.
The list of Red Hat supported guest operating systems varies depending on the product in use. The RHV, RHOSP, and OpenShift Virtualization products all include Server Virtualization Validation Program (SVVP) certified drivers, and supports more supported Windows guest operating systems. A RHEL system that runs KVM only has SVVP support for specific subscriptions.
Review the following documents to determine whether a guest operating system is supported.
RHV, RHOSP, and OpenShift Virtualization: Certified Guest Operating Systems in Red Hat OpenStack Platform, Red Hat Virtualization, OpenShift Virtualization and Red Hat Enterprise Linux with KVM
Administrators can configure a Red Hat Enterprise Linux system as a virtualization host, as appropriate for development, testing, training, or when needing to work in multiple operating systems at the same time.
Install the Virtualization Host DNF package group to prepare a system to become a virtualization host.
[root@host ~]#dnf group list | grep -i virtVirtualization Host [root@host ~]#dnf group info "Virtualization Host"...output omitted... Environment Group: Virtualization Host Description: Minimal virtualization host. Mandatory Groups: Base Core Standard Virtualization Hypervisor Virtualization Tools Optional Groups: Debugging Tools Network File System Client Remote Management for Linux Virtualization Platform [root@host ~]#dnf group install "Virtualization Host"...output omitted...
KVM requires either an Intel processor with the Intel VT-x and Intel 64 extensions for x86-based systems, or an AMD processor with the AMD-V and the AMD64 extensions.
To verify your hardware and the system requirements, use the virt-host-validate command.
[root@host ~]# virt-host-validate
QEMU: Checking for hardware virtualization : PASS
QEMU: Checking if device /dev/kvm exists : PASS
QEMU: Checking if device /dev/kvm is accessible : PASS
QEMU: Checking if device /dev/vhost-net exists : PASS
QEMU: Checking if device /dev/net/tun exists : PASS
QEMU: Checking for cgroup 'cpu' controller support : PASS
QEMU: Checking for cgroup 'cpuacct' controller support : PASS
QEMU: Checking for cgroup 'cpuset' controller support : PASS
QEMU: Checking for cgroup 'memory' controller support : PASS
QEMU: Checking for cgroup 'devices' controller support : PASS
QEMU: Checking for cgroup 'blkio' controller support : PASS
QEMU: Checking for device assignment IOMMU support : PASS
QEMU: Checking for secure guest support : PASSThe system must pass all the validation items to operate as a KVM host.
Install the virt-install package, and then use the virt-install command to deploy a virtual machine from the command line.
Many installation sources are supported, such as ISO, NFS, HTTP, and FTP.
The following example uses the virt-install command's --cdrom option to install the guest from an ISO image.
[root@host ~]# virt-install --name demo --memory 4096 --vcpus 2 --disk size=40 \
--os-type linux --cdrom /root/rhel.iso
...output omitted...The libvirt-client package provides the virsh command, to manage virtual machines from the command line.
Alternatively, you can create and manage virtual machines graphically by using the web console Virtual Machines plug-in.
Install the cockpit-machines package to add the menu to the web console.
[root@host ~]# dnf install cockpit-machinesIf the web console is not already running, then start and enable it.
[root@host ~]# systemctl enable --now cockpit.socketIn a web browser that is running on the local machine, navigate to https://localhost/9090 and log in to the web console.
Switch to administrative mode and enter your password, if necessary.
To create a virtual machine with the web console, access the menu.
From there, click and enter the VM configuration in the window.
If you are using the web console for the first time after installing the Virtual Machines plug-in, then you must reboot your system to start the libvirt virtualization.
sets a domain name for the virtual machine configuration. This name is unrelated to the hostname that you give the virtual machine during installation.
is the method for accessing the installation media. Choices include the local file system, or an HTTPS, FTP, or NFS URL, or PXE.
provides the path to the installation source.
defines the virtual machine's operating system. The virtualization layer presents hardware emulation to be compatible with the chosen operating system.
defines whether to create a storage volume or to use an existing one.
is the disk size when creating a new volume. Associate additional disks with the VM after installation.
is the amount of RAM to provide to the new VM.
indicates whether the VM immediately starts after you click .
Click to create the VM, and click to start the operating system installation. The web console displays the VM console from which you can install the system.
For more information, refer to the Configuring and Managing Virtualization guide at https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html-single/configuring_and_managing_virtualization/index