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