Chapter 5. Installing RHEL as a virtual machine
To install RHEL as a guest operating system on an existing RHEL host, you can use an installation ISO to create a virtual machine (KVM) and start the RHEL installation.
Prerequisites
- Virtualization is enabled on your host system. For instructions, see Preparing RHEL to host virtual machines.
- You have a sufficient amount of system resources to allocate to your VMs, such as disk space, RAM, or CPUs. The recommended values might vary significantly depending on the intended tasks and workload of the VMs.
An operating system (OS) installation source is available locally or on a network. This can be one of the following formats:
- An ISO image of an installation medium
-
A disk image of an existing VM installation. Such a disk image can also be created from a
bootccontainer. For instructions, see Creating QEMU disk images by using bootc-image-builder.
-
To create a VM that uses the
systemconnection oflibvirt, you must have root privileges or be in thelibvirtuser group on the host. For more information, see User-space connection types for virtualization. - On IBM Z systems, the KVM host must run RHEL installed in LPAR mode. For details, see Installing in an LPAR.
Procedure
Create virtual machine with the instance of Red Hat Enterprise Linux as a KVM guest operating system, use the following
virt-installcommand on the KVM host:$ virt-install --name=<guest_name> --disk size=<disksize_in_GB> --memory=<memory_size_in_MB> --cdrom <filepath_to_iso> --graphics vncFor more examples, see Creating virtual machines by using the command line.
- The graphical console of the VM opens and you can start the installation.
Troubleshooting
- If the VM is successfully created but the graphical console does not open, connect to the VM manually. For instructions, see Connecting to virtual machines.
Next steps