Red Hat / CentOS

How to Install KVM on CentOS 8

How to Install KVM on CentOS 8


KVM (short for Kernel-based Virtual Machine) is a Linux virtualization application that gives users the ability to turn their machine into a hypervisor and run multiple virtual machines in isolated environments.

KVM is an open source virtualization technology which converts your Linux machine into a type-1 bare-metal hypervisor that allows you to run multiple virtual machines (VMs) or guest VMs

KVM stands for Kernel based Virtual machine, as the name suggests KVM is a kernel module, once it is loaded into the kernel , then your Linux machine will start working as a KVM hypervisor. In this article we will demonstrate how to install KVM on RHEL 8 or CentOS 8 system but before start installing KVM on your system, first we have to make sure that your system’s processor supports hardware virtualization extensions like Intel VT or AMD-V and enabled it from BIOS.


How to Install CentOS 8

  • A system running CentOS 7 or 8
  • An account with root
  • Access to the command line/terminal

Install KVM in CentOS 8

Make sure before you start

BIOS enabled [VT-x, VT-d, AMD-v] .
vmx = Intel systems
svm = AMD systems

# egrep '(vmx|svm)' /proc/cpuinfo

Two methods to install :

Method 1  :

# dnf grouplist | grep -i virt
# dnf groupinstall 'Virtualization Host' # CentOS8 .
# yum groupinstall 'virtualization' # CentOS7 .

Method 2

CentOS 8 :

# dnf install qemu-kvm qemu-img \
libvirt libvirt-client python3-libvirt \
virt-install virt-top libguestfs-tools

CentOS 7 : [libvirt-python, birdge-utils]

# yum install qemu-kvm qemu-img \
libvirt libvirt-client libvirt-python \
bridge-utils virt-install virt-top libguestfs-tools

For GUI : I dont prefer that because of the default_pool .

# yum install virt-manager virt-viewer

# Notice :
= [bridge-utils] who provides [brctl] is replaced by iproute_[bridge] command .
= [bridge-utils] allow us bridging our VM into our physical NIC .
= You wont need the [bridge] command in this course, Except for checking purposes .

Enabling the service :

# systemctl start libvirtd
# systemctl enable --now libvirtd
# lsmod | grep -i kvm

FirewallD is enabled and SELinux is enforcing

Final Words

Congratulations! You have finally How to Install KVM on CentOS 8 on your server. Let us know in the comments how you managed to do it and dont forget to share it with your colleagues.

About the author

jon snow

Jon is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, and currently a content creator for ERRORHAT who loves working with computers and strongly believes in sharing knowledge.

Add Comment

Click here to post a comment