LinuxCommandLibrary

systemctl-list-machines

List virtual machines and containers

TLDR

Show all machines (host and running containers/VMs)

$ systemctl list-machines
copy

List a specific machine
$ systemctl list-machines [machine]
copy

List multiple matching machines
$ systemctl list-machines [machine_1 machine_2 ...]
copy

Filter machines using wildcard patterns ie, shell-globbing
$ systemctl list-machines [pattern]
copy

SYNOPSIS

systemctl list-machines [PATTERN...]

PARAMETERS

PATTERN
    Optional glob pattern(s) to limit the list to machines whose names match the pattern.

DESCRIPTION

systemctl list-machines is a sub‑command of systemctl that queries the systemd manager for information about the local machine and any running containers that are registered with systemd-machined. It prints a table containing the machine name, class (host, container, or VM), and current state (running, offline, etc.). When one or more PATTERN arguments are supplied, only machines whose names match any of the patterns are shown, allowing quick filtering. The command is useful for administrators who need a concise overview of the host’s virtualization environment without invoking more heavyweight tools such as machinectl. Because it reports only machines that are currently known to the manager, stopped containers or VMs that have been shut down will not appear. The output is designed for human readability but can be parsed with standard text tools. It requires a recent version of systemd (≥ v208) and appropriate privileges (typically root or a user in the systemd‑machine group).

CAVEATS

Only machines that are currently registered with systemd‑machined are shown; stopped or unregistered containers/VMs are omitted. The command requires systemd ≥ v208 and sufficient privileges (root or membership in the systemd‑machine group). Output format is fixed and not directly machine‑parseable; use --output=json via systemctl show for scripting.

EXAMPLES

List all machines (host + running containers):
systemctl list-machines

Show only containers whose name contains "web":
systemctl list-machines *web*

OUTPUT FIELDS

The default table shows three columns: MACHINE (name), CLASS (host, container, vm), and STATE (running, offline, etc.).

HISTORY

The list‑machines sub‑command was introduced in systemd 208 (released in 2015) as part of the broader effort to expose container and VM management through the systemd manager. It complements machinectl, which provides more detailed inspection and control, by offering a lightweight, read‑only view of the current machine landscape. Over successive releases the command’s output format has remained stable, while additional machine classes (e.g., nspawn containers) have been added as systemd’s virtualization support expanded.

SEE ALSO

machinectl(1), systemd-machined.service(8), systemd(1)

Copied to clipboard