]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd-detect-virt.xml
test-execute: Add tests for new PassEnvironment= directive
[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>
53 <command>systemd-detect-virt <arg choice="opt" rep="repeat">OPTIONS</arg></command>
54 </cmdsynopsis>
55 </refsynopsisdiv>
56
57 <refsect1>
58 <title>Description</title>
59
60 <para><command>systemd-detect-virt</command> detects execution in
61 a virtualized environment. It identifies the virtualization
62 technology and can distinguish full VM virtualization from
63 container virtualization. <filename>systemd-detect-virt</filename>
64 exits with a return value of 0 (success) if a virtualization
b938cb90 65 technology is detected, and non-zero (error) otherwise. By default,
798d3a52
ZJS
66 any type of virtualization is detected, and the options
67 <option>--container</option> and <option>--vm</option> can be used
68 to limit what types of virtualization are detected.</para>
69
70 <para>When executed without <option>--quiet</option> will print a
71 short identifier for the detected virtualization technology. The
72 following technologies are currently identified:</para>
73
74 <table>
75 <title>Known virtualization technologies (both
76 VM, i.e. full hardware virtualization,
77 and container, i.e. shared kernel virtualization)</title>
78 <tgroup cols='3' align='left' colsep='1' rowsep='1'>
79 <colspec colname="type" />
80 <colspec colname="id" />
81 <colspec colname="product" />
82 <thead>
83 <row>
6d0c987d
ZJS
84 <entry>Type</entry>
85 <entry>ID</entry>
86 <entry>Product</entry>
798d3a52
ZJS
87 </row>
88 </thead>
89 <tbody>
90 <row>
6d0c987d
ZJS
91 <entry morerows="9">VM</entry>
92 <entry><varname>qemu</varname></entry>
93 <entry>QEMU software virtualization</entry>
798d3a52
ZJS
94 </row>
95
96 <row>
6d0c987d
ZJS
97 <entry><varname>kvm</varname></entry>
98 <entry>Linux KVM kernel virtual machine</entry>
798d3a52
ZJS
99 </row>
100
101 <row>
6d0c987d
ZJS
102 <entry><varname>zvm</varname></entry>
103 <entry>s390 z/VM</entry>
798d3a52
ZJS
104 </row>
105
106 <row>
6d0c987d
ZJS
107 <entry><varname>vmware</varname></entry>
108 <entry>VMware Workstation or Server, and related products</entry>
798d3a52
ZJS
109 </row>
110
111 <row>
6d0c987d
ZJS
112 <entry><varname>microsoft</varname></entry>
113 <entry>Hyper-V, also known as Viridian or Windows Server Virtualization</entry>
798d3a52
ZJS
114 </row>
115
116 <row>
6d0c987d
ZJS
117 <entry><varname>oracle</varname></entry>
118 <entry>Oracle VM VirtualBox (historically marketed by innotek and Sun Microsystems)</entry>
798d3a52
ZJS
119 </row>
120
121 <row>
6d0c987d
ZJS
122 <entry><varname>xen</varname></entry>
123 <entry>Xen hypervisor (only domU, not dom0)</entry>
798d3a52
ZJS
124 </row>
125
126 <row>
6d0c987d
ZJS
127 <entry><varname>bochs</varname></entry>
128 <entry>Bochs Emulator</entry>
798d3a52
ZJS
129 </row>
130
131 <row>
6d0c987d
ZJS
132 <entry><varname>uml</varname></entry>
133 <entry>User-mode Linux</entry>
798d3a52
ZJS
134 </row>
135
d84248eb 136 <row>
6d0c987d
ZJS
137 <entry><varname>parallels</varname></entry>
138 <entry>Parallels Desktop, Parallels Server</entry>
d84248eb
EV
139 </row>
140
798d3a52 141 <row>
6d0c987d
ZJS
142 <entry morerows="5">Container</entry>
143 <entry><varname>openvz</varname></entry>
144 <entry>OpenVZ/Virtuozzo</entry>
798d3a52
ZJS
145 </row>
146
147 <row>
6d0c987d
ZJS
148 <entry><varname>lxc</varname></entry>
149 <entry>Linux container implementation by LXC</entry>
798d3a52
ZJS
150 </row>
151
152 <row>
6d0c987d
ZJS
153 <entry><varname>lxc-libvirt</varname></entry>
154 <entry>Linux container implementation by libvirt</entry>
798d3a52
ZJS
155 </row>
156
157 <row>
6d0c987d
ZJS
158 <entry><varname>systemd-nspawn</varname></entry>
159 <entry>systemd's minimal container implementation, see <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry></entry>
798d3a52
ZJS
160 </row>
161
162 <row>
6d0c987d
ZJS
163 <entry><varname>docker</varname></entry>
164 <entry>Docker container manager</entry>
798d3a52 165 </row>
9fb16425
ILG
166
167 <row>
6d0c987d
ZJS
168 <entry><varname>rkt</varname></entry>
169 <entry>rkt app container runtime</entry>
9fb16425 170 </row>
798d3a52
ZJS
171 </tbody>
172 </tgroup>
173 </table>
174
175 <para>If multiple virtualization solutions are used, only the
176 "innermost" is detected and identified. That means if both VM
177 virtualization and container virtualization are used in
178 conjunction, only the latter will be identified (unless
179 <option>--vm</option> is passed).</para>
180 </refsect1>
181
182 <refsect1>
183 <title>Options</title>
184
185 <para>The following options are understood:</para>
186
187 <variablelist>
188 <varlistentry>
189 <term><option>-c</option></term>
190 <term><option>--container</option></term>
191
192 <listitem><para>Only detects container virtualization (i.e.
193 shared kernel virtualization).</para></listitem>
194 </varlistentry>
195
196 <varlistentry>
197 <term><option>-v</option></term>
198 <term><option>--vm</option></term>
199
200 <listitem><para>Only detects VM virtualization (i.e. full
201 hardware virtualization).</para></listitem>
202 </varlistentry>
203
d21be5ff
LP
204 <varlistentry>
205 <term><option>-r</option></term>
206 <term><option>--chroot</option></term>
207
208 <listitem><para>Detect whether invoked in a
209 <citerefentry><refentrytitle>chroot</refentrytitle><manvolnum>2</manvolnum></citerefentry>
b938cb90 210 environment. In this mode, no output is written, but the return
d21be5ff
LP
211 value indicates whether the process was invoked in a
212 <function>chroot()</function>
213 environment or not.</para></listitem>
214 </varlistentry>
215
798d3a52
ZJS
216 <varlistentry>
217 <term><option>-q</option></term>
218 <term><option>--quiet</option></term>
219
220 <listitem><para>Suppress output of the virtualization
221 technology identifier.</para></listitem>
222 </varlistentry>
223
224 <xi:include href="standard-options.xml" xpointer="help" />
225 <xi:include href="standard-options.xml" xpointer="version" />
226 </variablelist>
227
228 </refsect1>
229
230 <refsect1>
231 <title>Exit status</title>
232
233 <para>If a virtualization technology is detected, 0 is returned, a
234 non-zero code otherwise.</para>
235 </refsect1>
236
237 <refsect1>
238 <title>See Also</title>
239 <para>
240 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
d21be5ff
LP
241 <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
242 <citerefentry><refentrytitle>chroot</refentrytitle><manvolnum>2</manvolnum></citerefentry>
798d3a52
ZJS
243 </para>
244 </refsect1>
2c4ff634
LP
245
246</refentry>