HowTo Install KVM Hypervisor RHEL 7 Kernel-Based Virtual Machine

We have many hypervisor’s in IT industry but opensource solutions are very popular. KVM is one of it. KVM stands for Kernel-Based Virtual Machine Using KVM we can run multiple machines within one server. It will support multiple operating systems Like: Windows, SUSE, Centos, Ubuntu and Etc.. In this Article we are going to see HowTo Install KVM Hypervisor (Kernel-Based Virtual Machine) RHEL 7/Centos 7.

KVM is called as kernel-Based because whenever you install packages which goes and load from kernel level modules.

KVM Hypervisor Advantages

  • No Vendor Dependency it’s fully Open source Solution
  • Cross Platform support
  • High Performance workloads accepted
  • Affordable and low cost
  • Highly Secure by SELinux technologies

Verify the processor type using below command, some times we have to enable virtualization option in BIOS or else full functionality of virtualization will not work. If your command get the output as shown below it works. If not VT is not enabled so your machines does not support for KVM.

# egrep '(vmx|svm)' /proc/cpuinfo
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid

Install KVM Hypervisor RHEL 7/Centos 7

During Operating System Installation also you can install Virtualization directly

Package Selection

Package Selection

Click on software Selection

Software Selection

Software Selection

Select Either Virtualization Host Or Server GUI and Select Virtualization selection

Prerequisites and required packages you have to install in order to get KVM functionality enabled

# yum install qemu-kvm qemu-img libvirt virt-install libvirt-python virt-manager virt-install libvirt-client virt-viewer

Or Else we can also used yum group to install virtualization

# yum groupinstall "Virtualization Host"
  • qemu-kvm = QEMU Emulator 
  • qemu-img = QEMU Disk Image Manager
  • virt-viewer = Graphical Interface to see virtual machine console
  • virt-manager = GUI to Manage Virtual Machines
  • libvirt = libvirtd daemon to run services
  • libvirt-client = Libvirt client packages

After installing required packages verify KVM module is visible from kernel using below command. Insert KVM module to kernel using modprobe command

[root@ArkitServer ~]# lsmod |grep kvm
[root@ArkitServer ~]# modprobe kvm
[root@ArkitServer ~]# lsmod |grep kvm
kvm 554609 0 
irqbypass 13503 1 kvm

Now Start KVM supportable services

# systemctl enable libvirt-guests.service 
Created symlink from /etc/systemd/system/multi-user.target.wants/libvirt-guests.service to /usr/lib/systemd/system/libvirt-guests.service.
# systemctl enable libvirtd
# systemctl start libvirt-guests.service
# systemctl start libvirtd
# systemctl status libvirt-guests.service 
# systemctl status libvirtd

Note: virt-Manager and virt-viewer required Graphical User Interface to launch virtual machine manager

If you have installed only minimal installation Operating system then you must install GUI

# yum install "@X Window System" xorg-x11-xauth xorg-x11-fonts-* xorg-x11-utils -y

Or

# yum groupinstall "Server with GUI"

Start Virt-Manager 

By Default virtual machines supportable files are going to store in /var/lib/libvirt/images/ make sure before start virt-manager you have enough space to deploy /create virtual machine. 

virt-manager we can either from command line or GUI ( install KVM Hypervisor ) 

From GUI Click on Applications –> System Tools –> Virtual Machine Manager

virt-manager from GUI

virt-manager from GUI

Command Line 

# virt-manager
Create New Virtual Machine from GUI

Create New Virtual Machine from GUI

Click on the Icon to create New Virtual Machine from GUI Mode

Creating Virtual Machine using KVM

Creating Virtual Machine using KVM

Select Appropriate option to load Operating system in this case i am selecting ISO or CD-ROM and Click Forward

Select ISO

Select ISO

You have ready with .iso file for installing operating system, copy .iso file to base Linux machine to attach. Browse and attach ISO file click Forward

CPU and Memory

CPU and Memory

Provide Appropriate CPU’s and Memory (RAM) for virtual machine and Click Forward

Disk Space

Disk Space

Provide Disk Space and Click Forward

Virtual Machine Final

Virtual Machine Final

Give virtual Machine name, Select Network options and Click Finish

# virt-install --name=ArkitRHEL7 --ram=1024 --vcpus=1 --cdrom=/var/lib/libvirt/images/rhel-server-7.3-x86_64-dvd.iso --os-type=linux --os-variant=rhel7  --network bridge=br0 --graphics=spice  --disk path=/var/lib/libvirt/images/rhel7.dsk,size=20

Instead of going trough all the above steps simply create Virtual Machine using command line

That’s it about Install KVM Hypervisor RHEL 7 Kernel-Based Virtual Machine

Related Articles

Setting Up Linux Lab at Home

Introduction to Linux Operating System Centos 7

Logical Volume Manager

Thanks for your wonderful Support and Encouragement

blank

Ravi Kumar Ankam

My Name is ARK. Expert in grasping any new technology, Interested in Sharing the knowledge. Learn more & Earn More

Leave a Reply

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