vmware-checkvm
Detect if running inside a VMware virtual machine
TLDR
Return the current VMware software version (exit status determines whether the system is a VM or not)
Return the VMware hardware version
SYNOPSIS
vmware-checkvm [OPTIONS]
PARAMETERS
-h, --help
Displays the command's help message and exits.
-V, --version
Displays the command's version information and exits.
DESCRIPTION
vmware-checkvm is a command-line utility included as part of the VMware Tools suite, primarily installed on Linux guest operating systems running within a VMware virtualized environment. Its core function is to programmatically determine whether the system on which it is executed is currently operating inside a VMware virtual machine.
The command typically performs checks by looking for specific virtualization signatures, hardware characteristics, or DMI information that are unique to VMware hypervisors. It is widely used in automated scripts and system configurations that require different behaviors or optimizations based on the execution environment. For instance, a script might install VMware-specific drivers or enable certain features only if the system is detected as a VMware VM. The command's simplicity and directness make it a reliable tool for environment detection within VMware ecosystems. Its primary output mechanism is its exit code: 0 for a VMware VM, 1 if not, and higher values for errors.
CAVEATS
- Requires VMware Tools to be installed and running in the guest OS for the command to be available and function correctly.
- The command specifically detects VMware virtualization; it will return 1 (not a VMware VM) if run in other virtualization environments (e.g., VirtualBox, KVM, Hyper-V) or on physical hardware.
- It only indicates the presence of a VMware VM, not its specific configuration (e.g., vCPU count, memory, VM name).
- Sophisticated evasion techniques or nested virtualization configurations might sometimes influence its detection accuracy, though this is rare for typical use cases.
EXIT CODES
vmware-checkvm communicates its result primarily through its exit code:
- 0: The command successfully detected that the system is running inside a VMware virtual machine.
- 1: The command determined that the system is not running inside a VMware virtual machine (e.g., it's a physical machine or another type of hypervisor).
- >1: An error occurred during the execution of the command.
HISTORY
The vmware-checkvm utility has been a standard component of VMware Tools for Linux guest operating systems for many years, dating back to early versions of VMware Workstation and ESX/ESXi. Its consistent inclusion underscores its utility in scripting and automated deployments within VMware environments. While its core functionality has remained stable, it has evolved alongside VMware Tools to maintain compatibility with newer Linux kernels and VMware hypervisor versions, ensuring reliable detection across various VMware product lines. It is a fundamental part of the guest operating system's ability to recognize its virtualized context.
SEE ALSO
systemd-detect-virt(1), dmidecode(8), virt-what(1)