It turns out that the following is all it takes to install Debian Unstable in a chroot jail under Ubuntu, and then to log into that jail as root:
apt-get install debootstrap schroot mkdir /tmp/unstable debootstrap unstable /tmp/unstable chroot /tmp/unstable
There are a few things that need cleaning up, however, starting with locales:
apt-get install locales dpkg-reconfigure locales
Once there, select en_US.UTF-8 UTF-8
both to be installed, and as the default locale.
The following will eliminate a number of other warnings you may see:
echo "none /dev/pts devpts defaults 0 0" >> /etc/fstab mount /dev/pts
Next add a user, and enable that user to log in via sudo
adduser rubys apt-get install sudo echo "rubys ALL=(ALL:ALL) ALL" > /etc/sudoers.d/rubys chmod 440 /etc/sudoers.d/rubys
Note: visudo
can be used as an alternative. For reasons I don’t understand, usermod -a -G sudo rubys
did not have the desired effect.
One final bit of configuration before logging out as root: define some text that will show up in the prompt and window title area:
echo wheezy > /etc/debian_chroot
Back on your “host” operating system, add the following to /etc/schroot/schroot.conf
:
[unstable] description=Debian wheezy/sid (unstable) directory=/tmp/unstable root-users=rubys aliases=wheezy,default
At this point, you should be able to “log in” to your chroot jail with the following command:
schroot