Creating a complete Debian GNU/Linux chroot

Based on instructions found at http://wiki.debian.org/Debootstrap, I used the following to create a chroot in my stable installation.

sudo apt-get install debootstrap
export MY_CHROOT=/home/sid-root
cd /
sudo mkdir $MY_CHROOT
sudo debootstrap --arch i386 sid $MY_CHROOT http://ftp.se.debian.org/debian/
echo "proc $MY_CHROOT/proc proc defaults 0 0" >> /etc/fstab
mount proc $MY_CHROOT/proc -t proc
echo "sysfs $MY_CHROOT/sys sysfs defaults 0 0" >> /etc/fstab
mount sysfs $MY_CHROOT/sys -t sysfs
cp /etc/hosts $MY_CHROOT/etc/hosts
cp /proc/mounts $MY_CHROOT/etc/mtab
mount --bind /dev/pts $MY_CHROOT/dev/pts
chroot $MY_CHROOT /bin/bash

To get same locales as in the parent system, install locales and run dpkg-reconfigure locales.

comments powered by Disqus


Back to the index

Blog roll

R-bloggers, Debian Weekly
Valid XHTML 1.0 Strict [Valid RSS] Valid CSS! Emacs Muse Last modified: oktober 12, 2017