Project:X86/Chroot Guide

This guide will show you how to create chroots to assist in testing packages for stablization.

What is a Chroot?
A chroot is a operation to change the root directory of the current process and the children spawned from it. In the simplest terms, it allows us to setup a completely separate install inside the one that you are already running.

Setting up your Chroot for a new install
The first thing that you need to do is create a directory for your chroot to reside.

Creation of a directory for your chroot to reside

The next step is to download a stage three tarball to the chroot and untar it.

Going to the Chroot mountpoint

To actually proceed with the install at this point, you need to mount a few directories from your live system to the chroot.

Directories needing to be mounted in your chroot

As you will notice this is by no means a secure chroot but for what we need it doesn't need to be. With all that mounted you can actually go into your new setup.

Entering your Chroot

As you are now in your new chroot, you can start a standard install from Configuring Portage.

Running X apps inside your chroot
In order to be able to launch applications with a GUI from inside your chroot when your X session was started outside the chroot, there are a few extra steps you must follow.

First, you must be using  from outside the chroot (see above). Second, since  is a separate filesystem to   you will need to mount that as well.

Mounting /dev/pts

You will also need to copy your  file to the home directory of your user in the chroot.

Copying .Xauthority and misc files

Finally, when you are inside your chroot, you need to set the  environment variable.

Setting DISPLAY

Acknowledgements
We would like to thank the following authors and editors for their contributions to this guide:


 * Joshua Jackson
 * David Morgan
 * Shyam Mani
 * Mark Loeser