systemd-detect-virt.xml revision 2c4ff63406c80839c6c8e838c1279934a0bc150e
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering<?xml version='1.0'?> <!--*-nxml-*-->
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering<!--
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering This file is part of systemd.
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering Copyright 2010 Lennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering systemd is free software; you can redistribute it and/or modify it
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering under the terms of the GNU Lesser General Public License as published by
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering the Free Software Foundation; either version 2.1 of the License, or
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering (at your option) any later version.
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering systemd is distributed in the hope that it will be useful, but
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering Lesser General Public License for more details.
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering You should have received a copy of the GNU Lesser General Public License
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering-->
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering<refentry id="systemd-detect-virt">
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <refentryinfo>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <title>systemd-detect-virt</title>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <productname>systemd</productname>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <authorgroup>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <author>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <contrib>Developer</contrib>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <firstname>Lennart</firstname>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <surname>Poettering</surname>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <email>lennart@poettering.net</email>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering </author>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering </authorgroup>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering </refentryinfo>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <refmeta>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <refentrytitle>systemd-detect-virt</refentrytitle>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <manvolnum>1</manvolnum>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering </refmeta>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <refnamediv>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <refname>systemd-detect-virt</refname>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <refpurpose>Detect execution in a virtualized environment</refpurpose>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering </refnamediv>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <refsynopsisdiv>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <cmdsynopsis>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <command>systemd-detect-virt <arg choice="opt" rep="repeat">OPTIONS</arg></command>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering </cmdsynopsis>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering </refsynopsisdiv>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <refsect1>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <title>Description</title>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <para><command>systemd-detect-virt</command> detects
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering execution in a virtualized environment. It identifies
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering the virtualization technology and can distuingish full
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering VM virtualization from container
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering virtualization.</para>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <para>When executed without <option>--quiet</option>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering will print a short identifier for the detected
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering virtualization technology. The following technologies
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering are currently identified: <varname>qemu</varname>,
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <varname>kvm</varname>, <varname>vmware</varname>,
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <varname>microsoft</varname>,
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <varname>oracle</varname>, <varname>xen</varname>,
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <varname>bochs</varname>, <varname>chroot</varname>,
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <varname>openvz</varname>, <varname>lxc</varname>,
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <varname>lxc-libvirt</varname>,
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <varname>systemd-nspawn</varname>.</para>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <para>If multiple virtualization solutions are used
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering only the "innermost" is detected and identified. That
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering means if both VM virtualization and container
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering virtualization are used in conjunction only the latter
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering will be identified (unless <option>--vm</option> is
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering passed).</para>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering </refsect1>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <refsect1>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <title>Options</title>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <para>The following options are understood:</para>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <variablelist>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <varlistentry>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <term><option>-h</option></term>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <term><option>--help</option></term>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <listitem><para>Prints a short help
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering text and exits.</para></listitem>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering </varlistentry>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <varlistentry>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <term><option>--version</option></term>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <listitem><para>Prints a short version
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering string and exits.</para></listitem>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering </varlistentry>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <varlistentry>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <term><option>-c</option></term>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <term><option>--container</option></term>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <listitem><para>Only detects container
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering virtualization (i.e. shared kernel
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering virtualization).</para></listitem>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering </varlistentry>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <varlistentry>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <term><option>-v</option></term>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <term><option>--vm</option></term>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <listitem><para>Only detects VM
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering virtualization (i.e. full hardware
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering virtualization).</para></listitem>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering </varlistentry>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <varlistentry>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <term><option>-q</option></term>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <term><option>--quiet</option></term>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <listitem><para>Suppress output of the
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering virtualization technology
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering identifier.</para></listitem>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering </varlistentry>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering </variablelist>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering </refsect1>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <refsect1>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <title>Exit status</title>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <para>If a virtualization technology is detected 0 is
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering returned, a non-zero code otherwise.</para>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering </refsect1>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <refsect1>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <title>See Also</title>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <para>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering </para>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering </refsect1>
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering
2c4ff63406c80839c6c8e838c1279934a0bc150eLennart Poettering</refentry>