machinectlsystemdDeveloperLennartPoetteringlennart@poettering.netmachinectl1machinectlControl the systemd machine managermachinectlOPTIONSCOMMANDNAMEDescriptionmachinectl may be used to
introspect and control the state of the
systemd1
virtual machine and container registration manager systemd-machined.service8.OptionsThe following options are understood:When showing
machine properties, limit the
output to certain properties as
specified by the argument. If not
specified, all set properties are
shown. The argument should be a
property name, such as
Name. If
specified more than once, all
properties with the specified names
are shown.When showing
machine properties, show all
properties regardless of whether they are
set or not.Do not ellipsize
process tree entries.When used with
kill,
choose which processes to kill. Must
be one of , or
to select whether
to kill only the leader process of the
machine or all processes of the
machine. If omitted, defaults to
.When used with
kill, choose
which signal to send to selected
processes. Must be one of the
well-known signal specifiers, such as
SIGTERM,
SIGINT or
SIGSTOP. If
omitted, defaults to
SIGTERM.Do not print the legend,
i.e. the column headers and the
footer.When used with
bind creates the
destination directory before applying
the bind mount.When used with
bind applies a
read-only bind
mount.The following commands are understood:listList currently running
virtual machines and containers.
statusNAME...Show terse runtime
status information about one or more
virtual machines and containers. This
function is intended to generate
human-readable output. If you are
looking for computer-parsable output,
use show instead.
showNAME...Show properties of one
or more registered virtual machines or
containers or the manager itself. If
no argument is specified, properties
of the manager will be shown. If an
NAME is specified, properties of this
virtual machine or container are
shown. By default, empty properties
are suppressed. Use
to show those
too. To select specific properties to
show, use
. This
command is intended to be used
whenever computer-parsable output is
required. Use
status if you are
looking for formatted human-readable
output.loginNAMEOpen a terminal login
session to a container. This will
create a TTY connection to a specific
container and asks for the execution of a
getty on it. Note that this is only
supported for containers running
systemd1
as init system.rebootNAME...Reboot one or more
containers. This will trigger a reboot
by sending SIGINT to the container's
init process, which is roughly
equivalent to pressing Ctrl+Alt+Del on
a non-containerized system, and is
compatible with containers running any
init system.poweroffNAME...Power off one or more
containers. This will trigger a reboot
by sending SIGRTMIN+4 to the
container's init process, which causes
systemd-compatible init systems to
shut down cleanly. This operation does
not work on containers that do not run
a
systemd1-compatible
init system, such as
sysvinit.killNAME...Send a signal to one
or more processes of the virtual
machine or container. This means
processes as seen by the host, not the
processes inside the virtual machine
or container.
Use to
select which process to kill. Use
to select
the signal to send.terminateNAME...Terminates a virtual
machine or container. This kills all
processes of the virtual machine or
container and deallocates all
resources attached to that
instance.bindNAMEPATH [PATH]Bind mounts a
directory from the host into the
specified container. The first
directory argument is the source
directory on the host, the second
directory argument the source
directory on the host. When the latter
is omitted the destination path in the
container is the same as the source
path on the host. When combined with
the
switch a ready-only bind mount is
created. When combined with the
switch the
destination path is first created
before the mount is applied. Note that
this option is currently only
supported for
systemd-nspawn1
containers.copy-toNAMEPATH [PATH]Copies files or
directories from the host system into
a running container. Takes a container
name, followed by the source path on
the host and the destination path in
the container. If the destination path
is omitted the same as the source path
is used.copy-fromNAMEPATH [PATH]Copies files or
directories from a container into the
host system. Takes a container name,
followed by the source path in the
container the destination path on the
host. If the destination path is
omitted the same as the source path is
used.Exit statusOn success, 0 is returned, a non-zero failure
code otherwise.See Alsosystemd-machined.service8,
systemd-nspawn1,
systemd.special7