Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm getting this error using 12.04. When I run sudo lxc-execute -n foo -f lxc.example.conf ls, I get

/usr/lib/lxc/lxc-init: error while loading shared libraries: libapparmor.so.1: cannot open shared object file: No such file or directory

Any idea how to resolve this? I've installed libapparmor-dev and still no luck.

share|improve this question
    
Does the file in fact exist? If not, download, and place it there... –  soandos Jun 12 '12 at 1:46
add comment

2 Answers 2

The library is in the libapparmor1 package:

% dpkg -S /usr/lib/libapparmor.so.1
libapparmor1: /usr/lib/libapparmor.so.1

And this is actually a dependency of lxc-init, which lives in the lxc package:

% dpkg -S /usr/lib/lxc/lxc-init
lxc: /usr/lib/lxc/lxc-init

% dpkg -s lxc | grep Depends
Depends: upstart-job, libapparmor1 (>= 2.6~devel), libc6 (>= 2.14), libcap2 (>= 2.10), apparmor, bridge-utils, dnsmasq-base, iptables, rsync

Do you have a broken installation? This might help:

apt-get update
apt-get install -f
share|improve this answer
add comment

So after some playing around, what I ended up trying was copying the libapparmor.so.1 on my host machine into the guest container and it seems to have worked. So the problem wasn't actually on the host machine that I was trying to run lxc-execute on. In the end, for our build script, I now install libapparmor-dev into the container's file system:

chroot $JAIL /bin/sh -c "apt-get -yf install libapparmor-dev"

After that, I am able to run lxc-execute on that container. $JAIL being the directory where it's located.

And for further reading, here's a post I found about why apparmor is now a dependency: http://s3hh.wordpress.com/2012/05/03/lxc-in-precise-and-beyond/

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.