Note: This is an RHCSA 7 exam objective.

Prerequisites

Download the CentOS 7 distribution and install it with default configuration.

Choose a domain name (example.com strongly recommended), a host name (for example master.example.com) and an IP address compatible with your network environment (here 192.168.1.5, gateway is supposed to be 192.168.1.1).

Update your system:

# yum update

Installation Procedure

Install the KVM packages:

# yum group install "Virtualization Host"
# yum install -y virt-install
# yum install -y virt-top

Start the libvirtd service:

# systemctl start libvirtd

Activate the Chronyd/NTP service at boot and start it:

# systemctl enable chronyd && systemctl start chronyd

Check the installation:

# virt-host-validate
QEMU: Checking for hardware virtualization : PASS
QEMU: Checking for device /dev/kvm : PASS
QEMU: Checking for device /dev/vhost-net : PASS
QEMU: Checking for device /dev/net/tun : PASS
LXC: Checking for Linux >= 2.6.26 : PASS

To get optimal performances, activate the virtual-host tuned profile:

# tuned-adm profile virtual-host

KVM Tip

You have just installed a KVM host but this installation will only last for 1 year. After this period and a reboot, your KVM certificate will expire. Look at this tutorial about KVM certificate expiration to set up an installation for more than 1 year.