[lxc-users] running various (mismatching) distributions in lxc
Tomas Vondra
tv at fuzzy.cz
Mon May 12 22:14:45 UTC 2014
Hi all,
lxc-newbie here. I'm learning about lxc for a few days, and one of the
things that caught my eye is the possibility to run various mismatching
distributions. For example Gentoo container on a CentOS host, and so on.
The docs I found (e.g. the really nice blog series at [1]) seem to
suggest this should be possible and quite easy to setup, however
whenever I keep getting into issues / containers that don't boot etc.
Running gentoo on gentoo, or fedora on fedora seems to work, but when I
try to 'mix it' I get various errors (init/systemd failures etc),
resulting in a container that is either completely unbootable or
impossible to use.
So my question is - is that a good idea, or should I stick with running
matching containers (gentoo in gentoo, fedora in fedora, ...)? Or are
there some additional steps that I need to do, to make this work?
Or maybe some 'rules' - e.g. that both host/guest should run the same
init system (e.g. both systemd), or something like that?
For example - after a while of struggling (and installing rpm/yum and a
few other tools into the gentoo system), the lxc-create seems to create
centos container just fine:
# lxc-create -t centos -n centos-test
...
Container rootfs and config have been created.
Edit the config file to check/enable networking setup.
...
(full output http://pastebin.com/21b18gYK)
but once I try to start it, I get this:
# lxc-start -n centos-test
lxc-start: No such file or directory - error mounting
/opt/lxc/lib/lxc/rootfs/proc/sysrq-trigger on
/opt/lxc/lib/lxc/rootfs/proc/sysrq-trigger
lxc-start: failed to setup the automatic mounts for 'centos-test'
lxc-start: failed to setup the container
lxc-start: invalid sequence number 1. expected 2
lxc-start: failed to spawn 'centos-test
and other failures if I try to create and start fedora or ubuntu
containers.
thanks
Tomas
[1] https://www.stgraber.org/2013/12/20/lxc-1-0-blog-post-series/
More information about the lxc-users
mailing list