Fedora Toolbox on Arch

This is an old post which I realized was stuck as a draft back in 2021. I’ve bumped the date to this year and sent it without any thought, so be warned.

Setting up podman and toolbox

# pulls in podman and flatpak
sudo pacman -Syu toolbox

I run my machine on btrfs, and I use Snapper to create snapshots of my home directory. To explicitly exclude podman containers from these snapshots, I created a subvolume for them:

# Since I own this path, I don't need root
btrfs subvol create ~/.local/share/containers

Additionally, I set my storage driver in /etc/containers/storage.conf:

driver = "btrfs"

For my user’s podman containers to work without root, my user needs to be able to create subordinate UIDs and GIDs.

# https://wiki.archlinux.org/index.php/Podman#Rootless_Podman
sudo touch /etc/sub{u,g}id
sudo usermod --add-subuids 165536-231072 --add-subgids 165536-231072 $USER
toolbox create --image registry.fedoraproject.org/fedora-toolbox:34

Limitations of toolbox

Fedora has containers prepared for toolbox, but other distros have to create their own. I looked into buildah to modify existing containers to work with toolbox, but the image requirements toolbox provides seem to be incomplete. Even building the Arch image from this recent PR failed. Perhaps in the near future other distros will develop and maintain their own toolbox images and this problem will be solved.

In the meantime, I want to run more distros!

Enter tlbx

After some digging I came across this issue which led me to find a more general runner called tlbx.

For my Arch host, I needed to remove the /media line from the script, but then this just worked:

./tlbx create -i registry.hub.docker.com/library/archlinux:latest
./tlbx enter archlinux-tlbx

And I was in a mutable Arch container!

To make it easier to install packages, I re-logged in with --user=root and installed sudo.

I’m looking forward to trying some other distros this way.

Conclusion

Leveraging containers and overlay filesystems will be a gamechanger for how I try out distributions.

My fork of tlbx can be found here.