# Running NixOS from any Linux Distro in systemd-nspawn Containers

DevFeed: [Running NixOS from any Linux Distro in systemd-nspawn Containers](<https://devfeed.tech/articles/running-nixos-from-any-linux-distro-in-systemd-nspawn-containers-32446.md>)

Original publisher: [Read original article](<https://nixcademy.com/posts/nixos-nspawn/>)

Author: Jacek Galowicz

Published: 2023-08-29T00:00:00Z

Content type: tutorial

Language: en

Sources: [Nixcademy Blog](<https://devfeed.tech/sources/nixcademy-blog.md>)

Topics: [Nix](<https://devfeed.tech/topics/nix.md>), [systemd](<https://devfeed.tech/topics/systemd.md>), [Linux](<https://devfeed.tech/topics/linux.md>), [Containers](<https://devfeed.tech/topics/containers.md>), [Docker](<https://devfeed.tech/topics/docker.md>), [podman](<https://devfeed.tech/topics/podman.md>)

Tags: [build-times](<https://devfeed.tech/tags/build-times.md>), [caching](<https://devfeed.tech/tags/caching.md>), [containers](<https://devfeed.tech/tags/containers.md>), [docker](<https://devfeed.tech/tags/docker.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [linux](<https://devfeed.tech/tags/linux.md>), [podman](<https://devfeed.tech/tags/podman.md>), [systemd](<https://devfeed.tech/tags/systemd.md>)

## AI overview

This tutorial explains how to run NixOS on an existing Linux distribution using systemd-nspawn containers. It compares this approach with Docker and Podman, emphasizing persistent changes and NixOS's system configuration capabilities.

## Source excerpt

Run NixOS on any Linux distro using systemd-nspawn! Discover how to leverage machinectl for seamless, persistent, and configurable container management.