Debian Codegraph @

upstream/debian-trixie/man1/systemd-detect-virt.1

raw
1 '\" t
2 .TH "SYSTEMD\-DETECT\-VIRT" "1" "" "systemd 257.13" "systemd-detect-virt"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 systemd-detect-virt \- Detect execution in a virtualized environment
24 .SH "SYNOPSIS"
25 .HP \w'\fBsystemd\-detect\-virt\fR\ 'u
26 \fBsystemd\-detect\-virt\fR [OPTIONS...]
27 .SH "DESCRIPTION"
28 .PP
29 \fBsystemd\-detect\-virt\fR
30 detects execution in a virtualized environment\&. It identifies the virtualization technology and can distinguish full machine virtualization from container virtualization\&.
31 systemd\-detect\-virt
32 exits with a return value of 0 (success) if a virtualization technology is detected, and non\-zero (error) otherwise\&. By default, any type of virtualization is detected, and the options
33 \fB\-\-container\fR
34 and
35 \fB\-\-vm\fR
36 can be used to limit what types of virtualization are detected\&.
37 .PP
38 When executed without
39 \fB\-\-quiet\fR
40 will print a short identifier for the detected virtualization technology\&. The following technologies are currently identified:
41 .sp
42 .it 1 an-trap
43 .nr an-no-space-flag 1
44 .nr an-break-flag 1
45 .br
46 .B Table\ \&1.\ \&Known virtualization technologies (both VM, i\&.e\&. full hardware virtualization, and container, i\&.e\&. shared kernel virtualization)
47 .TS
48 allbox tab(:);
49 lB lB lB.
50 T{
51 Type
52 T}:T{
53 ID
54 T}:T{
55 Product
56 T}
57 .T&
58 lt l l
59 ^ l l
60 ^ l l
61 ^ l l
62 ^ l l
63 ^ l l
64 ^ l l
65 ^ l l
66 ^ l l
67 ^ l l
68 ^ l l
69 ^ l l
70 ^ l l
71 ^ l l
72 ^ l l
73 ^ l l
74 ^ l l
75 ^ l l
76 lt l l
77 ^ l l
78 ^ l l
79 ^ l l
80 ^ l l
81 ^ l l
82 ^ l l
83 ^ l l
84 ^ l l
85 ^ l l.
86 T{
87 VM
88 T}:T{
89 \fIqemu\fR
90 T}:T{
91 QEMU software virtualization, without KVM
92 T}
93 :T{
94 \fIkvm\fR
95 T}:T{
96 Linux KVM kernel virtual machine, in combination with QEMU\&. Not used for other virtualizers using the KVM interfaces, such as Oracle VirtualBox or Amazon EC2 Nitro, see below\&.
97 T}
98 :T{
99 \fIamazon\fR
100 T}:T{
101 Amazon EC2 Nitro using Linux KVM
102 T}
103 :T{
104 \fIzvm\fR
105 T}:T{
106 s390 z/VM
107 T}
108 :T{
109 \fIvmware\fR
110 T}:T{
111 VMware Workstation or Server, and related products
112 T}
113 :T{
114 \fImicrosoft\fR
115 T}:T{
116 Hyper\-V, also known as Viridian or Windows Server Virtualization
117 T}
118 :T{
119 \fIoracle\fR
120 T}:T{
121 Oracle VM VirtualBox (historically marketed by innotek and Sun Microsystems), for legacy and KVM hypervisor
122 T}
123 :T{
124 \fIpowervm\fR
125 T}:T{
126 IBM PowerVM hypervisor \(em comes as firmware with some IBM POWER servers
127 T}
128 :T{
129 \fIxen\fR
130 T}:T{
131 Xen hypervisor (only domU, not dom0)
132 T}
133 :T{
134 \fIbochs\fR
135 T}:T{
136 Bochs Emulator
137 T}
138 :T{
139 \fIuml\fR
140 T}:T{
141 User\-mode Linux
142 T}
143 :T{
144 \fIparallels\fR
145 T}:T{
146 Parallels Desktop, Parallels Server
147 T}
148 :T{
149 \fIbhyve\fR
150 T}:T{
151 bhyve, FreeBSD hypervisor
152 T}
153 :T{
154 \fIqnx\fR
155 T}:T{
156 QNX hypervisor
157 T}
158 :T{
159 \fIacrn\fR
160 T}:T{
161 \m[blue]\fBACRN hypervisor\fR\m[]\&\s-2\u[1]\d\s+2
162 T}
163 :T{
164 \fIapple\fR
165 T}:T{
166 \m[blue]\fBApple virtualization framework\fR\m[]\&\s-2\u[2]\d\s+2
167 T}
168 :T{
169 \fIsre\fR
170 T}:T{
171 \m[blue]\fBLMHS SRE hypervisor\fR\m[]\&\s-2\u[3]\d\s+2
172 T}
173 :T{
174 \fIgoogle\fR
175 T}:T{
176 \m[blue]\fBGoogle Compute Engine\fR\m[]\&\s-2\u[4]\d\s+2
177 T}
178 T{
179 Container
180 T}:T{
181 \fIopenvz\fR
182 T}:T{
183 OpenVZ/Virtuozzo
184 T}
185 :T{
186 \fIlxc\fR
187 T}:T{
188 Linux container implementation by LXC
189 T}
190 :T{
191 \fIlxc\-libvirt\fR
192 T}:T{
193 Linux container implementation by libvirt
194 T}
195 :T{
196 \fIsystemd\-nspawn\fR
197 T}:T{
198 systemd\*(Aqs minimal container implementation, see \fBsystemd-nspawn\fR(1)
199 T}
200 :T{
201 \fIdocker\fR
202 T}:T{
203 Docker container manager
204 T}
205 :T{
206 \fIpodman\fR
207 T}:T{
208 \m[blue]\fBPodman\fR\m[]\&\s-2\u[5]\d\s+2 container manager
209 T}
210 :T{
211 \fIrkt\fR
212 T}:T{
213 rkt app container runtime
214 T}
215 :T{
216 \fIwsl\fR
217 T}:T{
218 \m[blue]\fBWindows Subsystem for Linux\fR\m[]\&\s-2\u[6]\d\s+2
219 T}
220 :T{
221 \fIproot\fR
222 T}:T{
223 \m[blue]\fBproot\fR\m[]\&\s-2\u[7]\d\s+2 userspace chroot/bind mount emulation
224 T}
225 :T{
226 \fIpouch\fR
227 T}:T{
228 \m[blue]\fBPouch\fR\m[]\&\s-2\u[8]\d\s+2 Container Engine
229 T}
230 .TE
231 .sp 1
232 .PP
233 If multiple virtualization solutions are used, only the "innermost" is detected and identified\&. That means if both machine and container virtualization are used in conjunction, only the latter will be identified (unless
234 \fB\-\-vm\fR
235 is passed)\&.
236 .PP
237 Windows Subsystem for Linux is not a Linux container, but an environment for running Linux userspace applications on top of the Windows kernel using a Linux\-compatible interface\&. WSL is categorized as a container for practical purposes\&. Multiple WSL environments share the same kernel and services should generally behave like when being run in a container\&.
238 .PP
239 When executed with
240 \fB\-\-cvm\fR, instead of printing the virtualization technology, it will display the confidential virtual machine technology, if any\&. The following technologies are currently identified:
241 .sp
242 .it 1 an-trap
243 .nr an-no-space-flag 1
244 .nr an-break-flag 1
245 .br
246 .B Table\ \&2.\ \&Known confidential virtualization technologies
247 .TS
248 allbox tab(:);
249 lB lB lB.
250 T{
251 Arch
252 T}:T{
253 ID
254 T}:T{
255 Technology
256 T}
257 .T&
258 lt l l
259 ^ l l
260 ^ l l
261 ^ l l
262 l l l.
263 T{
264 x86_64
265 T}:T{
266 \fIsev\fR
267 T}:T{
268 AMD Secure Encrypted Virtualization
269 T}
270 :T{
271 \fIsev\-es\fR
272 T}:T{
273 AMD Secure Encrypted Virtualization \- Encrypted State
274 T}
275 :T{
276 \fIsev\-snp\fR
277 T}:T{
278 AMD Secure Encrypted Virtualization \- Secure Nested Paging
279 T}
280 :T{
281 \fItdx\fR
282 T}:T{
283 Intel Trust Domain Extensions
284 T}
285 T{
286 s390x
287 T}:T{
288 \fIprotvirt\fR
289 T}:T{
290 IBM Protected Virtualization (Secure Execution)
291 T}
292 .TE
293 .sp 1
294 .SH "OPTIONS"
295 .PP
296 The following options are understood:
297 .PP
298 \fB\-c\fR, \fB\-\-container\fR
299 .RS 4
300 Only detects container virtualization (i\&.e\&. shared kernel virtualization)\&.
301 .RE
302 .PP
303 \fB\-v\fR, \fB\-\-vm\fR
304 .RS 4
305 Only detects hardware virtualization\&.
306 .RE
307 .PP
308 \fB\-r\fR, \fB\-\-chroot\fR
309 .RS 4
310 Detect whether invoked in a
311 \fBchroot\fR(2)
312 environment\&. In this mode, no output is written, but the return value indicates whether the process was invoked in a
313 \fBchroot()\fR
314 environment or not\&.
315 .sp
316 Added in version 228\&.
317 .RE
318 .PP
319 \fB\-\-private\-users\fR
320 .RS 4
321 Detect whether invoked in a user namespace\&. In this mode, no output is written, but the return value indicates whether the process was invoked inside of a user namespace or not\&. See
322 \fBuser_namespaces\fR(7)
323 for more information\&.
324 .sp
325 Added in version 232\&.
326 .RE
327 .PP
328 \fB\-\-cvm\fR
329 .RS 4
330 Detect whether invoked in a confidential virtual machine\&. The result of this detection may be used to disable features that should not be used in confidential VMs\&. It must not be used to release security sensitive information\&. The latter must only be released after attestation of the confidential environment\&.
331 .sp
332 Added in version 254\&.
333 .RE
334 .PP
335 \fB\-q\fR, \fB\-\-quiet\fR
336 .RS 4
337 Suppress output of the virtualization technology identifier\&.
338 .RE
339 .PP
340 \fB\-\-list\fR
341 .RS 4
342 Output all currently known and detectable container and VM environments\&.
343 .sp
344 Added in version 239\&.
345 .RE
346 .PP
347 \fB\-\-list\-cvm\fR
348 .RS 4
349 Output all currently known and detectable confidential virtualization technologies\&.
350 .sp
351 Added in version 254\&.
352 .RE
353 .PP
354 \fB\-h\fR, \fB\-\-help\fR
355 .RS 4
356 Print a short help text and exit\&.
357 .RE
358 .PP
359 \fB\-\-version\fR
360 .RS 4
361 Print a short version string and exit\&.
362 .RE
363 .SH "EXIT STATUS"
364 .PP
365 If a virtualization technology is detected, 0 is returned, a non\-zero code otherwise\&.
366 .SH "SEE ALSO"
367 .PP
368 \fBsystemd\fR(1), \fBsystemd-nspawn\fR(1), \fBchroot\fR(2), \fBnamespaces\fR(7)
369 .SH "NOTES"
370 .IP " 1." 4
371 ACRN hypervisor
372 .RS 4
373 \%https://projectacrn.org
374 .RE
375 .IP " 2." 4
376 Apple virtualization framework
377 .RS 4
378 \%https://developer.apple.com/documentation/virtualization
379 .RE
380 .IP " 3." 4
381 LMHS SRE hypervisor
382 .RS 4
383 \%https://www.lockheedmartin.com/en-us/products/Hardened-Security-for-Intel-Processors.html
384 .RE
385 .IP " 4." 4
386 Google Compute Engine
387 .RS 4
388 \%https://cloud.google.com/compute
389 .RE
390 .IP " 5." 4
391 Podman
392 .RS 4
393 \%https://podman.io
394 .RE
395 .IP " 6." 4
396 Windows Subsystem for Linux
397 .RS 4
398 \%https://docs.microsoft.com/en-us/windows/wsl/about
399 .RE
400 .IP " 7." 4
401 proot
402 .RS 4
403 \%https://proot-me.github.io/
404 .RE
405 .IP " 8." 4
406 Pouch
407 .RS 4
408 \%https://github.com/alibaba/pouch
409 .RE