How to Install KVM on RHEL 9 | Setup Virtualization & Create VMs
13K views
Mar 21, 2025
Learn how to install and configure KVM (Kernel-based Virtual Machine) on RHEL 9 for efficient virtualization. This step-by-step guide covers: ✅ Checking CPU virtualization support: grep -e 'vmx' /proc/cpuinfo # For Intel grep -e 'svm' /proc/cpuinfo # For AMD ✅ Updating your system: sudo dnf update -y sudo reboot ✅ Installing KVM packages: sudo dnf install -y virt-install virt-viewer libvirt virt-manager virt-top libguestfs-tools ✅ Enabling and starting the Libvirt service: sudo systemctl start libvirtd sudo systemctl enable libvirtd sudo systemctl status libvirtd # Check if running ✅ (Optional) Configuring a network bridge for better networking: sudo nmcli connection add type bridge autoconnect yes con-name kvmbr0 ifname kvmbr0
View Video Transcript
0:00
[Music]
0:05
hello everyone welcome back to our
0:07
Channel today we are diving into the
0:09
world of virtualization in this tutorial
0:12
we will explain how to install KVM on
0:14
rhl L system whether you are setting up
0:17
a test environment or exploring
0:19
virtualization For the First Time The
0:21
step-by-step tutorial has got you cover
0:24
before diving into the steps make sure
0:26
you have the following things in place
0:28
minimal install rhl line with desktop
0:31
environment a sudo user with admin
0:33
rights local repository or reded
0:36
subscription we need internet
0:38
connectivity if you are using a redhead
0:41
subscription for the interest of time I
0:43
have already prepared a set of commands
0:46
that I will use in this tutorial I will
0:48
say these commands in the description
0:50
for your reference I have already taken
0:53
the SSS session of my rhl L system let's
0:57
get started first thing first we need to
1:00
ensure our system supports
1:02
virtualization to verify
1:05
this we can run the
1:08
command
1:15
grab in double codes type
1:19
vmx and grab this vmx in
1:23
proc CPU info
1:26
file if you see the output highlighting
1:30
vmx then it confirms that your CPU
1:33
supports virtualization if there is no
1:36
output you might need to enable the
1:38
virtualization in your bio settings if
1:40
you are using AMD
1:43
processor you need to replace this
1:47
vmx with
1:53
svm as I'm using Intel based processor
1:56
so this command is not giving any output
1:59
altern way to verify whether your CPU
2:02
supports virtualization or
2:04
not we can run the command LS CPU and
2:08
then grip
2:15
virtualization in the output you should
2:17
see VT hyphen X it means we are using
2:21
Intel based processor and virtualization
2:24
Technologies
2:26
enabled before installing KVM it is a
2:29
good practice is to update your system
2:31
for that we can run the command sudu
2:37
dnf
2:39
update hyph
2:45
by this command will install all the
2:47
updates on your R line
2:57
system once the updates are complet
2:59
complete reboot your system using the
3:02
command
3:04
sudo space
3:07
reboot this ensures all the changes take
3:16
effect once the system is back online
3:19
after the reboot we will install
3:21
necessary virtualization packages like
3:23
word hyphen install word hyphen viewer
3:26
live word word hyphen manager word
3:29
hyphen top Li guest FS hyphen
3:34
tools copy this
3:42
command what hyphen install it is a
3:46
command line tool for creating virtual
3:48
machine word hyphen viewer it's a
3:51
lightweight interface for interacting
3:53
with virtual machine live what it's a
3:57
virtualization demon what hyphen manage
3:59
is a graphical user interface for
4:01
managing the virtual machines word
4:04
hyphen
4:05
top it is a utility for monitoring the
4:08
virtualization
4:10
stats lip guest FS ien tools this is
4:13
used for accessing and modifying the VM
4:16
disk
4:17
images now hit enter
4:33
next start and enable the Liberty
4:35
service to ensure it runs on the boot
4:38
run the
4:39
command sudo system
4:43
CTL start
4:51
Liberty it enter this will start the
4:54
Liberty service to enable the service
4:59
replace this start with unable keyword
5:02
and hit enter to confirm that Liberty
5:06
service is up and
5:08
running in the command sud sudo system
5:13
CTL status live
5:21
word this output confirms that Liber
5:23
service is up and running next step is
5:26
to configure a network bridge if you
5:28
plan to access your virtual machines
5:31
from the outside of your rhl L system
5:34
then you must configure the network
5:36
bridge first we need to identify the
5:39
primary interface which is configured on
5:41
our R line system for that we will be
5:44
using nmcli command line utility it's
5:48
network manager command line utility
5:50
which is used to configure the
5:52
networking on RH line
5:54
system let me clear the screen
5:58
first then in the command NM CLI
6:05
connection output confirms that we have
6:08
three different connections with the
6:10
name 0 S3 loop back for L and this
6:17
virtual BR Z and this is created
6:19
automatically whenever we are installing
6:21
KVM on any of the Linux system all right
6:25
so
6:26
0 S3 is our primary interface which is
6:30
currently configured on my
6:31
system now I will create a new
6:34
connection with the name KVM
6:37
br0 I will be creating a KVM BR Z
6:41
interface under this same connection
6:44
that is KVM BR Z once the connection is
6:47
created I will assign the same IP
6:50
address which is currently assigned to
6:52
our primary interface so in my case this
6:55
is the IP address which is currently
6:57
assigned to this 0 S3 so I will assign
7:01
this IP to my KVM br0
7:05
bridge and then I will assign the
7:08
Gateway IP address to this interface
7:10
which is KVM br0 similarly I will add
7:14
the DNS IP post that I will add this
7:18
interface EMP 0 in this bridge KVM brbr
7:22
Z as a slave copy this first command
7:35
if you can see this is my primary
7:38
interface and this is the IP address for
7:41
this interface let's create a new
7:54
connection in the output we can clearly
7:56
see that a new connection with KVM pr0
7:59
is created successfully if you rerun the
8:04
command you will see a new
8:08
connection with the name KVM
8:11
br0 type of
8:13
bridge and the interface name is KVM
8:18
br0 next assign the static IP address to
8:22
this bridge
8:35
this will assign the Gateway IP address
8:37
to the interface or the bridge KVM
8:47
br0 this command will add the DNS IP
8:50
address
9:02
our case interface name is np0
9:07
S3 all right this command will add this
9:10
interface 0
9:12
S3 as a slave to this bridge KVM
9:17
br0 H
9:20
enter next we need to set down the
9:23
current connection and we need to bring
9:25
up our KVM BR zero connection for that
9:28
we will be executing in these two
9:30
commands in one
9:35
Cod so once I hit enter here it
9:39
will disconnect my SSS
9:42
session I have to reconnect it after a
9:50
minute now try to SS again with the same
9:54
IP
10:00
if you type the command IP add space
10:05
show you will see that a new bridge with
10:09
the name KVM br0 is
10:12
active and the same IP which is assigned
10:16
to this EMP Z Now is assigned to this
10:21
KVM BR zero interface so overall we can
10:24
say that KVM BR Z is my primary
10:27
interface now next try to create and
10:30
manage virtual machines using word
10:32
manager but before that make sure your
10:34
user is added to the KVM and leave word
10:38
Group by doing so your local user will
10:41
able to run all the word command and can
10:44
manage the virtual machines without sudo
10:47
privileges
11:03
to make these changes into the fact log
11:05
out and login
11:18
again output confirms that my local user
11:21
now is a part of live word and KVM group
11:25
now start the word manager utility using
11:28
the command word hyphen
11:38
manager now create a new virtual
11:44
machine choose the first option local
11:46
install media in my case I have already
11:49
copied the ISO file on my RH line system
11:53
click on
11:54
forward click on
11:57
browse I have placed this ISO image
12:00
under this
12:02
location let's say I want to install ubu
12:05
just select the ubu ISO
12:08
file and click on
12:11
forward now specify the resources like
12:14
memory and CPU for your virtual
12:18
machine and click on
12:21
forward specify the disk for your
12:24
virtual machine in my case I am giving
12:26
it as 25gb click on forward
12:29
click on network selection make sure the
12:33
device name is selected as KVM br0 the
12:36
bridge device that we have created in
12:38
the previous step click on
12:44
finish all
12:46
right now follow the screen instructions
12:49
and finish the OS
12:54
installation other alternative way to
12:57
manage and create KVM VMS is via cockpit
13:00
console but cockpit console is not
13:03
installed by default on RH system first
13:05
we need to install cockpit and then
13:07
cockpit hyphen machines cockpit hyphen
13:09
machines package will allow us to manage
13:12
the KVM VMS from the cockpit console
13:15
let's install both these packages first
13:18
then the command
13:21
sudu dnf
13:25
install cockpit and then cockpit
13:30
hyphen
13:41
machines now start the cockpit
13:50
service verify it
13:55
status all right the service is up and
13:57
running
13:59
next access the cockpit web
14:02
console start the web browser type the
14:04
IP address of your uh primary interface
14:08
of your Rh line system in my case the
14:10
primary interface is KVM
14:13
br0 type the IP address here
14:17
192.168.1
14:19
do8
14:21
then followed by the port 9090 and hit
14:26
enter click on advanced
14:29
and accept the risk and continue because
14:33
cpit is using self-signed
14:37
certificate now specify your local user
14:42
here and it's
14:47
password click on
14:53
open all right now go to the virtual
14:55
machine sections
14:59
this is the VM that we have created
15:01
using the word manager currently the
15:03
state is set off now if you would like
15:05
to create a new VM then click on this
15:08
create
15:10
VM specify the name of your VM let's say
15:14
rhl
15:16
9 and then installation type is local
15:20
install
15:22
media specify the path of the ISO file
15:38
specify the disk that you would like to
15:41
assign to this virtual
15:43
machine and
15:47
memory then click on Create and
15:54
run all right you can see the state has
15:57
changed to running click on this
16:01
VM and then click on expand you will get
16:04
the
16:06
console now follow the screen
16:08
instructions and complete the
16:10
installation of your Rh line
16:18
system that's all from this video
16:21
tutorial if you found this helpful give
16:23
it a thumbs up subscribe our channel for
16:26
more Tech tutorials like this hit the
16:28
Bell Bell icon to stay updated feel free
16:31
to post your questions and feedback in
16:33
below comment section thanks for
16:35
watching see you in the next video bye
#Enterprise Technology
#Operating Systems