SYSTEMD-MACHINED(8)
okay bestie, welcome to the SYSTEMD-MACHINED.SERVICE(8) manual page โ the one all about systemd-machined.service and /usr/lib/systemd/systemd-machined. grab a strawberry ๐ and let's get into it.
โจ NAME โจ
systemd-machined.service, systemd-machined โ the virtual machine and container registration manager. that's the whole name vibe: it manages registration for VMs and containers, periodt. ๐
๐ SYNOPSIS ๐
systemd-machined.service
/usr/lib/systemd/systemd-machined
๐ธ DESCRIPTION ๐ธ
systemd-machined is a system service that keeps track of locally running virtual machines and containers. no cap. ๐ฆ
it's useful for registering and keeping track of both OS containers โ containers that share the host kernel but run a full init system of their own and behave in most regards like a full virtual operating system rather than just one virtualized app โ and full virtual machines โ virtualized hardware running normal operating systems and possibly different kernels. both icons, honestly. โจ
systemd-machined should not be used for registering/keeping track of application sandbox containers. a โmachineโ here is supposed to be an abstract term covering both OS containers and full virtual machines, but not application sandboxes. ๐ซถ
machines registered with machined are exposed in various ways in the system. for example:
- tools like
ps(1)will show to which machine a specific process belongs in a column of its own, and so willgnome-system-monitor[1] orsystemd-cgls(1). ๐ - systemd's various tools (
systemctl(1),journalctl(1),loginctl(1),hostnamectl(1),timedatectl(1),localectl(1),machinectl(1), ...) support the-Mswitch to operate on local containers instead of the host system. ๐ systemctl list-machineswill show the system state of all local containers, connecting to the container's init system for that. ๐systemctl's--recursiveswitch has the effect of not only showing the locally running services, but recursively showing the services of all registered containers. ๐ช- the
machinectlcommand provides access to a number of useful operations on registered containers, such as introspecting them, rebooting, shutting them down, and getting a login prompt on them. ๐ - the
sd-bus(3)library exposes thesd_bus_open_system_machine(3)call to connect to the system bus of any registered container. ๐ - the
nss-mymachines(8)module makes sure all registered containers can be resolved via normal glibcgethostbyname(3)orgetaddrinfo(3)calls. ๐
see systemd-nspawn(1) for some examples on how to run containers with OS tools. ๐ง
if you are interested in writing a VM or container manager that makes use of machined, please have a look at Writing Virtual Machine or Container Managers[2]. also see the New Control Group Interfaces[3]. ๐
the daemon provides both a C library interface (which is shared with systemd-logind.service(8)) as well as a D-Bus interface and a Varlink interface. the library interface may be used to introspect and watch the state of virtual machines/containers. the bus interface provides the same but in addition may also be used to register or terminate machines. the Varlink interface may be used to register machines with optional extensions, e.g. with an SSH key / address; it can be queried with varlinkctl introspect /run/systemd/machine/io.systemd.Machine io.systemd.Machine. for more information please consult sd-login(3) and org.freedesktop.machine1(5) and org.freedesktop.LogControl1(5). ๐ฐ๏ธ
a small companion daemon systemd-importd.service(8) is also available, which implements importing, exporting, and downloading of container and VM images. ๐ฆ
for each container registered with systemd-machined.service that employs user namespacing, users/groups are synthesized for the used UIDs/GIDs. these are made available to the system using the User/Group Record Lookup API via Varlink[4], and thus may be resolved with userdbctl(1) or the usual glibc NSS calls. ๐ฅ
๐ฅ SEE ALSO ๐ฅ
go peek at: systemd(1), machinectl(1), systemd-nspawn(1), nss-mymachines(8), systemd.special(7), org.freedesktop.machine1(5), ssh(1). ๐
๐ NOTES ๐
- gnome-system-monitor โ
https://help.gnome.org/users/gnome-system-monitor/ - Writing Virtual Machine or Container Managers โ
https://systemd.io/WRITING_VM_AND_CONTAINER_MANAGERS - New Control Group Interfaces โ
https://systemd.io/CONTROL_GROUP_INTERFACE - User/Group Record Lookup API via Varlink โ
https://systemd.io/USER_GROUP_API
that's the tea โ: systemd 261.3 is the version, SYSTEMD-MACHINED.SERVICE(8) is the manual, and the footer didn't show a date so i'm not making one up โ periodt. ๐
โจ
๐ฆ where this page comes from
- ubuntu stonking: systemd-container 261.3-0ubuntu3 ยท LGPL-2.1-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms