chiark / gitweb /
loginctl: make session/user arguments optional for a number commands, and imply calli...
[elogind.git] / man / systemd-detect-virt.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3         "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
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
24 <refentry id="systemd-detect-virt"
25           xmlns:xi="http://www.w3.org/2001/XInclude">
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
61                 execution in a virtualized environment. It identifies
62                 the virtualization technology and can distinguish full
63                 VM virtualization from container
64                 virtualization. <filename>systemd-detect-virt</filename>
65                 exits with a return value of 0 (success) if a
66                 virtualization technology is detected, and non-zero
67                 (error) otherwise. By default any type of
68                 virtualization is detected, and the options
69                 <option>--container</option> and <option>--vm</option>
70                 can be used to limit what types of virtualization are
71                 detected.</para>
72
73                 <para>When executed without <option>--quiet</option>
74                 will print a short identifier for the detected
75                 virtualization technology. The following technologies
76                 are currently identified:</para>
77
78                 <table>
79                   <title>Known virtualization technologies (both
80                   VM, i.e. full hardware virtualization,
81                   and container, i.e. shared kernel virtualization)</title>
82                   <tgroup cols='3' align='left' colsep='1' rowsep='1'>
83                     <colspec colname="type" />
84                     <colspec colname="id" />
85                     <colspec colname="product" />
86                     <thead>
87                       <row>
88                         <entry>Type</entry>
89                         <entry>ID</entry>
90                         <entry>Product</entry>
91                       </row>
92                     </thead>
93                     <tbody>
94                       <row>
95                         <entry morerows="8">VM</entry>
96                         <entry><varname>qemu</varname></entry>
97                         <entry>QEMU software virtualization</entry>
98                       </row>
99
100                       <row>
101                         <entry><varname>kvm</varname></entry>
102                         <entry>Linux KVM kernel virtual machine</entry>
103                       </row>
104
105                       <row>
106                         <entry><varname>zvm</varname></entry>
107                         <entry>s390 z/VM</entry>
108                       </row>
109
110                       <row>
111                         <entry><varname>vmware</varname></entry>
112                         <entry>VMware Workstation or Server, and related products</entry>
113                       </row>
114
115                       <row>
116                         <entry><varname>microsoft</varname></entry>
117                         <entry>Hyper-V, also known as Viridian or Windows Server Virtualization</entry>
118                       </row>
119
120                       <row>
121                         <entry><varname>oracle</varname></entry>
122                         <entry>Oracle VM VirtualBox (historically marketed by innotek and Sun Microsystems)</entry>
123                       </row>
124
125                       <row>
126                         <entry><varname>xen</varname></entry>
127                         <entry>Xen hypervisor (only domU, not dom0)</entry>
128                       </row>
129
130                       <row>
131                         <entry><varname>bochs</varname></entry>
132                         <entry>Bochs Emulator</entry>
133                       </row>
134
135                       <row>
136                         <entry><varname>uml</varname></entry>
137                         <entry>User-mode Linux</entry>
138                       </row>
139
140                       <row>
141                         <entry morerows="5">container</entry>
142                         <entry><varname>openvz</varname></entry>
143                         <entry>OpenVZ/Virtuozzo</entry>
144                       </row>
145
146                       <row>
147                         <entry><varname>lxc</varname></entry>
148                         <entry>Linux container implementation by LXC</entry>
149                       </row>
150
151                       <row>
152                         <entry><varname>lxc-libvirt</varname></entry>
153                         <entry>Linux container implementation by libvirt</entry>
154                       </row>
155
156                       <row>
157                          <entry><varname>systemd-nspawn</varname></entry>
158                          <entry>systemd's minimal container implementation, see <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry></entry>
159                       </row>
160
161                       <row>
162                         <entry><varname>docker</varname></entry>
163                         <entry>Docker container manager</entry>
164                       </row>
165                     </tbody>
166                   </tgroup>
167                 </table>
168
169                 <para>If multiple virtualization solutions are used,
170                 only the "innermost" is detected and identified. That
171                 means if both VM virtualization and container
172                 virtualization are used in conjunction, only the latter
173                 will be identified (unless <option>--vm</option> is
174                 passed).</para>
175         </refsect1>
176
177         <refsect1>
178                 <title>Options</title>
179
180                 <para>The following options are understood:</para>
181
182                 <variablelist>
183                         <varlistentry>
184                                 <term><option>-c</option></term>
185                                 <term><option>--container</option></term>
186
187                                 <listitem><para>Only detects container
188                                 virtualization (i.e. shared kernel
189                                 virtualization).</para></listitem>
190                         </varlistentry>
191
192                         <varlistentry>
193                                 <term><option>-v</option></term>
194                                 <term><option>--vm</option></term>
195
196                                 <listitem><para>Only detects VM
197                                 virtualization (i.e. full hardware
198                                 virtualization).</para></listitem>
199                         </varlistentry>
200
201                         <varlistentry>
202                                 <term><option>-q</option></term>
203                                 <term><option>--quiet</option></term>
204
205                                 <listitem><para>Suppress output of the
206                                 virtualization technology
207                                 identifier.</para></listitem>
208                         </varlistentry>
209
210                         <xi:include href="standard-options.xml" xpointer="help" />
211                         <xi:include href="standard-options.xml" xpointer="version" />
212                 </variablelist>
213
214         </refsect1>
215
216         <refsect1>
217                 <title>Exit status</title>
218
219                 <para>If a virtualization technology is detected, 0 is
220                 returned, a non-zero code otherwise.</para>
221         </refsect1>
222
223         <refsect1>
224                 <title>See Also</title>
225                 <para>
226                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
227                         <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry>
228                 </para>
229         </refsect1>
230
231 </refentry>