When in luci and you try to create a new container the template list does not have options for either Debian stretch or Fedora 25. I would like to try and create these.
When I try it in the command line, using e.g.
lxc-create --name=test -t fedora – --release=25
on the Turris Omnia itself it does not work.
Does anyone here know how to create such containers or perhaps someone can make these available in the template list in luci?
I would like to second this question! A Debian stretch template would be highly appreciated (especially once it will be labeled ‘stable’)!
Who made/maintains the templates hosted at: repo.turris.cz/lxc?
Is anyone willing to make one and/or explain to me (us) how one makes / maintains such a template. Possibly via a TeamSpeak (I have a friend with a solid private server) or - even better - via a Wire VOIP session?
Any official word on this (@miska aren’t you one of the “LXC guys”)?
Any knowledgeable person able to provide us with a Debian Stretch (9.x) template for our future LXC endeavors?
Or maybe (as I am willing to put in the time when spent efficiently) someone able to explain me how to do this and/or point me towards a good tutorial (for simple minds like mine)? Enabling me to make one, preferably to be placed in the Omnia’s official repo?
It would be also nice to get new Ubuntu template for non-LTS version (17.04), as
Yakkety’s support will end next month. Or at least remove Yakkety template then, so people will not use deprecated version.
Edit: Also EOL of LXC 1.1 will be this year’s September. So please (at least) plan to update to 2.0. Also if/when upgrading, please fix lxc-snapshot.
Howto make your own CentOS (tested) or Fedora (untested) rootfs.
Because my rootfs is totally untrustworthy :), I will rather describe, how to make your own.
For start, you will need one container with any other disto, that supports rpm, up and running. Ubuntu is fine (then apt-get install rpm). If you are running Fedora or CentOS on x86_64, it may not work; while rpm has an --ignorearch switch, the postinstall scripts will fail to run. Running the commands in other arm distro in container doesn’t have this problem.
Also, the default install of CentOS includes NetworkManager. While it is a nice thing, for a container, it is overkill. In the following, it is replaced by systemd-networkd. Packages, that won’t work in the container (kernel, audit), are of course omitted. An importat thing to note is, that SELinux of course doesn’t work in container either, but the libraries are required by other packages.
So, let’s go to create our rootfs.
Pick a directory, where you will create the rootfs. Further, it is called $root.
Create the rootfs directory:
mkdir -p $root
Create /dev nodes:
mkdir $root/dev mknod -m 600 $root/dev/console c 5 1 mknod -m 666 $root/dev/full c 1 7 mknod -m 600 $root/dev/initctl p mknod -m 666 $root/dev/ptmx c 5 2 mknod -m 666 $root/dev/random c 1 8 mknod -m 666 $root/dev/tty c 5 0 mknod -m 666 $root/dev/tty0 c 4 0 mknod -m 666 $root/dev/urandom c 1 9 mknod -m 666 $root/dev/zero c 1 5 chown -R root:root $root/dev
Grab the following packages from your nearby CentOS mirror. Because I’m lazy, the following packages are stock 7.3, non-updated version. Once the container is up and running, you will update it to current version anyway. For base installation, the following ones are necessary:
Place all the rpms into a directory, which we will further call $rpmdir. Install them using this commdand
rpm --root=$root -ivh $rpmdir/*.rpm
Now you are almost done, let’s do the final touches. First, disable the arm kernel repo:
edit $root/etc/yum.repos.d/CentOS-armhfp-kernel.repo, set the line
enabled=1
to
enabled=0
configure your network. Using systemd-networkd, create file $root/etc/systemd/network/50-static.network with the following content, that configures static ip, gateway and dns for IPv4 and DHCP for IPv6:
If you think, that the entire CentOS installation is quite big, you might be right. Entire 100 MB is being taken by the locale definition data (/usr/lib/locale/locale-archive).
If you want to make it smaller, the following commands remove all locales except english: