Install RHEL9 on KVM

RHEL9 on KVM

In this tutorial, we’ll guide you through the step-by-step installation of RHEL9 on KVM. The process is uncomplicated, and we’ll present it in a format similar to the one used in the “Install CentOS8 on KVM” article.

Table of Contents

Introduction

Please be aware that we will be installing RHEL9 on a qcow2 formatted disk, providing us with certain advantages not attainable with raw formatted disk images. For instance, qcow2 allows us to create snapshots and apply AES encryption to enhance data security—features that are unavailable with a raw disk image.

RHEL9 on KVM

Photo by Johannes Plenio from Pexels

Pre-Installation Checks

Prior to starting, please ensure that KVM is installed and configured correctly. Additionally, make sure you possess root privileges or sudo privileges to elevate your permissions. Now, let’s move forward with the installation.

Download the latest RHEL9 ISO

You can download the latest RHEL iso free of charge here. Click on the [Download RHEL at no cost] button to proceed.

RHEL9 on KVM

Image credit: admingeek from Redhat

However, you will need to log on to your Redhat account or with your Google (gmail), Microsoft, or Github account, if you don’t have one. Upon logging in, the download for the latest RHEL9.iso (version 9.3 as of the date of this article) will commence automatically.

RHEL9 on KVM

Image credit: admingeek from Redhat

Create a qcow2 disk image

Presently, we are utilizing the qemu-img utility to generate the qcow2 disk image, which will function as the storage for our RHEL9 virtual machine. Change directory to the default location for image store as the root user(/var/lib/libvirt/images):

				
					# cd /var/lib/libvirt/images
				
			

Additionally, we are assigning 75GB to our newly created disk image named rhel9-vm.img (below):

				
					# sudo qemu-img create -f qcow2 rhel9-vm.img 75G
				
			

RHEL9 on KVM: Installation Step-by-Step (virt-manager)

Now that we’ve downloaded the latest RHEL9 iso and created a qcow2 disk image, we can now proceed with the installation.

Launch virt-manager

Firstly, launch the virt-manager on your KVM host as the root user.

				
					# virt-manager
				
			

Create a new virtual machine

Secondly, click the computer monitor icon (circled in red below) to continue.

Install CentOS8 on KVM - Create a new VM

Photo by admingeek from Infotechys

Following that, a prompt will appear, allowing you to select the preferred method for installing the operating system. Given that we have locally downloaded the ISO, we will opt for the highlighted first choice: Local install media (ISO image or CDROM). Subsequently, click the [Forward] button to proceed.

Choose an ISO

Subsequently, you’ll be prompted to designate the ISO for the installation. Click the [Browse] button and either select the path to your ISO file or enter it in the provided text box. In this tutorial, the RHEL9 ISO is stored under /isos.

RHEL9 on KVM

Photo by admingeek from Infotechys

Click the [Forward] button to proceed.

RHEL9 on KVM

Photo by admingeek from Infotechys

Choose memory and CPU settings

In the third step of the five-step process, you’ll be prompted to configure the memory and CPU settings for your RHEL9 instance. In this demonstration, we’ve set the RAM to 4096 MB (4GB) and allocated 2 CPUs or cores. Proceed by clicking the [Forward] button.

Choose Memory and CPU settings window

Photo by admingeek from Infotechys

Choose a disk image

In the fourth step of the five-step process, you’ll be asked to determine how you want to configure a disk image for your RHEL9 virtual machine. Note that the “Create a disk image” option is preselected, but we won’t choose this as we’ve previously generated a qcow2 disk image (rhel9-vm.img) that we intend to use.

Instead, opt for the “Select or create custom option” beneath it and click the [Manage] button to proceed. This action will open another window displaying the contents of /var/lib/libvirt/images. Choose your qcow2 image and click the [Choose Volume] button to proceed.

RHEL9 on KVM - Choose a disk Image

Photo by admingeek from Infotechys

Finalize and Review Settings

In the fifth and final step, we are almost ready to initiate the installation, with just a few remaining administrative tasks to address.

Initially, assign a name to your RHEL9 instance. In our case, we chose rhel9_test_vm, but feel free to select a name that suits your preferences. Subsequently, enable the “Customize configuration before Install” option by checking the corresponding checkbox. This step ensures that we can verify all configurations before proceeding with the installation.

Lastly, from the dropdown menu, opt for the “Bridge device” option and input the details of your bridge interface. In our KVM host, the bridge interface is br01, but your interface may vary. Conclude by clicking the [Finish] button to proceed.

RHEL9 on KVM - Finalize Settings

Photo by admingeek from Infotechys

As evident in the above screenshot, all configurations appear satisfactory. We’ve also included a brief note in the description textbox to specify the type of VM we are constructing. Now, we are prepared to move forward with the RHEL9 Installer segment. Click the [Begin Installation – Green Check mark] button to proceed.

RHEL9 on KVM: Installation Step-by-Step (RHEL9 Installer)

Upon reaching the initial RHEL9 installer screen, you’ll encounter the choice between “Install Red Hat Enterprise Linux 9” and “Test this Media & Install” To proceed, use the [UP] arrow to highlight the first option (“Install Red Hat Enterprise Linux 9“) and press the [Enter] key to continue to the welcome screen.

