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