---
name: "arch-nspawn"
section: "1"
platform: "linux"
package: "devtools"
version: "1:1.5.3-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/arch-nspawn"
---

# arch-nspawn(1)

Run a command or OS in a light-weight namespace container

## NAME

arch-nspawn - Run a command or OS in a light-weight namespace container

## SYNOPSIS

arch-nspawn \[options\] working-dir \[systemd-nspawn arguments\]

## DESCRIPTION

*arch-nspawn* is a wrapper around systemd-nspawn to run command or OS in a namespace container such as a directory including base utilities of a OS. It is used to build package(s) in given clean and defined environment.

## OPTIONS

- **-C** \<file\>

  Location of a pacman config file

- **-M** \<file\>

  Location of a makepkg config file. Specific additions (e.g. build flags for additional languages) can be placed in *\<file\>.d/\*.conf*.

- **-c** \<dir\>

  Set pacman cache, if no directory is specified the passed pacman.conf’s cachedir is used with a fallback to */etc/pacman.conf*

- **-f** \<src\>\[:\<dst\>\]

  Copy file from the host to the chroot. If *dst* is not provided, it defaults to *src* inside of the chroot.

- **-s**

  Do not run setarch

- **-h**

  Show this usage message

## HOMEPAGE

 *\<https://gitlab.archlinux.org/archlinux/devtools\>*

*Please report bugs and feature requests in the issue tracker. Please do your best to provide a reproducible test case for bugs.*
