[CentOS] Running Fedora under CentOS via systemd-nspawn?

Tue Nov 17 17:39:27 UTC 2015
Matt Garman <matthew.garman at gmail.com>

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/