Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bootstrap systemd-nspawn Fedora container from an Arch Linux host

Install yum from AUR

$ yaourt -Sy yum

Add bootstrap repos to /etc/yum.d/boot.repo

[fedora]
name=fedora
baseurl=https://archives.fedoraproject.org/pub/fedora/linux/releases/23/Everything/x86_64/os/
enabled=1

[updates]
name=updates
baseurl=https://archives.fedoraproject.org/pub/fedora/linux/updates/23/x86_64/
enabled=1

Optionally if using btrfs:

# btrfs subvolume create /var/lib/machines/fedora

Bootstrap:

# yum --installroot=/var/lib/machines/fedora install systemd passwd dnf fedora-release NetworkManager

Set root password:

# systemd-nspawn -M fedora
# passwd
...
C-]]]

Start and login into the container:

# machinectl start fedora
# machinectl login fedora
# dnf update
...
@jdnavarro

This comment has been minimized.

Copy link
Owner Author

jdnavarro commented Jan 27, 2016

I first tried it with dnf, which is in AUR, instead of yum, but for some reason, when bootstrapping it can't find dnf and fedora-release packages.

@akadata

This comment has been minimized.

Copy link

akadata commented Sep 13, 2019

do you need to install dnf and /etc/fedora-release into the container? copy it/them in first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.