it would be really useful to be able to make i386 lxc containers on a amd64 machine

Bug #798476 reported by Robert Collins
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)
Fix Released
Low
Serge Hallyn

Bug Description

Binary package hint: lxc

(So that programs with poor 64-bit footprints can be run in an i386 environment).

Tags: patch

Related branches

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

twb says he's done it with the template at http://paste.debian.net/120603/

Changed in lxc (Ubuntu):
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Robert Collins (lifeless) wrote :

the lxc lucid template seems <this> close to being able to do i386 easily. The install_ubuntu() function sets arch from $(arch) without allowing a user supplied override.

Revision history for this message
Robert Collins (lifeless) wrote :

This patch is a bit crude but does the job: using it I built a container and it works, though the arch is reported quirkily ;)
sudo arch=i386 lxc-create -n lucid-test-lp -t lucid-lp -f /etc/lxc/local.conf
sudo lxc-start -n lucid-test-lp
root@lucid-test-lp:~# arch
x86_64
root@lucid-test-lp:~# dpkg --print-architecture
i386

Changed in lxc (Ubuntu):
assignee: nobody → Serge Hallyn (serge-hallyn)
tags: added: patch
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

I've sent a patch upstream to add '-a i386' as a command line argument to the template. I will make a few more changes and then push a package to ppa while waiting for upstream to pull in the patch, after which a new release will end up in oneiric (which we can then backport).

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Patches are here:

http://sourceforge.net/mailarchive/forum.php?thread_name=20110622140928.GA12177%40mail.hallyn.com&forum_name=lxc-users

http://sourceforge.net/mailarchive/forum.php?thread_name=20110622181733.GA17756%40mail.hallyn.com&forum_name=lxc-users

With these, I can do:

lxc-create -t ubuntu -n n1 -f /etc/lxc.conf -- -r natty -a i386 -b serge

to create an i386 natty-based container called n1, with /home/serge bind-mounted in.

Changed in lxc (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Robert Collins (lifeless) wrote :

note that my example left uname -m / arch unaltered and this will confuse some apps; linux32 /init/sbin rather than just /init/sbin should address that.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [Bug 798476] Re: it would be really useful to be able to make i386 lxc containers on a amd64 machine

Thanks. The lxc package in ppa:serge-hallyn/lxc-natty, with the source
at https://code.launchpad.net/~serge-hallyn/ubuntu/oneiric/lxc/update-templates
has the rest of the fix, which just amounted to puttings 'lxc.arch' in the
config.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lxc - 0.7.4.2-0.3ubuntu1

---------------
lxc (0.7.4.2-0.3ubuntu1) oneiric; urgency=low

  * Sync upstream 0.7.4.2
  * Add diff up to git head.
    - Fix interaction with cgroups-bin (LP: #784093)
    - Fix arch support to create i386 containers on amd64 (LP: #798476)
    - Support a bind-mounted $HOME with template (LP: #800482)
  * add debootstrap to Recommends (LP: #803745)
  * debian/patchs updates:
    - refresh 0002-disable-debian-checkroot-script.patch
    - drop:
      * 0004-add-ubuntu-mirrors.patch
      * 0005-add-netbase-to-templates.patch
      * 0006-fix-template-syntax-error.patch
      * 0007-natty-template-install-lxcguest.patch
      * 0010-templates-use-dpkg.patch
    - renamed and updated:
      * 0008-add-arm-to-supported-archs.patch to
        0004-add-arm-to-supported-archs.patch
      * 0009-templates-dont-use-devpts-in-fstab to
        0005-dont-use-devpts-in-fstab
      * 0011-templates-allow-fuse.patch to
        0006-templates-allow-fuse.patch
  * remove unused debian/lxc-start.sh
  * include autoreconf.mk to force Makefile.in to be rebuilt
  * Remaining changes over debian:
    - add lxcguest package
    - debian/control
      * keep docbook-utils in Build-Depends
    - lxc.default: add commented example MIRROR
 -- Serge Hallyn <email address hidden> Thu, 07 Jul 2011 13:53:52 -0500

Changed in lxc (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Robert Collins (lifeless) wrote :

re this command line -
lxc-create -t ubuntu -n n1 -f /etc/lxc.conf -- -r natty -a i386 -b serge

-b probably wants to support abs paths, for flexability.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

The seems reasonable - do you think it would be safe to say that if the argument starts with / it is a path, and, if not, then it is a username?

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Excerpts from Serge Hallyn's message of Tue Jul 19 12:05:52 UTC 2011:
> The seems reasonable - do you think it would be safe to say that if the
> argument starts with / it is a path, and, if not, then it is a username?

What about

./foo

?

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Quoting Clint Byrum (<email address hidden>):
> Excerpts from Serge Hallyn's message of Tue Jul 19 12:05:52 UTC 2011:
> > The seems reasonable - do you think it would be safe to say that if the
> > argument starts with / it is a path, and, if not, then it is a username?
>
> What about
>
> ./foo
>
>
> ?

"Don't do that."

But that's why I asked. If you prefer we can add a new switch for
path bindmounting (as opposed to user binding).

-serge

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.