So, here is how you install a debootstrap sandbox on your linux box. First step is to install debootstrap. On debian or ubuntu you can install it using apt-get.
apt-get install debootstrap
Now, create a folder where you need sandbox.
Now, use the following command to create your sandbox. Im creating sarge sandbox so I am specifying as sarge. If you need Lenny or squeeze sandbox then you have specify it.
debootstrap sarge /home/sandbox/debian
If you are using proxy use the following command.
http_proxy = “proxyurl:proxyport” debootstrap sarge /home/sandbox/debian
You should now see something like this…
I: Retrieving Release
I: Retrieving Packages
I: Validating Packages
I: Resolving dependencies of required packages…
I: Resolving dependencies of base packages…
Once its done, do the following to make it a perfect sandbox to work.
mount -t proc proc /home/sandbox/debian/proc/
cp /etc/resolv.conf /home/sandbox/debian/etc
cp /etc/hosts /home/sandbox/debian/etc
Now, chroot and work with your sandbox.
To identify different sandboxes, you can do the following.
Inside sandbox after using chroot, create the following file.
Add the name of your sandbox inside that file. I have added the name as my-sbox
Now, edit the /root/.bashrc file inside the sandbox and add the following.
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z “$debian_chroot” ] && [ -r /etc/debian_chroot ]; then
# set a fancy prompt (non-color, overwrite the one in /etc/profile)
If you like this article, then please consider sharing it. Sharing really inspires us to do things much better!!