2025-03-14 21:59:59 -06:00
|
|
|
# systemd-detect-virt
|
|
|
|
|
|
|
|
|
|
> Detect execution in a virtualized environment.
|
|
|
|
|
> More information: <https://www.freedesktop.org/software/systemd/man/systemd-detect-virt.html>.
|
|
|
|
|
|
|
|
|
|
- List detectable virtualization technologies:
|
|
|
|
|
|
|
|
|
|
`systemd-detect-virt --list`
|
|
|
|
|
|
|
|
|
|
- Detect virtualization, print the result and return a zero status code when running in a VM or a container, and a non-zero code otherwise:
|
|
|
|
|
|
|
|
|
|
`systemd-detect-virt`
|
|
|
|
|
|
|
|
|
|
- Silently check without printing anything:
|
|
|
|
|
|
2025-06-28 19:25:29 -06:00
|
|
|
`systemd-detect-virt {{[-q|--quiet]}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Only detect container virtualization:
|
|
|
|
|
|
2025-06-28 19:25:29 -06:00
|
|
|
`systemd-detect-virt {{[-c|--container]}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Only detect hardware virtualization:
|
|
|
|
|
|
2025-06-28 19:25:29 -06:00
|
|
|
`systemd-detect-virt {{[-v|--vm]}}`
|