dchroot 

dchroot is a program that helps use chroots on UNIX machines.  It is
tested and used on Debian GNU/Linux but should work on most Unices.

You should include all chroots you want to use in /etc/dchroot.conf, like this:

--- begin example ---
stable  /chroot/stable
testing /chroot/testing
---  end example  ---

Then, when you want to execute a command in one of those roots, do:

$ dchroot -c rootname command

Q.0 How do I create a chroot?

A.0 See the Debian debootstrap package, basically, install it and then:

# debootstrap woody /chroot/woody

Q.1 How do I share filesystems between chroots?

A.1 If you are running Linux 2.4.0 or higher it is possible to remount
part of the file hierarchy somewhere else.  For example, the following
line in /etc/fstab will remount /home inside /chroot/stable :

# <file system> <mount point>        <type> <options> <dump> <pass>
/home           /chroot/stable/home   none    bind      0       2

Q.2 How can I get /proc mounted in the chroot

A.2 Put a line in /etc/fstab that looks something like this:

proc            /chroot/stable/proc  proc   defaults   0       0

Q.3 Why can't I connect to my local Xserver from within the chroot?

A.3 If you share /tmp between chroots local X server connections will work.
Put something like this in /etc/fstab (need kernel >> 2.4.0):

/tmp    /chroot/stable/tmp       none            bind    0       1

David Kimdon <dwhedon@debian.org>
