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