How To Install virt-what on CentOS 8

virt-what is Detect if we are running in a virtual machine

Introduction

In this tutorial we learn how to install virt-what on CentOS 8.

What is virt-what

virt-what is a shell script which can be used to detect if the program is running in a virtual machine. The program prints out a list of “facts” about the virtual machine, derived from heuristics. One fact is printed per line. If nothing is printed and the script exits with code 0 (no error), then it can mean either that the program is running on bare-metal or the program is running inside a type of virtual machine which we don’t know about or can’t detect. Current types of virtualization detected - aws Amazon Web Services - bhyve FreeBSD hypervisor - docker Docker container - hyperv Microsoft Hyper-V - ibm_power-kvm IBM POWER KVM - ibm_power-lpar_shared - ibm_power-lpar_dedicated IBM POWER LPAR (hardware partition) - ibm_systemz-* IBM SystemZ Direct / LPAR / z/VM / KVM - ldoms Oracle VM Server for SPARC Logical Domains - linux_vserver Linux VServer container - lxc Linux LXC container - kvm Linux Kernel Virtual Machine (KVM) - lkvm LKVM / kvmtool - openvz OpenVZ or Virtuozzo - ovirt oVirt node - parallels Parallels Virtual Platform - powervm_lx86 IBM PowerVM Lx86 Linux/x86 emulator - qemu QEMU (unaccelerated) - rhev Red Hat Enterprise Virtualization - uml User-Mode Linux (UML) - virtage Hitachi Virtualization Manager (HVM) Virtage LPAR - virtualbox VirtualBox - virtualpc Microsoft VirtualPC - vmm vmm OpenBSD hypervisor - vmware VMware - xen Xen - xen-dom0 Xen dom0 (privileged domain) - xen-domU Xen domU (paravirtualized guest domain) - xen-hvm Xen guest fully virtualized (HVM)

We can use yum or dnf to install virt-what on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install virt-what.

Install virt-what on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install virt-what using dnf by running the following command:

sudo dnf -y install virt-what

Install virt-what on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install virt-what using yum by running the following command:

sudo yum -y install virt-what

How To Uninstall virt-what on CentOS 8

To uninstall only the virt-what package we can use the following command:

sudo dnf remove virt-what

virt-what Package Contents on CentOS 8

/usr/lib/.build-id
/usr/lib/.build-id/96
/usr/lib/.build-id/96/001eba6af8d36177f6d99c41f5d21a9c461ac5
/usr/libexec/virt-what-cpuid-helper
/usr/sbin/virt-what
/usr/share/doc/virt-what
/usr/share/doc/virt-what/COPYING
/usr/share/doc/virt-what/README
/usr/share/man/man1/virt-what.1.gz

References

Summary

In this tutorial we learn how to install virt-what on CentOS 8 using yum and dnf.