Menu
Index

Contact
Atom Feed
Comments Atom Feed

Similar Articles

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

Recent Articles

2019-07-28 16:35
git http with Nginx via Flask wsgi application (git4nginx)
2018-05-15 16:48
Raspberry Pi Camera, IR Lights and more
2017-04-23 14:21
Raspberry Pi SD Card Test
2017-04-07 10:54
DNS Firewall (blackhole malicious, like Pi-hole) with bind9
2017-03-28 13:07
Kubernetes to learn Part 4

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  2017-03-26 18: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  2017-03-26 20: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.




Note: Identity details will be stored in a cookie. Posts may not appear immediately