Virtual

sys_virt_status

Determine whether the host is a virtual machine or physical host by inspecting /proc/cpuinfo for hypervisor and virtualisation CPU flags.

Exit codes

  • 0: Always

Output on stdout

  • "virtual", "physical", or "unknown"

is_azure

Detect whether the host is running on Microsoft Azure. Checks for waagent.log containing "Azure" as the primary indicator.

Exit codes

  • 0: Host appears to be on Azure
  • 1: Host does not appear to be on Azure

is_aws

Detect whether the host is running on Amazon Web Services (EC2). Checks /sys/hypervisor/uuid, DMI product_uuid, and the instance identity document endpoint. Note: not updated for IMDSv2.

Exit codes

  • 0: Host appears to be on AWS EC2
  • 1: Host does not appear to be on AWS EC2

sys_virt_type

Detect the hypervisor or container runtime type. Tries virt-what first, then dmidecode, then falls back to /proc and filesystem heuristics.

Exit codes

  • 0: Always

Output on stdout

  • Virtualisation type string, e.g. "virtualbox", "vmware", "xen", "kvm", "qemu", "docker", "podman"