Menu
Index

Contact
LinkedIn
GitHub
Atom Feed
Comments Atom Feed



Tweet

Similar Articles

06/03/2012 09:00
Debian packaging for site deployment
22/04/2010 22:00
Basic Postfix config guide for Cacti, Spam Blocking, TLS etc.
25/10/2015 08:02
Ubuntu/Debian/Linux Mint and AWS CLI Autocomplete
31/10/2009 11:03
Linux (Debian, Ubuntu) SNMP basics
28/12/2015 14:03
Home Lab Project: Network Bridges for KVM II - Flexible Bridges & VLANs
21/09/2009 18:57
Page allocation failures and other wierdness

Recent Articles

23/04/2017 14:21
Raspberry Pi SD Card Test
07/04/2017 10:54
DNS Firewall (blackhole malicious, like Pi-hole) with bind9
28/03/2017 13:07
Kubernetes to learn Part 4
23/03/2017 16:09
Kubernetes to learn Part 3
21/03/2017 15:18
Kubernetes to learn Part 2

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.

Prep

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

... but

Fail

That works pretty well until late in the install it bails (fortunately tidying up after it's self) with an error like:

...
...
Get:5 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [69.3 kB]
Fetched 296 kB in 0s (848 kB/s)                           
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package lxcguest is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'lxcguest' has no installation candidate
lxc_container: container creation template for thenewcontainer failed
lxc_container: Error creating container thenewcontainer

This seems to be trying to install the lxcguest package, but that doesn't exist in recent versions of Ubuntu.

Fix

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.

Comments:

Oliver Image  26/03/2017 19:42 :: Oliver

Thanks a lot for those notes, they helped a lot!
As I encounter another problem and my google search did not succeed perhaps you may help.
After a successful installation of ubuntu xenial as guest under debian jessie I am not able to login on the console using lxc-console. The remote access via ssh is working perfectly, and to be honest this is the most important, but it would be perfect if console access is working also.
So did you encounter a similar problem on your side?

Thanks for your feedback and please go on posting excellent stuff like the one above.

Glen Pitt-Pladdy Image  26/03/2017 21:03 :: Glen Pitt-Pladdy

I can't say I've tried since from the host you can lxc-attach and that will execute the shell if you don't specify a command. If you want to use lxc-console, you may need to specify the tty as "0 for the console" as the man page says.




Are you human? (reduces spam)
Note: Identity details will be stored in a cookie. Posts may not appear immediately