Install KVM Virtualization Host on CentOS 8 - CentLinux

Latest

Monday, 30 December 2019

Install KVM Virtualization Host on CentOS 8

Install KVM Virtualization Host on CentOS 8

KVM (Kernel based Virtual Machine) is the virtualization solution for Linux. It consist of a loadable Kernel module that allows the Linux Kernel to work as a Hypervisor. KVM provides hardware-assisted virtualization for a wide variety of guest operating systems.

In this article, we are installing KVM virtualization host on CentOS 8. We are also installing Cockpit to manage our KVM Virtualization environment through a graphical interface.

 

This Article Provides:

     

    System Requirements:

    The recommended system requirements for KVM are:

    • CPU - 1 CPU core or thread per virtual machine
    • Memory - 2 GB RAM for the virtualization host + 2 GB RAM for each intended guest
    • Storage - 6 GB space for the virtualization host + 6 GB space for each intended guest

     

    Environment Specification:

    We have configured a CentOS 8 (minimal) virtual machine with following specification.

    • CPU - 3.4 Ghz (2 cores)
    • Memory - 2 GB
    • Storage - 20 GB
    • Operating System - CentOS 8.0
    • Hostname - kvm-virtualization-01.recipes.com
    • IP Address - 192.168.116.206 /24

     

    Installing KVM Virtualization Host on CentOS 8:

    Connect with kvm-virtualization-01.recipes.com using ssh as root user.

    Verify support for Virtual Technology by the CPU.

    [root@kvm-virtualization-01 ~]# lscpu | grep Virtualization Virtualization: VT-x Virtualization type: full

    The output of the above command shows that, our server kvm-virtualization-01.recipes.com supports Virtualization.

    However, if the above command returns no result on your server then,

    1. In case of bare-metal machine, you have to enable the VT support from system BIOS.
    2. In case of virtual machine, you have to enable the VT support from VM's CPU Settings.

    In CentOS 8 / RHEL 8, virtualization components including KVM and QEMU hypervisors are bundled in virt module. Therefore, it is really simple now to configure a KVM virtualization host in CentOS 8.

    We are installing virt module using dnf command.

    [root@kvm-virtualization-01 ~]# dnf install -y @virt ... Installed: libguestfs-1:1.38.4-11.1.module_el8.0.0+189+f9babebb.x86_64 libvirt-client-4.5.0-24.3.module_el8.0.0+189+f9babebb.x86_64 libvirt-daemon-config-network-4.5.0-24.3.module_el8.0.0+189+f9babebb.x86_64 libvirt-daemon-kvm-4.5.0-24.3.module_el8.0.0+189+f9babebb.x86_64 alsa-lib-1.1.6-3.el8.x86_64 autogen-libopts-5.18.12-7.el8.x86_64 boost-atomic-1.66.0-6.el8.x86_64 boost-chrono-1.66.0-6.el8.x86_64 boost-date-time-1.66.0-6.el8.x86_64 boost-iostreams-1.66.0-6.el8.x86_64 boost-program-options-1.66.0-6.el8.x86_64 boost-random-1.66.0-6.el8.x86_64 boost-regex-1.66.0-6.el8.x86_64 boost-system-1.66.0-6.el8.x86_64 boost-thread-1.66.0-6.el8.x86_64 cairo-1.15.12-3.el8.x86_64 celt051-0.5.1.3-15.el8.x86_64 dnsmasq-2.79-4.el8.x86_64 edk2-ovmf-20180508gitee3198e672e2-9.el8_0.1.noarch fribidi-1.0.4-6.el8.x86_64 genisoimage-1.1.11-39.el8.x86_64 glusterfs-api-3.12.2-40.2.el8.x86_64 glusterfs-cli-3.12.2-40.2.el8.x86_64 gnutls-dane-3.6.5-2.el8.x86_64 gnutls-utils-3.6.5-2.el8.x86_64 graphite2-1.3.10-10.el8.x86_64 gstreamer1-1.14.0-3.el8.x86_64 gstreamer1-plugins-base-1.14.0-4.el8.x86_64 harfbuzz-1.7.5-3.el8.x86_64 hivex-1.3.15-7.module_el8.0.0+189+f9babebb.x86_64 ipxe-roms-qemu-20181214-1.git133f4c47.el8.noarch iso-codes-3.79-2.el8.noarch libX11-1.6.7-1.el8.x86_64 libX11-common-1.6.7-1.el8.noarch libX11-xcb-1.6.7-1.el8.x86_64 libXau-1.0.8-13.el8.x86_64 libXdamage-1.1.4-14.el8.x86_64 libXext-1.3.3-9.el8.x86_64 libXfixes-5.0.3-7.el8.x86_64 libXft-2.3.2-10.el8.x86_64 libXrender-0.9.10-7.el8.x86_64 libXv-1.0.11-7.el8.x86_64 libXxf86vm-1.1.4-9.el8.x86_64 libcacard-3:2.6.1-1.el8.x86_64 libdatrie-0.2.9-7.el8.x86_64 libepoxy-1.5.2-1.el8.x86_64 libglvnd-1:1.0.1-0.9.git5baa1e5.el8.x86_64 libglvnd-egl-1:1.0.1-0.9.git5baa1e5.el8.x86_64 libglvnd-gles-1:1.0.1-0.9.git5baa1e5.el8.x86_64 libglvnd-glx-1:1.0.1-0.9.git5baa1e5.el8.x86_64 libiscsi-1.18.0-7.module_el8.0.0+189+f9babebb.x86_64 libjpeg-turbo-1.5.3-7.el8.x86_64 libogg-2:1.3.2-10.el8.x86_64 libpmem-1.5-2.el8.x86_64 librados2-1:12.2.7-9.el8.x86_64 librbd1-1:12.2.7-9.el8.x86_64 libssh2-1.8.0-8.module_el8.0.0+189+f9babebb.1.x86_64 libthai-0.1.27-2.el8.x86_64 libtheora-1:1.1.1-21.el8.x86_64 libusal-1.1.11-39.el8.x86_64 libvirt-bash-completion-4.5.0-24.3.module_el8.0.0+189+f9babebb.x86_64 libvirt-daemon-4.5.0-24.3.module_el8.0.0+189+f9babebb.x86_64 libvirt-daemon-driver-interface-4.5.0-24.3.module_el8.0.0+189+f9babebb.x86_64 libvirt-daemon-driver-network-4.5.0-24.3.module_el8.0.0+189+f9babebb.x86_64 libvirt-daemon-driver-nodedev-4.5.0-24.3.module_el8.0.0+189+f9babebb.x86_64 libvirt-daemon-driver-nwfilter-4.5.0-24.3.module_el8.0.0+189+f9babebb.x86_64 libvirt-daemon-driver-qemu-4.5.0-24.3.module_el8.0.0+189+f9babebb.x86_64 libvirt-daemon-driver-secret-4.5.0-24.3.module_el8.0.0+189+f9babebb.x86_64 libvirt-daemon-driver-storage-4.5.0-24.3.module_el8.0.0+189+f9babebb.x86_64 libvirt-daemon-driver-storage-core-4.5.0-24.3.module_el8.0.0+189+f9babebb.x86_64 libvirt-daemon-driver-storage-disk-4.5.0-24.3.module_el8.0.0+189+f9babebb.x86_64 libvirt-daemon-driver-storage-gluster-4.5.0-24.3.module_el8.0.0+189+f9babebb.x86_64 libvirt-daemon-driver-storage-iscsi-4.5.0-24.3.module_el8.0.0+189+f9babebb.x86_64 libvirt-daemon-driver-storage-logical-4.5.0-24.3.module_el8.0.0+189+f9babebb.x86_64 libvirt-daemon-driver-storage-mpath-4.5.0-24.3.module_el8.0.0+189+f9babebb.x86_64 libvirt-daemon-driver-storage-rbd-4.5.0-24.3.module_el8.0.0+189+f9babebb.x86_64 libvirt-daemon-driver-storage-scsi-4.5.0-24.3.module_el8.0.0+189+f9babebb.x86_64 libvirt-libs-4.5.0-24.3.module_el8.0.0+189+f9babebb.x86_64 libvisual-1:0.4.0-24.el8.x86_64 libvorbis-1:1.3.6-1.el8.x86_64 libwayland-client-1.15.0-1.el8.x86_64 libwayland-cursor-1.15.0-1.el8.x86_64 libwayland-egl-1.15.0-1.el8.x86_64 libwayland-server-1.15.0-1.el8.x86_64 libxcb-1.13-5.el8.x86_64 libxshmfence-1.3-2.el8.x86_64 llvm-libs-7.0.1-3.module_el8.0.0+176+9dc62ab1.x86_64 mesa-dri-drivers-18.3.1-5.el8_0.x86_64 mesa-filesystem-18.3.1-5.el8_0.x86_64 mesa-libEGL-18.3.1-5.el8_0.x86_64 mesa-libGL-18.3.1-5.el8_0.x86_64 mesa-libgbm-18.3.1-5.el8_0.x86_64 mesa-libglapi-18.3.1-5.el8_0.x86_64 netcf-libs-0.2.8-11.module_el8.0.0+189+f9babebb.x86_64 nmap-ncat-2:7.70-4.el8.x86_64 nspr-4.21.0-2.el8_0.x86_64 nss-3.44.0-7.el8_0.x86_64 nss-softokn-3.44.0-7.el8_0.x86_64 nss-softokn-freebl-3.44.0-7.el8_0.x86_64 nss-sysinit-3.44.0-7.el8_0.x86_64 nss-util-3.44.0-7.el8_0.x86_64 opus-1.3-0.4.beta.el8.x86_64 orc-0.4.28-2.el8.x86_64 pango-1.42.4-5.el8_0.x86_64 pixman-0.36.0-1.el8.x86_64 qemu-img-15:2.12.0-65.module_el8.0.0+189+f9babebb.5.x86_64 qemu-kvm-15:2.12.0-65.module_el8.0.0+189+f9babebb.5.x86_64 qemu-kvm-block-curl-15:2.12.0-65.module_el8.0.0+189+f9babebb.5.x86_64 qemu-kvm-block-gluster-15:2.12.0-65.module_el8.0.0+189+f9babebb.5.x86_64 qemu-kvm-block-iscsi-15:2.12.0-65.module_el8.0.0+189+f9babebb.5.x86_64 qemu-kvm-block-rbd-15:2.12.0-65.module_el8.0.0+189+f9babebb.5.x86_64 qemu-kvm-block-ssh-15:2.12.0-65.module_el8.0.0+189+f9babebb.5.x86_64 qemu-kvm-common-15:2.12.0-65.module_el8.0.0+189+f9babebb.5.x86_64 qemu-kvm-core-15:2.12.0-65.module_el8.0.0+189+f9babebb.5.x86_64 radvd-2.17-12.el8.x86_64 scrub-2.5.2-12.el8.x86_64 seabios-bin-1.11.1-4.module_el8.0.0+189+f9babebb.noarch seavgabios-bin-1.11.1-4.module_el8.0.0+189+f9babebb.noarch sgabios-bin-1:0.20170427git-3.module_el8.0.0+189+f9babebb.noarch spice-server-0.14.0-7.el8.x86_64 supermin-5.1.19-9.module_el8.0.0+189+f9babebb.x86_64 usbredir-0.8.0-1.el8.x86_64 yajl-2.1.0-10.el8.x86_64 attr-2.4.48-3.el8.x86_64 augeas-libs-1.10.1-8.el8.x86_64 avahi-libs-0.7-19.el8.x86_64 binutils-2.30-49.el8.x86_64 bzip2-1.0.6-26.el8.x86_64 cryptsetup-2.0.6-1.el8.x86_64 cyrus-sasl-2.1.27-0.3rc7.el8.x86_64 cyrus-sasl-gssapi-2.1.27-0.3rc7.el8.x86_64 dejavu-fonts-common-2.35-6.el8.noarch dejavu-sans-fonts-2.35-6.el8.noarch device-mapper-multipath-libs-0.7.8-7.el8_0.2.x86_64 dosfstools-4.1-6.el8.x86_64 fontconfig-2.13.1-3.el8.x86_64 fontpackages-filesystem-1.44-22.el8.noarch gdisk-1.0.3-6.el8.x86_64 glusterfs-3.12.2-40.2.el8.x86_64 glusterfs-client-xlators-3.12.2-40.2.el8.x86_64 glusterfs-libs-3.12.2-40.2.el8.x86_64 gssproxy-0.8.0-5.el8.x86_64 iproute-tc-4.18.0-11.el8.x86_64 iscsi-initiator-utils-6.2.0.876-7.gitf3c8e90.el8.x86_64 iscsi-initiator-utils-iscsiuio-6.2.0.876-7.gitf3c8e90.el8.x86_64 isns-utils-libs-0.97-6.el8.x86_64 keyutils-1.5.10-6.el8.x86_64 libibumad-22-2.el8.x86_64 libibverbs-22-2.el8.x86_64 librdmacm-22-2.el8.x86_64 libverto-libevent-0.3.0-5.el8.x86_64 lzop-1.03-20.el8.x86_64 mdadm-4.1-4.el8.x86_64 mtools-4.0.18-14.el8.x86_64 nfs-utils-1:2.3.3-14.el8_0.2.x86_64 numad-0.5-26.20150602git.el8.x86_64 perl-Carp-1.42-396.el8.noarch perl-Errno-1.28-416.el8.x86_64 perl-Exporter-5.72-396.el8.noarch perl-File-Path-2.15-2.el8.noarch perl-IO-1.38-416.el8.x86_64 perl-PathTools-3.74-1.el8.x86_64 perl-Scalar-List-Utils-3:1.49-2.el8.x86_64 perl-Socket-4:2.027-2.el8.x86_64 perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch perl-Unicode-Normalize-1.25-396.el8.x86_64 perl-constant-1.33-396.el8.noarch perl-interpreter-4:5.26.3-416.el8.x86_64 perl-libs-4:5.26.3-416.el8.x86_64 perl-macros-4:5.26.3-416.el8.x86_64 perl-parent-1:0.237-1.el8.noarch perl-threads-1:2.21-2.el8.x86_64 perl-threads-shared-1.58-2.el8.x86_64 psmisc-23.1-3.el8.x86_64 quota-1:4.04-10.el8.x86_64 quota-nls-1:4.04-10.el8.noarch rdma-core-22-2.el8.x86_64 rpcbind-1.2.5-3.el8.x86_64 syslinux-6.04-1.el8.x86_64 syslinux-extlinux-6.04-1.el8.x86_64 syslinux-extlinux-nonlinux-6.04-1.el8.noarch syslinux-nonlinux-6.04-1.el8.noarch systemd-container-239-13.el8_0.5.x86_64 userspace-rcu-0.10.1-2.el8.x86_64 xml-common-0.6.3-50.el8.noarch Complete!

    We are also installing virt-install package, because it provides some very useful command line tools.

    [root@kvm-virtualization-01 ~]# dnf install -y virt-install Last metadata expiration check: 0:12:09 ago on Sun 29 Dec 2019 09:32:30 AM PKT. Dependencies resolved. ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: virt-install noarch 2.0.0-5.1.el8 AppStream 100 k Installing dependencies: libosinfo x86_64 1.2.0-5.el8 AppStream 244 k osinfo-db noarch 20181011-8.el8_0.1 AppStream 172 k osinfo-db-tools x86_64 1.2.0-1.el8 AppStream 90 k python3-libvirt x86_64 4.5.0-2.module_el8.0.0+189+f9babebb AppStream 291 k virt-manager-common noarch 2.0.0-5.1.el8 AppStream 921 k python3-chardet noarch 3.0.4-7.el8 BaseOS 195 k python3-pysocks noarch 1.6.8-3.el8 BaseOS 34 k python3-requests noarch 2.20.0-1.el8 BaseOS 123 k python3-urllib3 noarch 1.23-5.el8 BaseOS 178 k Transaction Summary ================================================================================ Install 10 Packages Total download size: 2.3 M Installed size: 10 M Downloading Packages: (1/10): osinfo-db-tools-1.2.0-1.el8.x86_64.rpm 44 kB/s | 90 kB 00:02 (2/10): osinfo-db-20181011-8.el8_0.1.noarch.rpm 59 kB/s | 172 kB 00:02 (3/10): libosinfo-1.2.0-5.el8.x86_64.rpm 74 kB/s | 244 kB 00:03 (4/10): virt-install-2.0.0-5.1.el8.noarch.rpm 85 kB/s | 100 kB 00:01 (5/10): python3-libvirt-4.5.0-2.module_el8.0.0+ 134 kB/s | 291 kB 00:02 (6/10): python3-pysocks-1.6.8-3.el8.noarch.rpm 27 kB/s | 34 kB 00:01 (7/10): virt-manager-common-2.0.0-5.1.el8.noarc 363 kB/s | 921 kB 00:02 (8/10): python3-chardet-3.0.4-7.el8.noarch.rpm 96 kB/s | 195 kB 00:02 (9/10): python3-requests-2.20.0-1.el8.noarch.rp 129 kB/s | 123 kB 00:00 (10/10): python3-urllib3-1.23-5.el8.noarch.rpm 203 kB/s | 178 kB 00:00 -------------------------------------------------------------------------------- Total 238 kB/s | 2.3 MB 00:09 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : python3-pysocks-1.6.8-3.el8.noarch 1/10 Installing : python3-urllib3-1.23-5.el8.noarch 2/10 Installing : python3-chardet-3.0.4-7.el8.noarch 3/10 Installing : python3-requests-2.20.0-1.el8.noarch 4/10 Installing : python3-libvirt-4.5.0-2.module_el8.0.0+189+f9babeb 5/10 Installing : osinfo-db-tools-1.2.0-1.el8.x86_64 6/10 Installing : osinfo-db-20181011-8.el8_0.1.noarch 7/10 Installing : libosinfo-1.2.0-5.el8.x86_64 8/10 Installing : virt-manager-common-2.0.0-5.1.el8.noarch 9/10 Installing : virt-install-2.0.0-5.1.el8.noarch 10/10 Running scriptlet: virt-install-2.0.0-5.1.el8.noarch 10/10 Verifying : libosinfo-1.2.0-5.el8.x86_64 1/10 Verifying : osinfo-db-20181011-8.el8_0.1.noarch 2/10 Verifying : osinfo-db-tools-1.2.0-1.el8.x86_64 3/10 Verifying : python3-libvirt-4.5.0-2.module_el8.0.0+189+f9babeb 4/10 Verifying : virt-install-2.0.0-5.1.el8.noarch 5/10 Verifying : virt-manager-common-2.0.0-5.1.el8.noarch 6/10 Verifying : python3-chardet-3.0.4-7.el8.noarch 7/10 Verifying : python3-pysocks-1.6.8-3.el8.noarch 8/10 Verifying : python3-requests-2.20.0-1.el8.noarch 9/10 Verifying : python3-urllib3-1.23-5.el8.noarch 10/10 Installed: virt-install-2.0.0-5.1.el8.noarch libosinfo-1.2.0-5.el8.x86_64 osinfo-db-20181011-8.el8_0.1.noarch osinfo-db-tools-1.2.0-1.el8.x86_64 python3-libvirt-4.5.0-2.module_el8.0.0+189+f9babebb.x86_64 virt-manager-common-2.0.0-5.1.el8.noarch python3-chardet-3.0.4-7.el8.noarch python3-pysocks-1.6.8-3.el8.noarch python3-requests-2.20.0-1.el8.noarch python3-urllib3-1.23-5.el8.noarch Complete!

    Validate all the components on your KVM host can support virtualization.

    [root@kvm-virtualization-01 ~]# virt-host-validate QEMU: Checking for hardware virtualization : PASS QEMU: Checking if device /dev/kvm exists : PASS QEMU: Checking if device /dev/kvm is accessible : PASS QEMU: Checking if device /dev/vhost-net exists : PASS QEMU: Checking if device /dev/net/tun exists : PASS QEMU: Checking for cgroup 'memory' controller support : PASS QEMU: Checking for cgroup 'memory' controller mount-point : PASS QEMU: Checking for cgroup 'cpu' controller support : PASS QEMU: Checking for cgroup 'cpu' controller mount-point : PASS QEMU: Checking for cgroup 'cpuacct' controller support : PASS QEMU: Checking for cgroup 'cpuacct' controller mount-point : PASS QEMU: Checking for cgroup 'cpuset' controller support : PASS QEMU: Checking for cgroup 'cpuset' controller mount-point : PASS QEMU: Checking for cgroup 'devices' controller support : PASS QEMU: Checking for cgroup 'devices' controller mount-point : PASS QEMU: Checking for cgroup 'blkio' controller support : PASS QEMU: Checking for cgroup 'blkio' controller mount-point : PASS QEMU: Checking for device assignment IOMMU support : PASS QEMU: Checking if IOMMU is enabled by kernel : WARN (IOMMU appears to be disabled in kernel. Add intel_iommu=on to kernel cmdline arguments)

    It looks like IOMMU (input-output memory management unit) support is not yet enabled in the CentOS 8 Kernel.

    The solution is already suggested by the above command. Therefore, we are adding the same in the Kernel command line options.

    [root@kvm-virtualization-01 ~]# grub2-editenv - set "$(grub2-editenv - list | grep kernelopts) intel_iommu=on"

    Restart your machine to make the above change effective.

    [root@kvm-virtualization-01 ~]# systemctl reboot

    After reboot, again run the virt-host-validate command.

    [root@kvm-virtualization-01 ~]# virt-host-validate QEMU: Checking for hardware virtualization : PASS QEMU: Checking if device /dev/kvm exists : PASS QEMU: Checking if device /dev/kvm is accessible : PASS QEMU: Checking if device /dev/vhost-net exists : PASS QEMU: Checking if device /dev/net/tun exists : PASS QEMU: Checking for cgroup 'memory' controller support : PASS QEMU: Checking for cgroup 'memory' controller mount-point : PASS QEMU: Checking for cgroup 'cpu' controller support : PASS QEMU: Checking for cgroup 'cpu' controller mount-point : PASS QEMU: Checking for cgroup 'cpuacct' controller support : PASS QEMU: Checking for cgroup 'cpuacct' controller mount-point : PASS QEMU: Checking for cgroup 'cpuset' controller support : PASS QEMU: Checking for cgroup 'cpuset' controller mount-point : PASS QEMU: Checking for cgroup 'devices' controller support : PASS QEMU: Checking for cgroup 'devices' controller mount-point : PASS QEMU: Checking for cgroup 'blkio' controller support : PASS QEMU: Checking for cgroup 'blkio' controller mount-point : PASS QEMU: Checking for device assignment IOMMU support : PASS QEMU: Checking if IOMMU is enabled by kernel : PASS

    Everything is fine now.

    KVM and QEMU hypervisors has been installed on CentOS 8.

     

    Installing Cockpit Web Interface in CentOS 8:

    Although, KVM commandline-tools are quite sufficient for managing a Virtualization environment. But, we can also use the CentOS 8 native Web UI i.e. Cockpit to manage virtual machines via a graphical interface.

    We are installing Cockpit using dnf command.

    [root@kvm-virtualization-01 ~]# dnf install -y cockpit Last metadata expiration check: 0:00:27 ago on Mon 30 Dec 2019 05:18:42 PM PKT. Dependencies resolved. ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: cockpit x86_64 185.1-1.el8_0 BaseOS 68 k Installing dependencies: PackageKit x86_64 1.1.12-2.el8 AppStream 600 k PackageKit-glib x86_64 1.1.12-2.el8 AppStream 141 k cairo-gobject x86_64 1.15.12-3.el8 AppStream 33 k python3-cairo x86_64 1.16.3-6.el8 AppStream 90 k python3-gobject x86_64 3.28.3-1.el8 AppStream 25 k python3-systemd x86_64 234-8.el8 AppStream 81 k setroubleshoot-plugins noarch 3.3.10-1.el8 AppStream 365 k checkpolicy x86_64 2.8-2.el8 BaseOS 338 k cockpit-bridge x86_64 185.1-1.el8_0 BaseOS 596 k cockpit-system noarch 185.1-1.el8_0 BaseOS 1.6 M cockpit-ws x86_64 185.1-1.el8_0 BaseOS 834 k gdk-pixbuf2 x86_64 2.36.12-2.el8 BaseOS 466 k glib-networking x86_64 2.56.1-1.1.el8 BaseOS 155 k gsettings-desktop-schemas x86_64 3.28.1-1.el8 BaseOS 619 k json-glib x86_64 1.4.4-1.el8 BaseOS 144 k libappstream-glib x86_64 0.7.14-3.el8 BaseOS 338 k libmodman x86_64 2.0.1-17.el8 BaseOS 36 k libproxy x86_64 0.4.15-5.2.el8 BaseOS 75 k libsoup x86_64 2.62.3-1.el8 BaseOS 424 k libstemmer x86_64 0-10.585svn.el8 BaseOS 73 k policycoreutils-python-utils noarch 2.8-16.1.el8 BaseOS 228 k python3-audit x86_64 3.0-0.10.20180831git0047a6c.el8 BaseOS 85 k python3-libsemanage x86_64 2.8-5.el8 BaseOS 127 k python3-policycoreutils noarch 2.8-16.1.el8 BaseOS 2.2 M python3-setools x86_64 4.2.0-2.el8 BaseOS 598 k Installing weak dependencies: centos-logos x86_64 80.5-2.el8 AppStream 706 k cockpit-packagekit noarch 184.1-1.el8 AppStream 675 k setroubleshoot-server x86_64 3.3.19-1.el8 AppStream 395 k sscg x86_64 2.3.3-6.el8 AppStream 43 k Transaction Summary ================================================================================ Install 30 Packages Total download size: 12 M Installed size: 34 M Downloading Packages: (1/30): cairo-gobject-1.15.12-3.el8.x86_64.rpm 23 kB/s | 33 kB 00:01 (2/30): PackageKit-glib-1.1.12-2.el8.x86_64.rpm 71 kB/s | 141 kB 00:01 (3/30): PackageKit-1.1.12-2.el8.x86_64.rpm 102 kB/s | 600 kB 00:05 (4/30): python3-cairo-1.16.3-6.el8.x86_64.rpm 96 kB/s | 90 kB 00:00 (5/30): python3-gobject-3.28.3-1.el8.x86_64.rpm 58 kB/s | 25 kB 00:00 (6/30): cockpit-packagekit-184.1-1.el8.noarch.r 124 kB/s | 675 kB 00:05 (7/30): python3-systemd-234-8.el8.x86_64.rpm 91 kB/s | 81 kB 00:00 (8/30): centos-logos-80.5-2.el8.x86_64.rpm 101 kB/s | 706 kB 00:07 (9/30): setroubleshoot-plugins-3.3.10-1.el8.noa 212 kB/s | 365 kB 00:01 (10/30): checkpolicy-2.8-2.el8.x86_64.rpm 264 kB/s | 338 kB 00:01 (11/30): cockpit-185.1-1.el8_0.x86_64.rpm 95 kB/s | 68 kB 00:00 (12/30): sscg-2.3.3-6.el8.x86_64.rpm 10 kB/s | 43 kB 00:04 (13/30): setroubleshoot-server-3.3.19-1.el8.x86 82 kB/s | 395 kB 00:04 (14/30): cockpit-bridge-185.1-1.el8_0.x86_64.rp 149 kB/s | 596 kB 00:03 (15/30): cockpit-ws-185.1-1.el8_0.x86_64.rpm 135 kB/s | 834 kB 00:06 (16/30): gdk-pixbuf2-2.36.12-2.el8.x86_64.rpm 95 kB/s | 466 kB 00:04 (17/30): glib-networking-2.56.1-1.1.el8.x86_64. 152 kB/s | 155 kB 00:01 (18/30): json-glib-1.4.4-1.el8.x86_64.rpm 121 kB/s | 144 kB 00:01 (19/30): libappstream-glib-0.7.14-3.el8.x86_64. 143 kB/s | 338 kB 00:02 (20/30): libmodman-2.0.1-17.el8.x86_64.rpm 38 kB/s | 36 kB 00:00 (21/30): libproxy-0.4.15-5.2.el8.x86_64.rpm 75 kB/s | 75 kB 00:00 (22/30): cockpit-system-185.1-1.el8_0.noarch.rp 120 kB/s | 1.6 MB 00:13 (23/30): libstemmer-0-10.585svn.el8.x86_64.rpm 92 kB/s | 73 kB 00:00 (24/30): gsettings-desktop-schemas-3.28.1-1.el8 92 kB/s | 619 kB 00:06 (25/30): policycoreutils-python-utils-2.8-16.1. 208 kB/s | 228 kB 00:01 (26/30): libsoup-2.62.3-1.el8.x86_64.rpm 131 kB/s | 424 kB 00:03 (27/30): python3-audit-3.0-0.10.20180831git0047 41 kB/s | 85 kB 00:02 (28/30): python3-libsemanage-2.8-5.el8.x86_64.r 91 kB/s | 127 kB 00:01 (29/30): python3-setools-4.2.0-2.el8.x86_64.rpm 237 kB/s | 598 kB 00:02 (30/30): python3-policycoreutils-2.8-16.1.el8.n 271 kB/s | 2.2 MB 00:08 -------------------------------------------------------------------------------- Total 298 kB/s | 12 MB 00:41 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : json-glib-1.4.4-1.el8.x86_64 1/30 Installing : python3-audit-3.0-0.10.20180831git0047a6c.el8.x86_ 2/30 Installing : gdk-pixbuf2-2.36.12-2.el8.x86_64 3/30 Running scriptlet: gdk-pixbuf2-2.36.12-2.el8.x86_64 3/30 Installing : python3-setools-4.2.0-2.el8.x86_64 4/30 Installing : python3-libsemanage-2.8-5.el8.x86_64 5/30 Installing : libstemmer-0-10.585svn.el8.x86_64 6/30 Running scriptlet: libstemmer-0-10.585svn.el8.x86_64 6/30 Installing : libmodman-2.0.1-17.el8.x86_64 7/30 Running scriptlet: libmodman-2.0.1-17.el8.x86_64 7/30 Installing : libproxy-0.4.15-5.2.el8.x86_64 8/30 Running scriptlet: libproxy-0.4.15-5.2.el8.x86_64 8/30 Installing : gsettings-desktop-schemas-3.28.1-1.el8.x86_64 9/30 Installing : glib-networking-2.56.1-1.1.el8.x86_64 10/30 Installing : cockpit-bridge-185.1-1.el8_0.x86_64 11/30 Installing : libsoup-2.62.3-1.el8.x86_64 12/30 Installing : libappstream-glib-0.7.14-3.el8.x86_64 13/30 Installing : checkpolicy-2.8-2.el8.x86_64 14/30 Installing : python3-policycoreutils-2.8-16.1.el8.noarch 15/30 Installing : policycoreutils-python-utils-2.8-16.1.el8.noarch 16/30 Installing : sscg-2.3.3-6.el8.x86_64 17/30 Installing : python3-systemd-234-8.el8.x86_64 18/30 Installing : python3-cairo-1.16.3-6.el8.x86_64 19/30 Installing : centos-logos-80.5-2.el8.x86_64 20/30 Running scriptlet: centos-logos-80.5-2.el8.x86_64 20/30 Running scriptlet: cockpit-ws-185.1-1.el8_0.x86_64 21/30 Installing : cockpit-ws-185.1-1.el8_0.x86_64 21/30 Running scriptlet: cockpit-ws-185.1-1.el8_0.x86_64 21/30 Installing : cairo-gobject-1.15.12-3.el8.x86_64 22/30 Installing : python3-gobject-3.28.3-1.el8.x86_64 23/30 Installing : setroubleshoot-plugins-3.3.10-1.el8.noarch 24/30 Running scriptlet: setroubleshoot-server-3.3.19-1.el8.x86_64 25/30 Installing : setroubleshoot-server-3.3.19-1.el8.x86_64 25/30 Running scriptlet: setroubleshoot-server-3.3.19-1.el8.x86_64 25/30 Installing : cockpit-system-185.1-1.el8_0.noarch 26/30 Installing : PackageKit-glib-1.1.12-2.el8.x86_64 27/30 Installing : PackageKit-1.1.12-2.el8.x86_64 28/30 Running scriptlet: PackageKit-1.1.12-2.el8.x86_64 28/30 Installing : cockpit-packagekit-184.1-1.el8.noarch 29/30 Installing : cockpit-185.1-1.el8_0.x86_64 30/30 Running scriptlet: centos-logos-80.5-2.el8.x86_64 30/30 Running scriptlet: cockpit-185.1-1.el8_0.x86_64 30/30 Verifying : PackageKit-1.1.12-2.el8.x86_64 1/30 Verifying : PackageKit-glib-1.1.12-2.el8.x86_64 2/30 Verifying : cairo-gobject-1.15.12-3.el8.x86_64 3/30 Verifying : centos-logos-80.5-2.el8.x86_64 4/30 Verifying : cockpit-packagekit-184.1-1.el8.noarch 5/30 Verifying : python3-cairo-1.16.3-6.el8.x86_64 6/30 Verifying : python3-gobject-3.28.3-1.el8.x86_64 7/30 Verifying : python3-systemd-234-8.el8.x86_64 8/30 Verifying : setroubleshoot-plugins-3.3.10-1.el8.noarch 9/30 Verifying : setroubleshoot-server-3.3.19-1.el8.x86_64 10/30 Verifying : sscg-2.3.3-6.el8.x86_64 11/30 Verifying : checkpolicy-2.8-2.el8.x86_64 12/30 Verifying : cockpit-185.1-1.el8_0.x86_64 13/30 Verifying : cockpit-bridge-185.1-1.el8_0.x86_64 14/30 Verifying : cockpit-system-185.1-1.el8_0.noarch 15/30 Verifying : cockpit-ws-185.1-1.el8_0.x86_64 16/30 Verifying : gdk-pixbuf2-2.36.12-2.el8.x86_64 17/30 Verifying : glib-networking-2.56.1-1.1.el8.x86_64 18/30 Verifying : gsettings-desktop-schemas-3.28.1-1.el8.x86_64 19/30 Verifying : json-glib-1.4.4-1.el8.x86_64 20/30 Verifying : libappstream-glib-0.7.14-3.el8.x86_64 21/30 Verifying : libmodman-2.0.1-17.el8.x86_64 22/30 Verifying : libproxy-0.4.15-5.2.el8.x86_64 23/30 Verifying : libsoup-2.62.3-1.el8.x86_64 24/30 Verifying : libstemmer-0-10.585svn.el8.x86_64 25/30 Verifying : policycoreutils-python-utils-2.8-16.1.el8.noarch 26/30 Verifying : python3-audit-3.0-0.10.20180831git0047a6c.el8.x86_ 27/30 Verifying : python3-libsemanage-2.8-5.el8.x86_64 28/30 Verifying : python3-policycoreutils-2.8-16.1.el8.noarch 29/30 Verifying : python3-setools-4.2.0-2.el8.x86_64 30/30 Installed: cockpit-185.1-1.el8_0.x86_64 centos-logos-80.5-2.el8.x86_64 cockpit-packagekit-184.1-1.el8.noarch setroubleshoot-server-3.3.19-1.el8.x86_64 sscg-2.3.3-6.el8.x86_64 PackageKit-1.1.12-2.el8.x86_64 PackageKit-glib-1.1.12-2.el8.x86_64 cairo-gobject-1.15.12-3.el8.x86_64 python3-cairo-1.16.3-6.el8.x86_64 python3-gobject-3.28.3-1.el8.x86_64 python3-systemd-234-8.el8.x86_64 setroubleshoot-plugins-3.3.10-1.el8.noarch checkpolicy-2.8-2.el8.x86_64 cockpit-bridge-185.1-1.el8_0.x86_64 cockpit-system-185.1-1.el8_0.noarch cockpit-ws-185.1-1.el8_0.x86_64 gdk-pixbuf2-2.36.12-2.el8.x86_64 glib-networking-2.56.1-1.1.el8.x86_64 gsettings-desktop-schemas-3.28.1-1.el8.x86_64 json-glib-1.4.4-1.el8.x86_64 libappstream-glib-0.7.14-3.el8.x86_64 libmodman-2.0.1-17.el8.x86_64 libproxy-0.4.15-5.2.el8.x86_64 libsoup-2.62.3-1.el8.x86_64 libstemmer-0-10.585svn.el8.x86_64 policycoreutils-python-utils-2.8-16.1.el8.noarch python3-audit-3.0-0.10.20180831git0047a6c.el8.x86_64 python3-libsemanage-2.8-5.el8.x86_64 python3-policycoreutils-2.8-16.1.el8.noarch python3-setools-4.2.0-2.el8.x86_64 Complete!

    To add support of managing virtual machines via Cockpit, we have to install cockpit-machines package.

    [root@kvm-virtualization-01 ~]# dnf install -y cockpit-machines Last metadata expiration check: 0:04:06 ago on Mon 30 Dec 2019 05:18:42 PM PKT. Dependencies resolved. ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: cockpit-machines noarch 184.1-1.el8 AppStream 669 k Installing dependencies: libvirt-dbus x86_64 1.2.0-3.module_el8.0.0+189+f9babebb AppStream 88 k libvirt-glib x86_64 2.0.0-1.el8 AppStream 100 k Transaction Summary ================================================================================ Install 3 Packages Total download size: 856 k Installed size: 1.2 M Downloading Packages: (1/3): libvirt-dbus-1.2.0-3.module_el8.0.0+189+ 146 kB/s | 88 kB 00:00 (2/3): libvirt-glib-2.0.0-1.el8.x86_64.rpm 106 kB/s | 100 kB 00:00 (3/3): cockpit-machines-184.1-1.el8.noarch.rpm 280 kB/s | 669 kB 00:02 -------------------------------------------------------------------------------- Total 234 kB/s | 856 kB 00:03 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : libvirt-glib-2.0.0-1.el8.x86_64 1/3 Running scriptlet: libvirt-glib-2.0.0-1.el8.x86_64 1/3 Running scriptlet: libvirt-dbus-1.2.0-3.module_el8.0.0+189+f9babebb.x86 2/3 Installing : libvirt-dbus-1.2.0-3.module_el8.0.0+189+f9babebb.x86 2/3 Installing : cockpit-machines-184.1-1.el8.noarch 3/3 Running scriptlet: cockpit-machines-184.1-1.el8.noarch 3/3 Verifying : cockpit-machines-184.1-1.el8.noarch 1/3 Verifying : libvirt-dbus-1.2.0-3.module_el8.0.0+189+f9babebb.x86 2/3 Verifying : libvirt-glib-2.0.0-1.el8.x86_64 3/3 Installed: cockpit-machines-184.1-1.el8.noarch libvirt-dbus-1.2.0-3.module_el8.0.0+189+f9babebb.x86_64 libvirt-glib-2.0.0-1.el8.x86_64 Complete!

    Enable and start Cockpit Unit.

    [root@kvm-virtualization-01 ~]# systemctl enable --now cockpit.socket Created symlink /etc/systemd/system/sockets.target.wants/cockpit.socket รข /usr/lib/systemd/system/cockpit.socket.

    Cockpit service is by-default allowed in CentOS 8 firewall.

    Browse URL https://kvm-virtualization-01.recipes.com:9090/ in a client's browser.

    The Cockpit uses a self-signed SSL certificate, therefore, you may see a Security warning.

    Ignore the Security warning and continue to the website.

    01-install-kvm-virtualization-centos-8-cockpit-loging

    Login to Cockpit Web UI as root user.

    02-install-kvm-virtualization-centos-8-cockpit-dashboard

    Click on the Virtual Machines from the left side-pane.

    03-install-kvm-virtualization-centos-8-cockpit-virtual-machines

    We are now at the Virtual Machines page. We can manage our KVM virtualization environment from here.

    We have successfully installed KVM virtualization host on CentOS 8. For further studies, please read Foundations of Libvirt Development by Apress.

    No comments:

    Post a comment