Schroot allows users to execute commands or interactive shells in different chroots (see schroot).
Unless otherwise stated, all commands presented on this page must be executed as root.
So, either run them as sudo <command>, or switch to root at the beginning by typing su.
More info: sudo, http://linux.die.net/man/1/su
Installation
apt-get install schroot
debootstrap is used to install a Debian base system(the new root), for the example below.
apt-get install debootstrap
Setup
Configuration file: /etc/schroot/schroot.conf
If you prefer separate configuration files, place them in /etc/schroot/chroot.d/.
Example
A simple example that creates a chroot and installs, for use, ngspice for an X windows environment.
Backup:
cp /etc/schroot/schroot.conf /etc/schroot/schroot.conf.old
Create root file system:
mkdir -p /srv/chroot/spice debootstrap wheezy /srv/chroot/spice
Replace the contents of /etc/schroot/schroot.conf with the following:
# schroot chroot definitions. # See schroot.conf(5) for complete documentation of the file format. # # Please take note that you should not add untrusted users to # root-groups, because they will essentially have full root access # to your system. They will only have root access inside the chroot, # but that's enough to cause malicious damage. # # The following lines are examples only. Uncomment and alter them to # customise schroot for your needs, or create a new entry from scratch. # # [wheezy-spice] description=Contains the SPICE program aliases=spice type=directory directory=/srv/chroot/spice users=jsmith root-groups=root script-config=desktop/config personality=linux preserve-environment=true
Where jsmith is an underprivileged user.
schroot -c spice apt-get update && apt-get install ngspice
ToDo : This page is a place holder. Please re-use the content of ?Kde4schroot to make it a generic example.
See Also :
?Kde4schroot - How-to set up a schroot to run KDE4
http://linuxgazette.net/150/kapil.html - Virtualizing without Virtualizing
other SystemVirtualization solutions
http://www.debian-administration.org/article/schroot_-_chroot_for_any_users