Sandboxing

Step 2: Prep chroot for yum Usage

Installing the release package (e.g., centos-release, redhat-release) into the chroot will let yum work:

# rpm -Uvh --nodeps --root=/chroot/ centos-release-5-1.0.el5.centos.1.x86_64.rpm

Step 3: Install into the chroot

The RPM also installs the software into the chroot, but yum will handle dependencies and make things much simpler:

# yum --installroot=/chroot/install bash yum vim-minimal

At a minimum, I recommend a shell (bash), yum to install software, and the vim editor to modify files in the chroot.

Step 4: Network Configuration Files

If you want to access the network from within the chroot, you need a resolv.conf file (lets applications know where your DNS servers are to be found) and:

# mkdir /chroot/etc/
# mkdir /chroot/etc/sysconfig
# cp /etc/resolv.conf /chroot/etc/
# cp /etc/sysconfig/network /chroot/etc/sysconfig/

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Command Line: Debootstrap

    We provide basic instructions for using Debian's debootstrap to create a schroot jail for building and testing packages.

  • Command Line – Jailkit

    Setting up chroot jails is no simple task. Jailkit can make this job a little easier by automating setup and configuration.

  • dgamelaunch

    If you are into retrogaming, dgamelaunch lets you set up a server to play Roguelike games and compete with friends, all while preserving a piece of gaming history.

  • Free Software Projects

    Free software covers such a diverse range of applications that it can be hard to find the perfect tool. In this column,we pick the best of the bunch.This month you’ll learn about XFce 4.2, the PC in the PC,QBuildkde,and the latest news on the Sarge Release.

  • UCK

    We’ll show you how to create a custom Ubuntu ISO with the Ubuntu Customization Kit.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News