Running a Fedora container on Arch Linux
To be able to run a Pagure instance locally I need to run it on Fedora. But I want to keep Arch Linux on my computer. Thus I will make a Fedora container from an Arch Linux host.
There is this article: Container technologies in Fedora: systemd-nspawn in Fedora magazine. I think systemd-nspawn is what I could use.
There is also this gist repo: Bootstrap systemd-nspawn Fedora container from an Arch Linux host. I think I could use that too.
yaourt -Sy yum
I added bootstrap repos to
that is to create a directory yum.repos.d and a file boot.repo with this content:
[fedora] name=Fedora $releasever - $basearch failovermethod=priority #baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/ metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch enabled=1 gpgcheck=0 repo_gpgcheck=0 [updates] name=Fedora $releasever - $basearch - Updates failovermethod=priority #baseurl=http://download.fedoraproject.org/pub/fedora/linux/updates/$releasever/Everything/$basearch/ metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch enabled=1 gpgcheck=0 repo_gpgcheck=0
yum --installroot=/var/lib/machines/fedora install systemd passwd dnf fedora-release NetworkManager
Set root password:
systemd-nspawn -M fedora
Start and login into the container:
machinectl start fedora
machinectl login fedora
And the Fedora container is working!
Update: Or at least mostly working. There is some problem starting the machine the next time just
machinectl start fedora. It results in some Permission denied stuff. Solution: start the
container like with systemd-nspawn and path to the machine:
sudo systemd-nspawn -b -D /var/lib/machines/fedora