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 distuingish 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>openvz</varname>, <varname>lxc</varname>,
74 <varname>lxc-libvirt</varname>,
75 <varname>systemd-nspawn</varname>.</para>
77 <para>If multiple virtualization solutions are used
78 only the "innermost" is detected and identified. That
79 means if both VM virtualization and container
80 virtualization are used in conjunction only the latter
81 will be identified (unless <option>--vm</option> is
86 <title>Options</title>
88 <para>The following options are understood:</para>
92 <term><option>-h</option></term>
93 <term><option>--help</option></term>
95 <listitem><para>Prints a short help
96 text and exits.</para></listitem>
100 <term><option>--version</option></term>
102 <listitem><para>Prints a short version
103 string and exits.</para></listitem>
107 <term><option>-c</option></term>
108 <term><option>--container</option></term>
110 <listitem><para>Only detects container
111 virtualization (i.e. shared kernel
112 virtualization).</para></listitem>
116 <term><option>-v</option></term>
117 <term><option>--vm</option></term>
119 <listitem><para>Only detects VM
120 virtualization (i.e. full hardware
121 virtualization).</para></listitem>
125 <term><option>-q</option></term>
126 <term><option>--quiet</option></term>
128 <listitem><para>Suppress output of the
129 virtualization technology
130 identifier.</para></listitem>
138 <title>Exit status</title>
140 <para>If a virtualization technology is detected 0 is
141 returned, a non-zero code otherwise.</para>
145 <title>See Also</title>
147 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>