Running Fedora Under CentOS Via Systemd-nspawn?

Home » CentOS » Running Fedora Under CentOS Via Systemd-nspawn?
CentOS 2 Comments

tl;dr – Is anybody “running” a Fedora system via systemd-nspawn under CentOS?

Long version:

Before CentOS 7, I used chroot to create “lightweight containers”
where I could cleanly add extra repos and/or software without the risk of “polluting” my main system (and potentially ending up in dependency hell). The primary driver for this was MythTV, which has dozens of deps that span multiple repos. Without “containing” the MythTV
installation within a chroot environment, I would inevitably lead to conflicts when doing a yum update.

When I upgraded to CentOS 7, I found out that systemd-nspawn is
“chroot on steroids”. After figuring it all out, I replicated my MythTV “container”, and things were great.

Now I have a need for a particular piece of software: HandBrake. I
found this site[1] that packages it for both Fedora and CentOS. But the CentOS version is a little older, as the latest HandBrake requires gtk3. The latest version is available for Fedora however.

So I thought, what if I could “run” Fedora under systemd-nspawn. Well, I definitely *can* do it. I copied the base Fedora filesystem layout off the Live CD, then booted into it via systemd-nspawn. I was able to add repos (including the one for HandBrake), and actually install then run the HandBrake GUI.

So while this does work, I’m wondering if it’s safe? I’m thinking that at least some of the Fedora tools assume that they are running under a proper Fedora kernel, whereas in my scheme, they are running under a CentOS kernel. I’m sure there have been changes to the kernel API between the CentOS kernel and the Fedora kernel. Am I risking system stability by doing this?

Anyone have any thoughts or experience doing something like this, i.e. running “foreign” Linux distros under CentOS via systemd-nspawn? What if I tried to do this with Debian or Arch or Gentoo?

[1] http://negativo17.org/handbrake/

2 thoughts on - Running Fedora Under CentOS Via Systemd-nspawn?

  • Hmm, Nux Dextop (li.nux.ro) has HandBrake 0.9.9 for C7, but not yet
    0.10.2. Nux! is around this list and might be able to shed light on what is needed for 0.10.2.

  • I actually built HandBrake 0.10.2 (the latest) under C7 (using a CentOS 7 nspawn container so as not to pollute the main system with the dozens of deps I installed). Full details here if you’re interested:

    http://raw-sewage.net/articles/fedora-under-CentOS/

    The problem with the newer version of HandBrake is that it requires (a very recent version of) gtk3, which in turn has several other deps that need to be upgraded on C7. But I worked through all that, and can provide all the spec files if anyone wants.

    Anyway, the HandBrake problem is solved for me (in possibly multiple ways).

    But I’m just fascinated by the possibilities of nspawn, and wondering how far one can take it before instabilities are introduced.

    Consider how many people out there have similar problems as me: want to run CentOS for stability/reliability/vendor support, but also want some bleeding-edge software that’s only available on Fedora (or Ubuntu or Arch). If it’s “safe” to run these foreign distributions under CentOS via nspawn, then I think that’s a simple solution. Virtual Machines are of course a possible solution, but they seem overkill for this class of problem. And not to mention. possibly inefficient—something like HandBrake should benefit from running on bare metal, rather than under a virtualized CPU.