How to install and configure the KVM hypervisor on a Linux host?

Note: This installation is for CentOS7, a Red Hat based Linux distribution; other Linux distros use different commands for installing a software.
___________________________________________________________________________________________

What is KVM?

KVM stands for Kernel based Virtual Machine; it is able to run multiple Linux based virtual machines. 

Installing KVM:
Open Terminal and then switch to the root user by entering su root command.




To install KVM and its needed dependencies run the fallowing command:

# yum install qemu-kvm qemu-img virt-manager libvirt libvirt-python libvirt-client virt-install virt-viewer bridge-utils dejavu-lgc-sans-fonts




After running the command  insert y and then press enter to download and install all packages.


Insert y again for "Yes" to complete the installation



After completing the installation, start the libvirtd service by entering the following commands:
# systemctl start libvirtd
# systemctl enable libvirtd 



These commands will start the libvirt service and enable it at boot.

Network Configuration
If you want to use your physical host interface as bridge, you should configure IP forwarding on your physical host as follow:

# echo "net.ipv4.ip_forward = 1" | tee /etc/sysctl.conf
# sysctl -p



Virtual Machine Manager
Now, to start using KVM, open the virtual machine manger through Linux Terminal by typing the virt-manager command: 


All needed tasks for the virtualization can be done in Virtual Machine Manger.


  Sources:

https://www.linuxtechi.com/install-kvm-hypervisor-on-centos-7-and-rhel-7/
https://www.marksei.com/howto-virtualization-kvm-centos-7/
https://www.cyberciti.biz/faq/how-to-install-kvm-on-centos-7-rhel-7-headless-server/

Other Tpics