[Lxc-users] What makes a container 32 bit ?
Daniel Lezcano
daniel.lezcano at free.fr
Wed Sep 15 10:49:10 UTC 2010
On 09/15/2010 12:03 PM, lxc at jelmail.com wrote:
> Forgive the noob question, but what is it that makes a container know what
> architecture (x86 vs x86_64) it is?
>
> I guess the question is equally valid for any chroot or container (LXC,
> OpenVz, etc, etc).
>
> I know it works, but I'd like to know why ?
>
The container knows the architecture because this one is tied with the
calling process 'personality'.
The 'uname' information is build in the kernel with the utsname
structure but the architecture value is overridden by the calling
process personality.
If running on a x86_64, the first process of the system (aka init) will
have a 64bits personality and the child processes will inherit this
personality. At any time a process can change its personality and become
a 32bits process, hence all its childs will be 32bits too, this is what
does 'setarch' or 'linux32'.
In a container context, running a 32bits container on a 64bits host can
lead to a problem when updating the package (will download the wrong the
packages arch). In order to fix that, a option lxc.arch=x86 (1) can be
set, so the processes running inside the container will be 32bits
processes and they will see the guest system as a 32bits system.
I am not sure I answer your question but I hope that helps.
Thanks
-- Daniel
(1) note this option will be available for 0.7.3 which is not yet out.
More information about the lxc-users
mailing list