# systemd-nspawn: the container tool that's like chroot on steroids

Original title: A whirlwind tour of systemd-nspawn containers

> Hacker News story 50214983 · language: en · submitted 2026-10-23
> Web version: https://zeli.app/story/50214983
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 55 · by [ibobev](<https://news.ycombinator.com/user?id=ibobev>) · 💬 12
[original](<https://quantum5.ca/2025/03/22/whirlwind-tour-of-systemd-nspawn-containers/>) · [HN discussion](<https://news.ycombinator.com/item?id=50214983>)

## Summary

A practical walkthrough of systemd-nspawn, the lightweight namespace-based container technology. It explains when to use it over Docker—especially for GPU access, VPS isolation, and avoiding virtualization overhead—and shows how to build root filesystems with debootstrap, dnf, and a forked Alpine installer that fixes dangerous defaults. The author also shares real-world tips from running self-hosted LLMs in nspawn containers.

## Key quote

> I almost accidentally deleted my entire home directory when running rm -rf on the chroot…

## HN discussion (12 comments)

### [ectoloph](<https://news.ycombinator.com/item?id=50216859>)

> I have been using systemd-nspawn recently through NixOS containers[1].
>
> The combination feels quite powerful if you are in the ecosystem.
>
> Though it is slightly ironic that I find Nix more approachable with the help of LLMs and then Nix has become one of the ways I manage the environments for the LLMs.
>
> [1] https://wiki.nixos.org/wiki/NixOS_Containers

### [chasil](<https://news.ycombinator.com/item?id=50216688>)

> Eleven years ago, I wrote an introduction to nspawn from a busybox perspective.
>
> https://www.linuxjournal.com/content/infinite-busybox-system...
>
> I used that for a number of designs before my retirement.
>
> The quality of my writing certainly did improve after that was finished.

### [noopprod](<https://news.ycombinator.com/item?id=50216972>)

> I found a bug with nspawn that it can't bind mount while being in the mode which lets you delegate namespaces or whatever
>
> Aka
>
> If you have some kind of mount that matters like NVIDIA, you can't also create containers from containers.
>
> So I just switched to LXC but I guess I should submit a slop PR as well. But yeah I guess Id just caution anyone who was going to use it lol

---

## Cite

- Page: https://zeli.app/story/50214983
- Date: 2026-10-23
- Source: quantum5.ca (https://quantum5.ca/2025/03/22/whirlwind-tour-of-systemd-nspawn-containers/)
- Hacker News: https://news.ycombinator.com/item?id=50214983

## Other languages

- zh: https://zeli.app/zh/story/50214983 · markdown: https://zeli.app/zh/story/50214983.md
- ja: https://zeli.app/ja/story/50214983 · markdown: https://zeli.app/ja/story/50214983.md
- ko: https://zeli.app/ko/story/50214983 · markdown: https://zeli.app/ko/story/50214983.md
- de: https://zeli.app/de/story/50214983 · markdown: https://zeli.app/de/story/50214983.md
- es: https://zeli.app/es/story/50214983 · markdown: https://zeli.app/es/story/50214983.md
- ru: https://zeli.app/ru/story/50214983 · markdown: https://zeli.app/ru/story/50214983.md
