dchroot 

dchroot is a collection of programs and documentation that
help create and maintain chroots on Debian machines.

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 /path/to/command

Q.0 How do I create a chroot?

A.0 See the 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

Q.4 I can't run commands, but if I ommit the command, I do get a shell...

A.4 You should give the full path to the command.

David Kimdon <dwhedon@debian.org>
