Ubuntu – How to fully use the chroot I create with debootstrap on a local machine

containerdebootstrapnetworking

I'm running on a Ubuntu 10.04, and installed an 8.04 version in a directory /stuff/hardy

sudo debootstrap --variant buildd --arch i386 hardy /stuff/hardy http://archive.ubuntu.com/ubuntu

What I want to do is to get a working environment isolated from my linux machine (without installing into another partition).

My problem is, that when I chroot into it (sudo chroot /stuff/hardy) I notice that I have nothing in /proc or no network configuration. Also, if I try to go back to my home directory (inside hardy, not 10.4),

hardy# cd
I get a
/home/myuser No such file or directory

Is there an (hopefully easy) way to get an ubuntu install using debootstrap with no a lot of extra work ?

Thanks in advance

Best Answer

You can use schroot instead of chroot, it will take care of setting up /proc, /etc and cross mount your home. You can use the following script which helps to build/setup a schroot: http://bazaar.launchpad.net/~debfactory-devs/debfactory/devel/download/head%3A/schroot_build.py-20090314124651-txt9bwioeycax53m-1/build_schroot.py