[lxc-devel] lxc-execute only finds lxc-init when lxc-init is manually populated inside of the container

Peter Fedorow pfedorow at hcn-inc.com
Wed Mar 26 21:36:27 UTC 2014


On 14-03-26 05:13 PM, Stéphane Graber wrote:
> On Wed, Mar 26, 2014 at 05:08:31PM -0400, Peter Fedorow wrote:
>> How to Reproduce
>> ----------------
>> 1.  lxc-create -n test1 -t ubuntu
>> 2.  lxc-execute -n test1 -- /bin/bash
>>
>> Fails:
>> lxc-execute: Failed to find an lxc-init
>>
>> 3.  lxc-start -n test1 -d
>> 4.  lxc-console -n test1
>> 5.  login
>> 6.  sudo apt-get install lxc
>> 7.  sudo shutdown -h now
>> 8.  lxc-execute -n test1 -- /bin/bash
>>
>> Success!
>>
>>
>> LXC Versions Tested
>> -------------------
>> Ubuntu automatic upstream - 1.0.1+master~20140326-1500-0ubuntu1~ppa1~saucy1
>> Ubuntu Trusty - 1.0.1-0ubuntu1
>> Ubuntu 13.10 - 1.0.0~alpha1-0ubuntu14.1
>>
>> OS
>> --
>> $ lsb_release -a
>> No LSB modules are available.
>> Distributor ID:    Ubuntu
>> Description:    Ubuntu 13.10
>> Release:    13.10
>> Codename:    saucy
>> $ uname -a
>> Linux bigserver 3.11.0-18-generic #32-Ubuntu SMP Tue Feb 18 21:11:14
>> UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
>>
>>
>> Additional Notes
>> ----------------
>>
>> Installing the binary is a work-around for 64-bit, there is no
>> obvious work-around for 32-bit containers on a 64-bit host.
>>
>> This is not the same as bug #22.  The library is being found, but it
>> needs to be loaded from outside of the container's rootfs.
>> Providing the binary alone inside of the container is insufficient
>> unless the binary is statically linked and 32-bit compatible.
>>
>>
>> Regards,
>> Peter Fedorow
>
>
> lxc-execute depends on lxc-init being available in the container rootfs,
> just like lxc-start depends on /sbin/init being available in the
> container rootfs.
>
> So to use lxc-execute, you just need to make sure whatever package
> provides lxc-init (in Ubuntu's case, lxc itself) is installed inside the
> rootfs before you use lxc-execute.
>

I mentioned that work-around in the bug report, but as noted, it does 
not work for 32-bit containers on 64-bit hosts.  (I even tried it - see 
below.)  Further, even on 64-bit hosts, the default package resolution 
for the Ubuntu lxc package pulls in 63 packages, yet it is frequently 
desirable to use lxc-execute for light-weight tasks.


Attempt to install 64-bit lxc packages in 32-bit container.
<yeah right> :)
---
$ sudo dpkg --add-architecture amd64
$ sudo apt-get install lxc:amd64
$ sudo apt-get install lxc:amd64
Result:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help resolve the situation:

The following packages have unmet dependencies:
  logrotate : Depends: cron or
                       anacron but it is not going to be installed or
                       cron-daemon
  lxc:amd64 : Depends: apparmor:amd64 but it is not going to be installed
              Depends: dnsmasq-base:amd64 but it is not going to be 
installed
              Depends: liblxc0:amd64 (= 1.0.0~alpha1-0ubuntu14.1) but it 
is not going to be installed
              Depends: python3:amd64 but it is not going to be installed
              Depends: python3-lxc:amd64 but it is not going to be installed
              Recommends: cgroup-lite:amd64 but it is not installable or
                          cgroup-bin:amd64 but it is not going to be 
installed
              Recommends: lxc-templates:amd64 (>= 0.8.0~rc1-4ubuntu43) 
but it is not installable
              Recommends: openssl:amd64 but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be 
caused by held packages.
---



More information about the lxc-devel mailing list