Files
cheatsheet-tldr/tldr/linux/systemd-detect-virt
2025-05-12 00:21:19 +00:00

30 lines
750 B
Plaintext

---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# 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:
`systemd-detect-virt {{[-q|--quiet]}}`
- Only detect container virtualization:
`systemd-detect-virt {{[-c|--container]}}`
- Only detect hardware virtualization:
`systemd-detect-virt {{[-v|--vm]}}`