Chroot Info


Table of Contents

Debian Linux in Chroot 
Debian Linux in Chroot 
Debian Linux in Chroot 

Debian Linux in Chroot 

Newsgroups: gmane.linux.debian.user
Date: Tue, 31 Jul 2007 19:25:24 -0400
> My understanding of chroot is extremely limited, right now. .. how chroot
> works and what its capabilities are?

chroot is a system call that causes all descended processes to treat a directory in the filesystem as the root directory (/). When you do this to an interactive Bash shell, you then have the ability to launch programs and do development work, etc. from this chroot.

Debian has good tools for doing this sort of thing—debootstrap and friends can install a new system (etch, lenny, sid, and more) in a folder for you, and you can even install an entire 32-bit userland on a 64-bit system, which is useful for running 32-bit Firefox with stuff like the non-free Adobe Flash plugin (FYI-if you're going to point out nspluginwrapper, please also tell me how to make sound with PulseAudio work in that setup). Then there are tools like schroot (apt-get install schroot) which can be configured to launch programs from inside the chroot in one command line, complete with 32-bit uname() emulation if so desired.

Andrew J. Barr

Debian Linux in Chroot 

> Wow, you seem to be really singing the praises of chroot.
>
> I have a spare 10gig partition on my hard drive. I originally considered
> simply dual-booting Etch and Lenny, or Etch and Feisty, or something similar.
> Perhaps instead I will make it a chroot jail for Lenny.

You don't need partitions for chroots, you can just make them in a folder on your root filesystem, say /var/chroot. This is more flexible than a partition, so you might consider merging that 10gb partition into your root file system—you can use gparted on a LiveCD for easy point-and-click partition editing (I've found Ubuntu LiveCDs particularly useful for this).

> Big question answered: you can run X clients (applications) on your local,
> non-chroot Xserver (display).

Yes, remember — X is a network protocol and you can run clients on any network-connected computer, regardless of architecture or operating system.

> So, again, it is a completely separate operating system installation,
> running on the same kernel as the active, base OS?

Yes.

> So how do you handle the /boot partition? Do you have to redirect to the
> active kernel, or is this sort of automatically taken care of by
> debootstrap?  (I have never used debootstrap).

The system is already booted when you enter into your chroot. There is no need for /boot, as the kernel is already loaded into memory. However, if you want to have folders from your main system available in your chroot, 'mount —bind' is your friend.

Andrew Barr

Debian Linux in Chroot 

> > My understanding of chroot is extremely limited, right now. I have
> > searched around, but can anyone point me to anything specific that
> > they know to be a good tutorial/explanation or how chroot works
> > and what its capabilities are?
>
> Check this out:
>
> System Chroot And Debootstrap
> http://xpt.sourceforge.net/techdocs/nix/chroot/[]

Also see:

http://www.debian.org/doc/manuals/reference/ch-tips.en.html#s-chroot

Bob Proulx