man-pages/man1/systemd-detect-virt.1.html
2021-03-31 01:06:50 +01:00

320 lines
7.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of SYSTEMD-DETECT-VIRT</TITLE>
</HEAD><BODY>
<H1>SYSTEMD-DETECT-VIRT</H1>
Section: systemd-detect-virt (1)<BR>Updated: <BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
systemd-detect-virt - Detect execution in a virtualized environment
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<DL COMPACT>
<DT id="1">
<B>systemd-detect-virt</B> [OPTIONS...]
</DL>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<P>
<B>systemd-detect-virt</B>
<DD>detects execution in a virtualized environment. It identifies the virtualization technology and can distinguish full machine virtualization from container virtualization.
systemd-detect-virt
exits with a return value of 0 (success) if a virtualization technology is detected, and non-zero (error) otherwise. By default, any type of virtualization is detected, and the options
<B>--container</B>
and
<B>--vm</B>
can be used to limit what types of virtualization are detected.
<P>
When executed without
<B>--quiet</B>
will print a short identifier for the detected virtualization technology. The following technologies are currently identified:
<P>
<BR>
<B>Table&nbsp;1.&nbsp;Known virtualization technologies (both VM, i.e. full hardware virtualization, and container, i.e. shared kernel virtualization)</B>
<TABLE BORDER>
<TR VALIGN=top><TD><B>
Type
</B></TD><TD><B>
ID
</B></TD><TD><B>
Product
</B><BR></TD></TR>
<TR VALIGN=top><TD ROWSPAN=2>
VM
</TD><TD>
<I>qemu</I>
</TD><TD>
QEMU software virtualization, without KVM
<BR></TD></TR>
<TR VALIGN=top><TD>
<I>kvm</I>
</TD><TD>
Linux KVM kernel virtual machine, with whatever software, except Oracle Virtualbox
</TD></TR>
<TR VALIGN=top><TD>
<I>zvm</I>
</TD><TD>
s390 z/VM
</TD></TR>
<TR VALIGN=top><TD>
<I>vmware</I>
</TD><TD>
VMware Workstation or Server, and related products
</TD></TR>
<TR VALIGN=top><TD>
<I>microsoft</I>
</TD><TD>
Hyper-V, also known as Viridian or Windows Server Virtualization
</TD></TR>
<TR VALIGN=top><TD>
<I>oracle</I>
</TD><TD>
Oracle VM VirtualBox (historically marketed by innotek and Sun Microsystems), for legacy and KVM hypervisor
</TD></TR>
<TR VALIGN=top><TD>
<I>xen</I>
</TD><TD>
Xen hypervisor (only domU, not dom0)
</TD></TR>
<TR VALIGN=top><TD>
<I>bochs</I>
</TD><TD>
Bochs Emulator
</TD></TR>
<TR VALIGN=top><TD>
<I>uml</I>
</TD><TD>
User-mode Linux
</TD></TR>
<TR VALIGN=top><TD>
<I>parallels</I>
</TD><TD>
Parallels Desktop, Parallels Server
</TD></TR>
<TR VALIGN=top><TD>
<I>bhyve</I>
</TD><TD>
bhyve, FreeBSD hypervisor
</TD></TR>
<TR VALIGN=top><TD>
<I>qnx</I>
</TD><TD>
QNX hypervisor
</TD></TR>
<TR VALIGN=top><TD>
<I>acrn</I>
</TD><TD>
m[blue]<B>ACRN hypervisor</B>m[]<FONT SIZE="-2">[1]</FONT>
</TD></TR>
<TR VALIGN=top><TD ROWSPAN=2>
Container
</TD><TD>
<I>openvz</I>
</TD><TD>
OpenVZ/Virtuozzo
<BR></TD></TR>
<TR VALIGN=top><TD>
<I>lxc</I>
</TD><TD>
Linux container implementation by LXC
</TD></TR>
<TR VALIGN=top><TD>
<I>lxc-libvirt</I>
</TD><TD>
Linux container implementation by libvirt
</TD></TR>
<TR VALIGN=top><TD>
<I>systemd-nspawn</I>
</TD><TD>
systemd's minimal container implementation, see <B><A HREF="/cgi-bin/man/man2html?1+systemd-nspawn">systemd-nspawn</A></B>(1)
</TD></TR>
<TR VALIGN=top><TD>
<I>docker</I>
</TD><TD>
Docker container manager
</TD></TR>
<TR VALIGN=top><TD>
<I>podman</I>
</TD><TD>
m[blue]<B>Podman</B>m[]<FONT SIZE="-2">[2]</FONT> container manager
</TD></TR>
<TR VALIGN=top><TD>
<I>rkt</I>
</TD><TD>
rkt app container runtime
</TD></TR>
<TR VALIGN=top><TD>
<I>wsl</I>
</TD><TD>
m[blue]<B>Windows Subsystem for Linux</B>m[]<FONT SIZE="-2">[3]</FONT>
</TD></TR>
</TABLE>
<P>
<P>
If multiple virtualization solutions are used, only the &quot;innermost&quot; is detected and identified. That means if both machine and container virtualization are used in conjunction, only the latter will be identified (unless
<B>--vm</B>
is passed).
<P>
Windows Subsystem for Linux is not a Linux container, but an environment for running Linux userspace applications on top of the Windows kernel using a Linux-compatible interface. WSL is categorized as a container for practical purposes. Multiple WSL environments share the same kernel and services should generally behave like when being run in a container.
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
<P>
The following options are understood:
<P>
<B>-c</B>, <B>--container</B>
<DL COMPACT><DT id="2"><DD>
Only detects container virtualization (i.e. shared kernel virtualization).
</DL>
<P>
<B>-v</B>, <B>--vm</B>
<DL COMPACT><DT id="3"><DD>
Only detects hardware virtualization.
</DL>
<P>
<B>-r</B>, <B>--chroot</B>
<DL COMPACT><DT id="4"><DD>
Detect whether invoked in a
<B><A HREF="/cgi-bin/man/man2html?2+chroot">chroot</A></B>(2)
environment. In this mode, no output is written, but the return value indicates whether the process was invoked in a
<B>chroot()</B>
environment or not.
</DL>
<P>
<B>--private-users</B>
<DL COMPACT><DT id="5"><DD>
Detect whether invoked in a user namespace. In this mode, no output is written, but the return value indicates whether the process was invoked inside of a user namespace or not. See
<B><A HREF="/cgi-bin/man/man2html?7+user_namespaces">user_namespaces</A></B>(7)
for more information.
</DL>
<P>
<B>-q</B>, <B>--quiet</B>
<DL COMPACT><DT id="6"><DD>
Suppress output of the virtualization technology identifier.
</DL>
<P>
<B>--list</B>
<DL COMPACT><DT id="7"><DD>
Output all currently known and detectable container and VM environments.
</DL>
<P>
<B>-h</B>, <B>--help</B>
<DL COMPACT><DT id="8"><DD>
Print a short help text and exit.
</DL>
<P>
<B>--version</B>
<DL COMPACT><DT id="9"><DD>
Print a short version string and exit.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>EXIT STATUS</H2>
<P>
If a virtualization technology is detected, 0 is returned, a non-zero code otherwise.
<A NAME="lbAG">&nbsp;</A>
<H2>SEE ALSO</H2>
<P>
<B><A HREF="/cgi-bin/man/man2html?1+systemd">systemd</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+systemd-nspawn">systemd-nspawn</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?2+chroot">chroot</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?7+namespaces">namespaces</A></B>(7)
<A NAME="lbAH">&nbsp;</A>
<H2>NOTES</H2>
<DL COMPACT>
<DT id="10"> 1.<DD>
ACRN hypervisor
<DL COMPACT><DT id="11"><DD>
<A HREF="https://projectacrn.org">https://projectacrn.org</A>
</DL>
<DT id="12"> 2.<DD>
Podman
<DL COMPACT><DT id="13"><DD>
<A HREF="https://podman.io">https://podman.io</A>
</DL>
<DT id="14"> 3.<DD>
Windows Subsystem for Linux
<DL COMPACT><DT id="15"><DD>
<A HREF="https://docs.microsoft.com/en-us/windows/wsl/about">https://docs.microsoft.com/en-us/windows/wsl/about</A>
</DL>
<P>
</DL>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="16"><A HREF="#lbAB">NAME</A><DD>
<DT id="17"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="18"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="19"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="20"><A HREF="#lbAF">EXIT STATUS</A><DD>
<DT id="21"><A HREF="#lbAG">SEE ALSO</A><DD>
<DT id="22"><A HREF="#lbAH">NOTES</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:28 GMT, March 31, 2021
</BODY>
</HTML>