LinuxCommandLibrary

systemd-detect-virt

Detect virtualization environment

TLDR

List detectable virtualization technologies

$ systemd-detect-virt --list
copy
Detect virtualization and print the result
$ systemd-detect-virt
copy
Silently check without printing anything
$ systemd-detect-virt -q
copy
Only detect container virtualization
$ systemd-detect-virt -c
copy
Only detect hardware virtualization
$ systemd-detect-virt -v
copy
Detect whether in a chroot environment
$ systemd-detect-virt -r
copy

SYNOPSIS

systemd-detect-virt [options]

DESCRIPTION

systemd-detect-virt detects whether the system is running in a virtualized environment and prints the detected virtualization technology. It returns exit code 0 if virtualization is detected, non-zero otherwise.
Detectable technologies include: KVM, QEMU, VMware, VirtualBox, Xen, Hyper-V, Docker, LXC, systemd-nspawn, and many others. The --list option shows all supported technologies.

PARAMETERS

--list

List all detectable virtualization technologies
-q, --quiet
Suppress output, only return exit code
-c, --container
Only detect container virtualization
-v, --vm
Only detect hardware VM virtualization
-r, --chroot
Detect chroot environment
--private-users
Detect user namespace

CAVEATS

Detection relies on various heuristics and may not detect all virtualization types. Some nested virtualization scenarios may report only the innermost layer. Part of the systemd suite.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community