[Lxc-users] Container with different architecture like arm on x86 [How-to]

lxc at zitta.fr lxc at zitta.fr
Wed Apr 6 19:26:03 UTC 2011


Hi,

I tried to run an arm container under a x86_64 host and it works !!!!

Little how-to :

build a static compiled qemu-arm
         take qemu sources and build it with :
             ./configure --static --target-list=arm-linux-user; make
         U will find static qemu for arm at ./arm-linux-user/qemu-arm
use the binfmt_misc kernel module
         mount the pseudofs :
             mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
have an arm container
         let's say it is at /lxc/armcontainer
copy qemu in the container :
         cp ./arm-linux-user/qemu-arm /lxc/armcontainer/
enable binfmt :
echo 
':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-arm:'>/proc/sys/fs/binfmt_misc/register
launch your container normaly.

I found this cool, I hope it be useful someone else.

I have made this how-to from bash history, I could have made some mistakes.
feel free to ask if you're in troubles.

regards,

Guillaume ZITTA








More information about the lxc-users mailing list