1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
|
'\" t
.TH "SYSTEMD\-DETECT\-VIRT" "1" "" "systemd 241" "systemd-detect-virt"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
systemd-detect-virt \- Detect execution in a virtualized environment
.SH "SYNOPSIS"
.HP \w'\fBsystemd\-detect\-virt\fR\ 'u
\fBsystemd\-detect\-virt\fR [OPTIONS...]
.SH "DESCRIPTION"
.PP
\fBsystemd\-detect\-virt\fR
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
\fB\-\-container\fR
and
\fB\-\-vm\fR
can be used to limit what types of virtualization are detected\&.
.PP
When executed without
\fB\-\-quiet\fR
will print a short identifier for the detected virtualization technology\&. The following technologies are currently identified:
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.B Table\ \&1.\ \&Known virtualization technologies (both VM, i\&.e\&. full hardware virtualization, and container, i\&.e\&. shared kernel virtualization)
.TS
allbox tab(:);
lB lB lB.
T{
Type
T}:T{
ID
T}:T{
Product
T}
.T&
lt l l
^ l l
^ l l
^ l l
^ l l
^ l l
^ l l
^ l l
^ l l
^ l l
^ l l
^ l l
lt l l
^ l l
^ l l
^ l l
^ l l
^ l l.
T{
VM
T}:T{
\fIqemu\fR
T}:T{
QEMU software virtualization, without KVM
T}
:T{
\fIkvm\fR
T}:T{
Linux KVM kernel virtual machine, with whatever software, except Oracle Virtualbox
T}
:T{
\fIzvm\fR
T}:T{
s390 z/VM
T}
:T{
\fIvmware\fR
T}:T{
VMware Workstation or Server, and related products
T}
:T{
\fImicrosoft\fR
T}:T{
Hyper\-V, also known as Viridian or Windows Server Virtualization
T}
:T{
\fIoracle\fR
T}:T{
Oracle VM VirtualBox (historically marketed by innotek and Sun Microsystems), for legacy and KVM hypervisor
T}
:T{
\fIxen\fR
T}:T{
Xen hypervisor (only domU, not dom0)
T}
:T{
\fIbochs\fR
T}:T{
Bochs Emulator
T}
:T{
\fIuml\fR
T}:T{
User\-mode Linux
T}
:T{
\fIparallels\fR
T}:T{
Parallels Desktop, Parallels Server
T}
:T{
\fIbhyve\fR
T}:T{
bhyve, FreeBSD hypervisor
T}
:T{
\fIqnx\fR
T}:T{
QNX hypervisor
T}
T{
Container
T}:T{
\fIopenvz\fR
T}:T{
OpenVZ/Virtuozzo
T}
:T{
\fIlxc\fR
T}:T{
Linux container implementation by LXC
T}
:T{
\fIlxc\-libvirt\fR
T}:T{
Linux container implementation by libvirt
T}
:T{
\fIsystemd\-nspawn\fR
T}:T{
systemd\*(Aqs minimal container implementation, see \fBsystemd-nspawn\fR(1)
T}
:T{
\fIdocker\fR
T}:T{
Docker container manager
T}
:T{
\fIrkt\fR
T}:T{
rkt app container runtime
T}
.TE
.sp 1
.PP
If multiple virtualization solutions are used, only the "innermost" is detected and identified\&. That means if both machine and container virtualization are used in conjunction, only the latter will be identified (unless
\fB\-\-vm\fR
is passed)\&.
.SH "OPTIONS"
.PP
The following options are understood:
.PP
\fB\-c\fR, \fB\-\-container\fR
.RS 4
Only detects container virtualization (i\&.e\&. shared kernel virtualization)\&.
.RE
.PP
\fB\-v\fR, \fB\-\-vm\fR
.RS 4
Only detects hardware virtualization)\&.
.RE
.PP
\fB\-r\fR, \fB\-\-chroot\fR
.RS 4
Detect whether invoked in a
\fBchroot\fR(2)
environment\&. In this mode, no output is written, but the return value indicates whether the process was invoked in a
\fBchroot()\fR
environment or not\&.
.RE
.PP
\fB\-\-private\-users\fR
.RS 4
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
\fBuser_namespaces\fR(7)
for more information\&.
.RE
.PP
\fB\-q\fR, \fB\-\-quiet\fR
.RS 4
Suppress output of the virtualization technology identifier\&.
.RE
.PP
\fB\-\-list\fR
.RS 4
Output all currently known and detectable container and VM environments\&.
.RE
.PP
\fB\-h\fR, \fB\-\-help\fR
.RS 4
Print a short help text and exit\&.
.RE
.PP
\fB\-\-version\fR
.RS 4
Print a short version string and exit\&.
.RE
.SH "EXIT STATUS"
.PP
If a virtualization technology is detected, 0 is returned, a non\-zero code otherwise\&.
.SH "SEE ALSO"
.PP
\fBsystemd\fR(1),
\fBsystemd-nspawn\fR(1),
\fBchroot\fR(2),
\fBnamespaces\fR(7)
|