Glen Pitt-Pladdy :: Blog
Xenial LXC Container on Debian
My mission was to have an Ubuntu Xenial container running on my Debian Jessie server to run server software which has to match the version on the clients (Mint/Ubuntu). That seems reasonable enough.
Assuming you've already got LXC running (eg. with Debian containers) on Jessie, you will need an updated debootstrap to be able to do Ubuntu Xenial containers. Fortunately Debian Backports provides updated packages and you will need debootstrap version 1.0.81~bpo8+1 or later for this to work.
After updating that you should be able to run:
# lxc-create -n thenewcontainer -t ubuntu -- -r xenial
That works pretty well until late in the install it bails (fortunately tidying up after it's self) with an error like:
This seems to be trying to install the lxcguest package, but that doesn't exist in recent versions of Ubuntu.
After a lot of hunting around for what was trying to install this package, I eventually found /usr/share/lxc/templates/lxc-ubuntu on line 515 which seems to be for older versions of Ubuntu where this package existed. The easy way (but may break building older Ubuntu containers) is to simply comment out the line:
# chroot $rootfs apt-get install --force-yes -y lxcguest
After that it all works.
Copyright Glen Pitt-Pladdy 2008-2017