ia32-libs
package to have a basic set of 32-bit libraries, and possibly other packages that depend on this one. Your 32-bit executables should simply run if you have all the required libraries. For development, install gcc-multilib
, and again possibly other packages that depend on it such as g++-multilib
. You may find binutils-multiarch
useful as well, and ia32-libs-dev
on Debian. Pass the -m32
option to gcc to compile for ix86.uname -m
will still show x64_64
if you're running a 64-bit kernel, regardless of what 32-bit user mode components you have installed. Schroot described below takes care of this.chroot
command and system call starts a process with a view of the filesystem that's restricted to a subtree of the directory tree. Debian and Ubuntu ship schroot, a utility that wraps around this feature to create a more usable sub-environment.schroot
package (Debian) and the debootstrap
package (Debian). Debootstrap is only needed for the installation of the alternate distribution and can be removed afterwards./etc/schroot/chroot.d/lucid32
with the following contents:directory=/32
tells schroot where we'll put the files of the 32-bit installation. The line username=yourusername
says the user yourusername
will be allowed to use the schroot. The line groups=users,admin
says that users in either group will be allowed to use the schroot; you can also put a users=…
directive./32/etc
when you run it, in particular the DNS configuration in /etc/resolv.conf
and the user database in /etc/passwd
and other files (this can be overridden, see the documentation). There are a few more files you may want to copy manually once and for all:/etc/mtab
or /etc/fstab
in the chroot. I don't recommend using the mount
command manually in the chroot, do it from outside. But do create a good-enough /etc/mtab
to make commands such as df
work reasonably.directory
type, schroot will perform bind mounts of a number of directories, i.e. those directories will be shared with the parent installation: /proc
, /dev
, /home
, /tmp
./etc/fstab
on the parent installation./32/usr/sbin/policy-rc.d
and make it executable (chmod a+rx /32/usr/sbin/policy-rc.d
).nullmailer
instead of the default postfix
(you may want your chroot to send mail but you definitely don't want it to receive any).schroot
manual, the schroot FAQ and theschroot.conf
manual. Schroot is part of the Debian autobuilder (buildd) project. There may be additional useful tips on the Ubuntu community page about debootstrap.libXX:i386
packages as dependencies.-m32
to CFLAG
or CXXFLAG
, which will make generated program 32bit, e.g