Skip to content

Instantly share code, notes, and snippets.

@daviehh
Forked from jdnavarro/fedora-nspawn.markdown
Created September 27, 2019 23:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daviehh/d77c6d816813f9e9941fdf9ff1711a65 to your computer and use it in GitHub Desktop.
Save daviehh/d77c6d816813f9e9941fdf9ff1711a65 to your computer and use it in GitHub Desktop.
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
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment