1SYSTEMD-DETECT-VIRT(1)        systemd-detect-virt       SYSTEMD-DETECT-VIRT(1)
2
3
4

NAME

6       systemd-detect-virt - Detect execution in a virtualized environment
7

SYNOPSIS

9       systemd-detect-virt [OPTIONS...]
10

DESCRIPTION

12       systemd-detect-virt detects execution in a virtualized environment. It
13       identifies the virtualization technology and can distinguish full VM
14       virtualization from container virtualization.  systemd-detect-virt
15       exits with a return value of 0 (success) if a virtualization technology
16       is detected, and non-zero (error) otherwise. By default any type of
17       virtualization is detected, and the options --container and --vm can be
18       used to limit what types of virtualization are detected.
19
20       When executed without --quiet will print a short identifier for the
21       detected virtualization technology. The following technologies are
22       currently identified:
23
24       Table 1. Known virtualization technologies (both VM, i.e. full hardware
25       virtualization, and container, i.e. shared kernel virtualization)
26       ┌──────────┬────────────────┬─────────────────────┐
27Type      ID             Product             
28       ├──────────┼────────────────┼─────────────────────┤
29       │          │ qemu           │ QEMU software       │
30       │          │                │ virtualization      │
31       │          ├────────────────┼─────────────────────┤
32       │          │ kvm            │ Linux KVM kernel    │
33       │          │                │ virtual machine     │
34       │          ├────────────────┼─────────────────────┤
35       │          │ zvm            │ s390 z/VM           │
36       │          ├────────────────┼─────────────────────┤
37       │          │ vmware         │ VMware Workstation  │
38       │          │                │ or Server, and      │
39       │          │                │ related products    │
40       │          ├────────────────┼─────────────────────┤
41       │          │ microsoft      │ Hyper-V, also known │
42       │          │                │ as Viridian or      │
43       │          │                │ Windows Server      │
44       │VM        │                │ Virtualization      │
45       │          ├────────────────┼─────────────────────┤
46       │          │ oracle         │ Oracle VM           │
47       │          │                │ VirtualBox          │
48       │          │                │ (historically       │
49       │          │                │ marketed by innotek │
50       │          │                │ and Sun             │
51       │          │                │ Microsystems)       │
52       │          ├────────────────┼─────────────────────┤
53       │          │ xen            │ Xen hypervisor      │
54       │          │                │ (only domU, not     │
55       │          │                │ dom0)               │
56       │          ├────────────────┼─────────────────────┤
57       │          │ bochs          │ Bochs Emulator      │
58       │          ├────────────────┼─────────────────────┤
59       │          │ uml            │ User-mode Linux     │
60       ├──────────┼────────────────┼─────────────────────┤
61       │          │ openvz         │ OpenVZ/Virtuozzo    │
62       │          ├────────────────┼─────────────────────┤
63       │          │ lxc            │ Linux container     │
64       │          │                │ implementation by   │
65       │          │                │ LXC                 │
66       │          ├────────────────┼─────────────────────┤
67       │          │ lxc-libvirt    │ Linux container     │
68       │          │                │ implementation by   │
69       │container │                │ libvirt             │
70       │          ├────────────────┼─────────────────────┤
71       │          │ systemd-nspawn │ systemd's minimal   │
72       │          │                │ container           │
73       │          │                │ implementation, see │
74       │          │                │ systemd-nspawn(1)
75       │          ├────────────────┼─────────────────────┤
76       │          │ docker         │ Docker container    │
77       │          │                │ manager             │
78       └──────────┴────────────────┴─────────────────────┘
79
80       If multiple virtualization solutions are used, only the "innermost" is
81       detected and identified. That means if both VM virtualization and
82       container virtualization are used in conjunction, only the latter will
83       be identified (unless --vm is passed).
84

OPTIONS

86       The following options are understood:
87
88       -c, --container
89           Only detects container virtualization (i.e. shared kernel
90           virtualization).
91
92       -v, --vm
93           Only detects VM virtualization (i.e. full hardware virtualization).
94
95       -q, --quiet
96           Suppress output of the virtualization technology identifier.
97
98       -h, --help
99           Print a short help text and exit.
100
101       --version
102           Print a short version string and exit.
103

EXIT STATUS

105       If a virtualization technology is detected, 0 is returned, a non-zero
106       code otherwise.
107

SEE ALSO

109       systemd(1), systemd-nspawn(1)
110
111
112
113systemd 219                                             SYSTEMD-DETECT-VIRT(1)
Impressum