I’ve been tinkering around with LXC containers on my Ubuntu systems. While setting up my user for unprivileged usage, I ran into the following problem:

[chris@server ~]$ lxc-attach -n u1
lxc_container: cgmanager.c: cgm_attach: 1291 Failed to get cgroup for controller all
lxc_container: attach.c: lxc_attach: 847 error communicating with child process
[chris@server ~]$ 

After a bit of tinkering around, I found that there is a bug that is causing this issue. Adding the LXC daily build PPA and updating fixed the issue for me. I did this as follows:

[chris@server ~]$ sudo apt-add-repository ppa:ubuntu-lxc/daily
 Those are daily builds of the master branch of git://github.com/lxc/lxc for all supported versions of Ubuntu.

Required or recommended dependencies are also backported from current Ubuntu and included in this PPA to provide an identical LXC experience on all supported Ubuntu releases.
 More info: https://launchpad.net/~ubuntu-lxc/+archive/ubuntu/daily
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmpovs0swu3/secring.gpg' created
gpg: keyring `/tmp/tmpovs0swu3/pubring.gpg' created
gpg: requesting key 7635B973 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpovs0swu3/trustdb.gpg: trustdb created
gpg: key 7635B973: public key "Launchpad PPA for Ubuntu LXC team" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
[chris@server ~]$ sudo aptitude update && sudo aptitude full-upgrade -y
The following NEW packages will be installed:
The following packages will be upgraded:
  liblxc1 lxc lxc-templates python3-lxc
4 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 794 kB of archives. After unpacking 12.3 kB will be used.
Writing extended state information...
Building tag database...
[chris@server ~]$ lxc-attach -n u1
root@u1:/# exit

Hopefully this fix will make it out to the default repos soon, as I don’t typically like to use daily repos if I can avoid them.

Did I help you? Send me a tip.