]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd-detect-virt.xml
tree-wide: drop license boilerplate
[thirdparty/systemd.git] / man / systemd-detect-virt.xml
CommitLineData
2c4ff634
LP
1<?xml version='1.0'?> <!--*-nxml-*-->
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
12b42c76 3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
2c4ff634
LP
4
5<!--
572eb058
ZJS
6 SPDX-License-Identifier: LGPL-2.1+
7
2c4ff634
LP
8 This file is part of systemd.
9
10 Copyright 2010 Lennart Poettering
2c4ff634
LP
11-->
12
dfdebb1b 13<refentry id="systemd-detect-virt"
6d0c987d 14 xmlns:xi="http://www.w3.org/2001/XInclude">
798d3a52
ZJS
15
16 <refentryinfo>
17 <title>systemd-detect-virt</title>
18 <productname>systemd</productname>
19
20 <authorgroup>
21 <author>
22 <contrib>Developer</contrib>
23 <firstname>Lennart</firstname>
24 <surname>Poettering</surname>
25 <email>lennart@poettering.net</email>
26 </author>
27 </authorgroup>
28 </refentryinfo>
29
30 <refmeta>
31 <refentrytitle>systemd-detect-virt</refentrytitle>
32 <manvolnum>1</manvolnum>
33 </refmeta>
34
35 <refnamediv>
36 <refname>systemd-detect-virt</refname>
37 <refpurpose>Detect execution in a virtualized environment</refpurpose>
38 </refnamediv>
39
40 <refsynopsisdiv>
41 <cmdsynopsis>
299a34c1
ZJS
42 <command>systemd-detect-virt</command>
43 <arg choice="opt" rep="repeat">OPTIONS</arg>
798d3a52
ZJS
44 </cmdsynopsis>
45 </refsynopsisdiv>
46
47 <refsect1>
48 <title>Description</title>
49
50 <para><command>systemd-detect-virt</command> detects execution in
51 a virtualized environment. It identifies the virtualization
9c5baa43 52 technology and can distinguish full machine virtualization from
798d3a52
ZJS
53 container virtualization. <filename>systemd-detect-virt</filename>
54 exits with a return value of 0 (success) if a virtualization
b938cb90 55 technology is detected, and non-zero (error) otherwise. By default,
798d3a52
ZJS
56 any type of virtualization is detected, and the options
57 <option>--container</option> and <option>--vm</option> can be used
58 to limit what types of virtualization are detected.</para>
59
60 <para>When executed without <option>--quiet</option> will print a
61 short identifier for the detected virtualization technology. The
62 following technologies are currently identified:</para>
63
64 <table>
65 <title>Known virtualization technologies (both
66 VM, i.e. full hardware virtualization,
67 and container, i.e. shared kernel virtualization)</title>
68 <tgroup cols='3' align='left' colsep='1' rowsep='1'>
69 <colspec colname="type" />
70 <colspec colname="id" />
71 <colspec colname="product" />
72 <thead>
73 <row>
6d0c987d
ZJS
74 <entry>Type</entry>
75 <entry>ID</entry>
76 <entry>Product</entry>
798d3a52
ZJS
77 </row>
78 </thead>
79 <tbody>
80 <row>
1fdf07f5 81 <entry valign="top" morerows="11">VM</entry>
6d0c987d 82 <entry><varname>qemu</varname></entry>
5f1c788c 83 <entry>QEMU software virtualization, without KVM</entry>
798d3a52
ZJS
84 </row>
85
86 <row>
6d0c987d 87 <entry><varname>kvm</varname></entry>
28b1a3ea
CH
88 <entry>Linux KVM kernel virtual machine, with whatever software, except
89 Oracle Virtualbox</entry>
798d3a52
ZJS
90 </row>
91
92 <row>
6d0c987d
ZJS
93 <entry><varname>zvm</varname></entry>
94 <entry>s390 z/VM</entry>
798d3a52
ZJS
95 </row>
96
97 <row>
6d0c987d
ZJS
98 <entry><varname>vmware</varname></entry>
99 <entry>VMware Workstation or Server, and related products</entry>
798d3a52
ZJS
100 </row>
101
102 <row>
6d0c987d
ZJS
103 <entry><varname>microsoft</varname></entry>
104 <entry>Hyper-V, also known as Viridian or Windows Server Virtualization</entry>
798d3a52
ZJS
105 </row>
106
107 <row>
6d0c987d 108 <entry><varname>oracle</varname></entry>
28b1a3ea
CH
109 <entry>Oracle VM VirtualBox (historically marketed by innotek and Sun Microsystems),
110 for legacy and KVM hypervisor</entry>
798d3a52
ZJS
111 </row>
112
113 <row>
6d0c987d
ZJS
114 <entry><varname>xen</varname></entry>
115 <entry>Xen hypervisor (only domU, not dom0)</entry>
798d3a52
ZJS
116 </row>
117
118 <row>
6d0c987d
ZJS
119 <entry><varname>bochs</varname></entry>
120 <entry>Bochs Emulator</entry>
798d3a52
ZJS
121 </row>
122
123 <row>
6d0c987d
ZJS
124 <entry><varname>uml</varname></entry>
125 <entry>User-mode Linux</entry>
798d3a52
ZJS
126 </row>
127
d84248eb 128 <row>
6d0c987d
ZJS
129 <entry><varname>parallels</varname></entry>
130 <entry>Parallels Desktop, Parallels Server</entry>
d84248eb
EV
131 </row>
132
1fdf07f5 133 <row>
aa0c3427
LBS
134 <entry><varname>bhyve</varname></entry>
135 <entry>bhyve, FreeBSD hypervisor</entry>
1fdf07f5
SL
136 </row>
137
138 <row>
139 <entry><varname>qnx</varname></entry>
140 <entry>QNX hypervisor</entry>
aa0c3427
LBS
141 </row>
142
798d3a52 143 <row>
055a100d 144 <entry valign="top" morerows="5">Container</entry>
6d0c987d
ZJS
145 <entry><varname>openvz</varname></entry>
146 <entry>OpenVZ/Virtuozzo</entry>
798d3a52
ZJS
147 </row>
148
149 <row>
6d0c987d
ZJS
150 <entry><varname>lxc</varname></entry>
151 <entry>Linux container implementation by LXC</entry>
798d3a52
ZJS
152 </row>
153
154 <row>
6d0c987d
ZJS
155 <entry><varname>lxc-libvirt</varname></entry>
156 <entry>Linux container implementation by libvirt</entry>
798d3a52
ZJS
157 </row>
158
159 <row>
6d0c987d
ZJS
160 <entry><varname>systemd-nspawn</varname></entry>
161 <entry>systemd's minimal container implementation, see <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry></entry>
798d3a52
ZJS
162 </row>
163
164 <row>
6d0c987d
ZJS
165 <entry><varname>docker</varname></entry>
166 <entry>Docker container manager</entry>
798d3a52 167 </row>
9fb16425
ILG
168
169 <row>
6d0c987d
ZJS
170 <entry><varname>rkt</varname></entry>
171 <entry>rkt app container runtime</entry>
9fb16425 172 </row>
798d3a52
ZJS
173 </tbody>
174 </tgroup>
175 </table>
176
177 <para>If multiple virtualization solutions are used, only the
9c5baa43
JE
178 "innermost" is detected and identified. That means if both
179 machine and container virtualization are used in
798d3a52
ZJS
180 conjunction, only the latter will be identified (unless
181 <option>--vm</option> is passed).</para>
182 </refsect1>
183
184 <refsect1>
185 <title>Options</title>
186
187 <para>The following options are understood:</para>
188
189 <variablelist>
190 <varlistentry>
191 <term><option>-c</option></term>
192 <term><option>--container</option></term>
193
194 <listitem><para>Only detects container virtualization (i.e.
195 shared kernel virtualization).</para></listitem>
196 </varlistentry>
197
198 <varlistentry>
199 <term><option>-v</option></term>
200 <term><option>--vm</option></term>
201
9c5baa43 202 <listitem><para>Only detects hardware virtualization).</para></listitem>
798d3a52
ZJS
203 </varlistentry>
204
d21be5ff
LP
205 <varlistentry>
206 <term><option>-r</option></term>
207 <term><option>--chroot</option></term>
208
209 <listitem><para>Detect whether invoked in a
210 <citerefentry><refentrytitle>chroot</refentrytitle><manvolnum>2</manvolnum></citerefentry>
b938cb90 211 environment. In this mode, no output is written, but the return
d21be5ff
LP
212 value indicates whether the process was invoked in a
213 <function>chroot()</function>
214 environment or not.</para></listitem>
215 </varlistentry>
216
299a34c1
ZJS
217 <varlistentry>
218 <term><option>--private-users</option></term>
219
220 <listitem><para>Detect whether invoked in a user namespace. In this mode, no
221 output is written, but the return value indicates whether the process was invoked
222 inside of a user namespace or not. See
223 <citerefentry project='man-pages'><refentrytitle>user_namespaces</refentrytitle><manvolnum>7</manvolnum></citerefentry>
224 for more information.</para></listitem>
225 </varlistentry>
226
798d3a52
ZJS
227 <varlistentry>
228 <term><option>-q</option></term>
229 <term><option>--quiet</option></term>
230
231 <listitem><para>Suppress output of the virtualization
232 technology identifier.</para></listitem>
233 </varlistentry>
234
235 <xi:include href="standard-options.xml" xpointer="help" />
236 <xi:include href="standard-options.xml" xpointer="version" />
237 </variablelist>
238
239 </refsect1>
240
241 <refsect1>
242 <title>Exit status</title>
243
244 <para>If a virtualization technology is detected, 0 is returned, a
245 non-zero code otherwise.</para>
246 </refsect1>
247
248 <refsect1>
249 <title>See Also</title>
250 <para>
251 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
d21be5ff 252 <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
299a34c1
ZJS
253 <citerefentry><refentrytitle>chroot</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
254 <citerefentry project='man-pages'><refentrytitle>namespaces</refentrytitle><manvolnum>7</manvolnum></citerefentry>
798d3a52
ZJS
255 </para>
256 </refsect1>
2c4ff634
LP
257
258</refentry>