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">
27 <title>systemd-detect-virt</title>
28 <productname>systemd</productname>
32 <contrib>Developer</contrib>
33 <firstname>Lennart</firstname>
34 <surname>Poettering</surname>
35 <email>lennart@poettering.net</email>
41 <refentrytitle>systemd-detect-virt</refentrytitle>
42 <manvolnum>1</manvolnum>
46 <refname>systemd-detect-virt</refname>
47 <refpurpose>Detect execution in a virtualized environment</refpurpose>
52 <command>systemd-detect-virt <arg choice="opt" rep="repeat">OPTIONS</arg></command>
57 <title>Description</title>
59 <para><command>systemd-detect-virt</command> detects
60 execution in a virtualized environment. It identifies
61 the virtualization technology and can distinguish full
62 VM virtualization from container
63 virtualization.</para>
65 <para>When executed without <option>--quiet</option>
66 will print a short identifier for the detected
67 virtualization technology. The following technologies
68 are currently identified: <varname>qemu</varname>,
69 <varname>kvm</varname>, <varname>vmware</varname>,
70 <varname>microsoft</varname>,
71 <varname>oracle</varname>, <varname>xen</varname>,
72 <varname>bochs</varname>, <varname>chroot</varname>,
73 <varname>uml</varname>,
74 <varname>openvz</varname>, <varname>lxc</varname>,
75 <varname>lxc-libvirt</varname>,
76 <varname>systemd-nspawn</varname>.</para>
78 <para>If multiple virtualization solutions are used
79 only the "innermost" is detected and identified. That
80 means if both VM virtualization and container
81 virtualization are used in conjunction only the latter
82 will be identified (unless <option>--vm</option> is
87 <title>Options</title>
89 <para>The following options are understood:</para>
93 <term><option>-h</option></term>
94 <term><option>--help</option></term>
96 <listitem><para>Prints a short help
97 text and exits.</para></listitem>
101 <term><option>--version</option></term>
103 <listitem><para>Prints a short version
104 string and exits.</para></listitem>
108 <term><option>-c</option></term>
109 <term><option>--container</option></term>
111 <listitem><para>Only detects container
112 virtualization (i.e. shared kernel
113 virtualization).</para></listitem>
117 <term><option>-v</option></term>
118 <term><option>--vm</option></term>
120 <listitem><para>Only detects VM
121 virtualization (i.e. full hardware
122 virtualization).</para></listitem>
126 <term><option>-q</option></term>
127 <term><option>--quiet</option></term>
129 <listitem><para>Suppress output of the
130 virtualization technology
131 identifier.</para></listitem>
139 <title>Exit status</title>
141 <para>If a virtualization technology is detected 0 is
142 returned, a non-zero code otherwise.</para>
146 <title>See Also</title>
148 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>