RHEL9 on KVM - Welcome Screen

Photo by admingeek from Infotechys

Select the language and region that suits you or click the [Continue] button to proceed with the default options.

Installation Summary

At the RHEL9 installation summary window, you will be presented with a few options. First, let’s address the options highlighted in red text.

RHEL9 on KVM: Installation Summary

Photo by admingeek from Infotechys

Disk Partitioning

Navigate to the “Installation Destination” option within the SYSTEM category and proceed by clicking the disk icon under “Local Standard Disks” to mark it with a check. Subsequently, select the “Custom” radio button under Storage Configuration and click the blue [Done] button to proceed.

Photo by admingeek from Infotechys

Partition specifications

The manual disk partitioning procedure will include the following changes:

  1. Change the volume group name from rhel00 to vg00
  2. Allocate 15GB of storage space to the /root partition
  3. 20GB to the /home partition
  4. 2GB to the /boot partition
  5. 8GB to the /var partition
  6. 4GB to the swap partition
  7. Allocate the remaining available space (roughly 24GB) to the /extras partition. We can use this partition for extending or creating logical volumes as we see fit in the future.

Changing the volume group name

Altering the volume group name is a straightforward process, but before proceeding, it’s crucial to confirm the removal of all existing partitions from the disk, as depicted in the image below.

Photo by admingeek from Infotechys

Click the plus (“+”) sign to proceed with creating a partition. We will change the volume group name as part of this process.

Photo by admingeek from Infotechys

Click the down arrow next to the text box labeled “Mount Point:” and select the “/” for the root partition (as shown above). Then, enter the size you want allocated to root in the “Desired Capacity:” text box and click the [Add mount point] button to continue. 

Also, to modify the volume group name, as shown in the image below, utilize the down arrow next to the Volume Group. Select the “Create a new volume group” option, enter the new name (vg00) in the text box labeled Name:, and click the “Save” button to proceed.

Photo by admingeek from Infotechys

As evident in the screenshot below, the settings display both the modification of the volume group name and the adjustment of the root (/) partition.

Photo by admingeek from Infotechys

Proceed by following the identical steps to create the remaining partitions: Assign 2GB to /boot, 8GB to /var, 4GB to swap, and assign the remaining storage to /extras.

Photo by admingeek from Infotechys

NOTE: For the /extras partition, manually input /extras into the text box labeled “Mount Point:” as it may not be listed in the dropdown menu.

Photo by admingeek from Infotechys

Click the “Done” button and the “Accept Changes” button to continue.

RHEL9 on KVM: Software

This phase of the installation is straightforward as we won’t be making any adjustments. The default option, “Server with GUI,” will remain selected.

Photo by admingeek from Infotechys

RHEL9 on KVM: Network

Now that the disk partitioning is complete, we can proceed with configuring the hostname and network settings. For simplicity in this demonstration, we’ll opt for DHCP for the network setting. In the hostname text box at the bottom of the page, enter your desired hostname and click the [Apply] button to confirm the change.

Next, toggle the switch at the top right-hand corner of the screen (highlighted in red) to “ON.” Activating DHCP will automatically populate the IP address, subnet mask, default route, and DNS address for your machine.

Click the [Done] button to proceed.

Photo by admingeek from Infotechys

RHEL9 on KVM: User Settings

This segment of the installation process is straightforward. Establish a root password for your RHEL9 instance and create an administrative user account (for sudo access to root).

NOTE: In RHEL9, the root account is disabled by default as an additional security measure. You can choose to proceed with the default option or select the “Allow root SSH Login with password” option to enable a password-protected root account.

Photo by admingeek from Infotechys

Both options are located under the USER SETTINGS category. The RHEL9 on KVM Installation is 95% complete at this point.

Photo by admingeek from Infotechys

After finishing the USER SETTINGS section, the [Begin Installation] button should be highlighted in blue. This signifies that we are ready to initiate the RHEL9 package installation and system configuration process.

Photo by admingeek from Infotechys

RHEL9 on KVM: Installation in Progress

From this point onward, the CentOS package installer will commence installing all the essential packages needed for a RHEL9 Server with GUI instance. It’s advisable to take a break and step away from your terminal at this stage, as the process may take several minutes to complete.

Photo by admingeek from Infotechys

Post-Install Procedure

Once the installation is complete, your will be prompted to reboot your machine. Click the [Reboot System] button to continue.

Photo by admingeek from Infotechys

Your machine should boot to a login screen and thus, bring us to the end of this tutorial.

Photo by admingeek from Infotechys

Conclusion

Congratulations! You’ve successfully installed a RHEL9 virtual machine on KVM. Throughout this process, we covered various system configuration and administration topics, including network and hostname configuration, logical volume manager (LVM), and custom disk partitioning.

Did you find this article helpful? If so, please share your feedback in the comments section. We value your input and would love to hear from you.

 

Related Posts

Install CentOS8 on KVM
Commands
Install CentOS8 on KVM

In today’s tutorial, we will install CentOS8 on KVM. The install process is fairly straightforward and we will cover it here step-by-step. We will follow

Read More »

Leave a Reply

Your email address will not be published. Required fields are marked *