-
-
Notifications
You must be signed in to change notification settings - Fork 2
Linux machinectl Guide
Mattscreative edited this page Dec 5, 2025
·
2 revisions
Complete beginner-friendly guide to machinectl on Linux, covering Arch Linux, CachyOS, and other distributions including container management, systemd-nspawn containers, and machine control.
machinectl controls systemd-nspawn containers.
Uses:
- List containers: Show containers
- Start containers: Start containers
- Stop containers: Stop containers
- Container management: Manage containers
Why it matters:
- Container management: Manage systemd containers
- Systemd-nspawn: Control nspawn containers
- Virtualization: Lightweight virtualization
Basic usage:
# List containers
machinectl list
# Shows all containersContainer status:
# Container status
machinectl status container-name
# Shows container statusStart machine:
# Start container
sudo machinectl start container-name
# Starts containerStop machine:
# Stop container
sudo machinectl stop container-name
# Stops containerAccess container:
# Get shell in container
sudo machinectl shell container-name
# Opens shell in containerView logs:
# Container logs
sudo journalctl -M container-name
# Shows container logsCheck systemd:
# machinectl is part of systemd
# Usually pre-installed on systemd systems
# Check systemd
systemctl --versionThis guide covered machinectl usage, container management, and systemd-nspawn control for Arch Linux, CachyOS, and other distributions.
- Virtualization - Virtualization guide
- systemd-nspawn Guide - Container creation
-
machinectl Documentation:
man machinectl
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.