Schroot for CentOS

The schroot package, originally for Debian, is now ported to CentOS 4. This is a binary compatible clone of Red Hat Enterprise Linux 4. Another popular clone is Scientific Linux 4. This rpm should work on any of these.


From the schroot package page:

Execute commands in a chroot environment

Schroot allows users to execute commands or interactive shells in different chroots. Any number of named chroots may be created, and access permissions given to each, including root access for normal users, on a per-user or per-group basis. Additionally, schroot can switch to a different user in the chroot, using PAM for authentication and authorisation. All operations are logged for security.

The current ported version is 1.1.5.

The sources were taken from Debian's orig.tar.gz with the Debian changes applied; a couple of patches were needed to get things going on CentOS.

The lockdev library (or the C library, I'm not really sure) in CentOS does a access(2) system call before locking the device. This system call uses the real user id instead of the effective user id to check access permissions. Because schroot is a suid application, device locking should be possible, but access still says no and that is why this fails on CentOS. Device locking is used with the LVM snapshot kind of schroot. The Debian version of libc/lockdev has no such issues, because no call to access is done.
The CentOS setup of pam is slightly different, so the schroot pam file had to be patched.
setup scripts
the 05lvm setup script calls lvcreate and lvremove, but these are installed in /usr/sbin on CentOS. I put absolute paths in these places.


I haven't tested all the functionality of the package yet, but a basic schroot setup should work. I've also got the LVM snapshot method to work as of build 1.1.5-4.


For documentation see the original schroot package page. Since CentOS doesn't have debootstrap, I've written a Wiki page on how to set up a chroot environment from scratch for CentOS.


You can report issues by sending me email:


You can download the binary rpm, or the source rpm which contains the sources, patches and spec file.

My home page