How to build a Ubuntu chroot environment
As with Debian, you can use debootstrap
to create your base Ubuntu system. You will then have to mount both your dev
and proc
filesystem for your chroot environment to work properly. Follow these steps for details.
-
Create a chroot folder
$ mkdir chroot-ubuntu
-
Create a base Ubuntu system using
debootstrap
.$ sudo debootstrap --variant=buildd gutsy chroot-ubuntu http://archive.ubuntu.com/ubuntu/
Change
gutsy
to any Ubuntu release that you want. E.g.hardy
orfeisty
. -
Mount
proc
anddev
filesystem on to the base system.$ sudo mount -o bind /dev chroot-ubuntu/dev $ sudo mount -o bind /proc chroot-ubuntu/proc
-
Chroot .
$ sudo chroot chroot-ubuntu /bin/bash
-
Unmount both
dev
andproc
filesystem once exiting chroot.$ sudo umount chroot-ubuntu/dev chroot-ubuntu/proc