You can determine the virtualization technology used for a Linux guest virtual machine (VM) using the following methods:
- Check the output of the
dmesgcommand: This command outputs the system log messages. If the Linux guest VM is running on a hypervisor, you may see messages from the virtualization technology in the output of thedmesgcommand. - Check the output of the
lsmodcommand: This command lists the kernel modules currently loaded in the Linux guest VM. Some virtualization technologies have their own kernel modules, which can be identified by looking at the output of thelsmodcommand. - Check the
/proc/cpuinfofile: The/proc/cpuinfofile contains information about the host CPU. If the Linux guest VM is running on a hypervisor, you may see additional information in this file related to the virtualization technology. - Check the
/proc/modulesfile: The/proc/modulesfile lists the kernel modules that are currently loaded in the Linux guest VM. You can check this file for the presence of modules associated with specific virtualization technologies. - Use the
virt-whatutility: Thevirt-whatutility is a simple command-line tool that can identify the virtualization technology being used for a Linux guest VM. The tool checks various system files and outputs the names of any virtualization technologies that it finds. To installvirt-what, you can use the package manager of your Linux distribution (e.g., apt-get for Ubuntu, yum for CentOS).