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">
6 This file is part of systemd.
8 Copyright 2010 Lennart Poettering
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.
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.
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/>.
24 <refentry id="systemd-detect-virt"
25 xmlns:xi="http://www.w3.org/2001/XInclude">
28 <title>systemd-detect-virt</title>
29 <productname>systemd</productname>
33 <contrib>Developer</contrib>
34 <firstname>Lennart</firstname>
35 <surname>Poettering</surname>
36 <email>lennart@poettering.net</email>
42 <refentrytitle>systemd-detect-virt</refentrytitle>
43 <manvolnum>1</manvolnum>
47 <refname>systemd-detect-virt</refname>
48 <refpurpose>Detect execution in a virtualized environment</refpurpose>
53 <command>systemd-detect-virt <arg choice="opt" rep="repeat">OPTIONS</arg></command>
58 <title>Description</title>
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
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>
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" />
90 <entry>Product</entry>
95 <entry morerows="8">VM</entry>
96 <entry><varname>qemu</varname></entry>
97 <entry>QEMU software virtualization</entry>
101 <entry><varname>kvm</varname></entry>
102 <entry>Linux KVM kernel virtual machine</entry>
106 <entry><varname>zvm</varname></entry>
107 <entry>s390 z/VM</entry>
111 <entry><varname>vmware</varname></entry>
112 <entry>VMware Workstation or Server, and related products</entry>
116 <entry><varname>microsoft</varname></entry>
117 <entry>Hyper-V, also known as Viridian or Windows Server Virtualization</entry>
121 <entry><varname>oracle</varname></entry>
122 <entry>Oracle VM VirtualBox (historically marketed by innotek and Sun Microsystems)</entry>
126 <entry><varname>xen</varname></entry>
127 <entry>Xen hypervisor (only domU, not dom0)</entry>
131 <entry><varname>bochs</varname></entry>
132 <entry>Bochs Emulator</entry>
136 <entry><varname>uml</varname></entry>
137 <entry>User-mode Linux</entry>
141 <entry morerows="5">container</entry>
142 <entry><varname>openvz</varname></entry>
143 <entry>OpenVZ/Virtuozzo</entry>
147 <entry><varname>lxc</varname></entry>
148 <entry>Linux container implementation by LXC</entry>
152 <entry><varname>lxc-libvirt</varname></entry>
153 <entry>Linux container implementation by libvirt</entry>
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>
162 <entry><varname>docker</varname></entry>
163 <entry>Docker container manager</entry>
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
178 <title>Options</title>
180 <para>The following options are understood:</para>
184 <term><option>-c</option></term>
185 <term><option>--container</option></term>
187 <listitem><para>Only detects container
188 virtualization (i.e. shared kernel
189 virtualization).</para></listitem>
193 <term><option>-v</option></term>
194 <term><option>--vm</option></term>
196 <listitem><para>Only detects VM
197 virtualization (i.e. full hardware
198 virtualization).</para></listitem>
202 <term><option>-q</option></term>
203 <term><option>--quiet</option></term>
205 <listitem><para>Suppress output of the
206 virtualization technology
207 identifier.</para></listitem>
210 <xi:include href="standard-options.xml" xpointer="help" />
211 <xi:include href="standard-options.xml" xpointer="version" />
217 <title>Exit status</title>
219 <para>If a virtualization technology is detected, 0 is
220 returned, a non-zero code otherwise.</para>
224 <title>See Also</title>
226 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
227 <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry>