Differences between revisions 35 and 36
Revision 35 as of 2013-04-27 23:06:55
Size: 3291
Editor: BobProulx
Comment: Remove "orphan" line
Revision 36 as of 2013-04-27 23:19:27
Size: 3350
Editor: BobProulx
Comment: host/chroot clarification
Deletions are marked like this. Additions are marked like this.
Line 43: Line 43:
 * Settings network settings  * Settings network settings in the chroot
Line 49: Line 49:
 * Mounts filesystems  * Mounts filesystems from the underlying host (NOT in the chroot)

Translation(s): Deutsch - English - Français - Italiano - Español


chroot on Unix-like operating systems is an operation that changes the apparent root directory for the current running process and its children.(Read more ...)

Basic Installation

Building a "chroot" is very easy in Debian.

You will need:

aptitude install binutils debootstrap

mkdir -p /srv/chroot/wheezy

debootstrap --arch i386 wheezy /srv/chroot/wheezy

chroot /srv/chroot/wheezy

Configuration

In general, it is necessary to create/edit key configuration points

Configuring a chroot is relatively static and very specific, it may be possible to dispense with the command "top-level" and directly edit files.

/etc/passwd
/etc/groups

/etc/hosts
/etc/resolv.conf

/etc/fstab

Mounting pseudo filesystems

/proc

proc on /proc type proc (rw)
sysfs on /sys sysfs kind (rw)

/dev/pts

In this case, the primary system, run the command:

mount --bind /dev/pts /srv/chroot/wheezy/dev/pts

Default Configurations

Generally the file /etc/fstab might look like this:

# grep chroot /etc/fstab
/dev /srv/chroot/wheezy/dev auto bind 0 0
/dev/pts /srv/chroot/wheezy/dev/pts auto bind 0 0
/proc /srv/chroot/wheezy/proc auto bind 0 0

Therefore mount on the primary system would be:

# mount | grep chroot
/dev on /srv/chroot/wheezy/dev -type none (rw, bind)
/dev/pts on /srv/chroot/wheezy/dev/pts kind none (rw, bind)
/proc on /srv/chroot/wheezy/proc type none (rw, bind)

Adding / removing packages

apt-get install deborphan

deborphan -a

apt-get remove --purge telnet manpages pppconfig ipchains ...

Complementary list svgalibg1 whiptail

apt-get install emacs23 local mc

Usage

Common examples of chroot usage:


ToDo - Clean up from French translation.