pub fn detect_virt() -> Result<SystemdDetectVirtOutput, Error>
Expand description
Detects whether currently running in a virtualized or containerized Linux environment.
Uses systemd-detect-virt to detect virtualization and containerization environments and
returns its output in the form of a SystemdDetectVirtOutput
.
ยงErrors
Returns an error if
- systemd-detect-virt cannot be found,
- systemd-detect-virt cannot be executed successfully,
- or the output of systemd-detect-virt does not match any variant of
SystemdDetectVirtOutput
.