Project:AMD64/32-bit Chroot Guide

This guide provides instructions on how to create a 32-bit chroot.

Introduction to 64-bit system
The Gentoo Linux 32bit chroot guide will help users setting up a true 32-bit chroot on systems.

64-bit systems do not run 32-bit applications natively (yet) (at least not with Portage) so you need to use emulation libraries to make them working or create a true 32-bit system inside a chroot to install and run native 32-bit applications. For the most common uses you do not need do build a 32-bit chroot system. However, if you want to run applications that don't have a binary available to run with 32-bit libraries, you should use a 32-bit chroot. This guide will teach you how to set up a 32-bit chroot and how to install and run applications inside the chroot.

Installation of a 32-bit chroot
To install a 32-bit chroot you need to follow many footsteps that you use to install Gentoo Linux on a operating system. For now you need the latest stage3 available on the mirrors.

After downloading the stage3 create a new directory to build the chroot:

Then move the stage that has been downloaded, unpack it, and set it up:

Now the chroot is ready to be setup.

Setup
The next step is to configure new :

Now mount the various bogus file systems:

The true 32-bit chroot installed in the 64-bit system is almost ready for use. Next, a link must be created from the Portage available in your 64-bit system to the 32-bit chroot. This way, you only need to update it in one installation instead of duplicating a lot of data.

Link Portage to inside the 32-bit chroot:

To run 32-bit applications which use X, must be mounted:

Before chrooting verify has been installed. Emerge the package if it has not been installed:

It is now time to into the 32-bit chroot.

Verify that the environment is now 32-bit:

Now you have a new 32-bit chroot system ready to be updated. Follow the next steps to update it:

The setup process of the 32-bit chroot almost complete. To make things more suitable create a new file in the 64-bit system to enable the 32-bit chroot when booting. The file should be located in :

Execute the following command to enter the 32-bit environment during the next system boot:

Whenever you want to switch to the 32-bit chroot environment it is simply a matter of running the following command:

The 32-bit chroot is ready to install new packages.

Packages
Every package must be installed in 32-bit mode:

The new package should now be installed in the 32-bit chroot. The package will only be available to the system while inside the chroot. To run X applications the best solution is to use the xhost trick. When a X application is needed in the 32-bit environment, run the following command in the 64-bit environment before entering the chroot:

It now should be possible to run every X application inside the 32-bit chroot.

Conclusion
Following this guide has enabled the installation of many packages available only for the architecture. Some packages like can be installed by using the binary available for the  architecture since the 64-bit version of the package is really only 32-bit. Some of the codecs available for MPlayer need a 32-bit chroot to install win32codecs.