← All stories
● Covered by 1 source · 1 reportLow impact1 neutral

Guide to systemd-nspawn containers for isolated software execution

🔄 Updated 14d ago
New to BrevFeed? We gather this story from every outlet covering it into one summary — ranked by real-world impact, not just the latest headline — so you never miss what matters. What is BrevFeed? →

Key points

  • systemd-nspawn is a lightweight container technology.
  • It uses writable root filesystems, similar to a VM.
  • Useful for isolation, GPU sharing, and low overhead.
  • Guide covers setting up rootfses for different distros.

Introduction to systemd-nspawn

systemd-nspawn is a container technology based on Linux namespaces, offering isolation similar to Docker but with differences in image management. Unlike Docker's read-only images, systemd-nspawn typically uses a writable root filesystem, functioning more like a lightweight virtual machine or an advanced chroot environment.

Key Use Cases

systemd-nspawn is beneficial in several situations: when a full virtual machine is not possible due to lack of nested virtualization on a VPS, when hardware access like GPU sharing is required (e.g., for LLMs), to avoid virtualization overhead, or for direct host file access without virtiofs. It also serves as an alternative to Docker when specific requirements or preferences dictate.

The author specifically uses systemd-nspawn for isolating self-hosted LLMs running in Ollama and Open WebUI.

Setting Up systemd-nspawn Containers

Setting up systemd-nspawn involves creating a separate root filesystem in a directory, typically under /var/lib/machines/[hostname]. Since systemd-nspawn lacks an integrated image manager, users must create these rootfses using traditional Unix methods, akin to setting up a chroot.

The process for creating a new root filesystem varies by Linux distribution. The article provides instructions for common distributions, tested on Debian, but applicable to others.

✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →

The daily brief

One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.

One email a day. Unsubscribe in one click, any time.

Today's brief

Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.

~4 min · 3 stories · Nov 07

▶ Play today's brief Listen on Spotify

New every morning, and the back catalogue is archived by date.

Reporting from

This article provides a guide to setting up and using systemd-nspawn containers, a lightweight Linux namespaces-based container technology. It details how to create root filesystems for various Linux distributions and outlines scenarios where systemd-nspawn is particularly useful, such as running LLMs with GPU access or when full virtualization is not feasible.