Notes on Gentoo x86 Chroot Setup Guide

I followed the Gentoo x86 Chroot Setup Guide. Here are my notes/deviations of setup a chroot on Ubuntu.

The stage3 tarball is “an archive containing a minimal Gentoo environment.” When extracting files from it, you need root permission to preserve file permissions.

cd ${CHROOT}
sudo tar xvjpf stage3-*.tar.bz2

After extraction, make a portage directory inside chroot since my host system is Ubuntu, which does not have that directory

sudo mkdir ${CHROOT}/usr/portage

I do not mount /usr/portage and /usr/src/linux for the same reason. You may supply -n option when mounting directories so that you do not write to /etc/mtab.

I followed the chapter 6 of Configuring Portage and I skipped the other chapters.

I added myself with

# Inside Gentoo chroot
useradd -m -G users,wheel -u 1000 -s /bin/bash clchiou

Note that I set UID to be the same as my UID (1000) of the host system so that I have access permissions of files inside chroot from the host system.

I added USE="-X" to /etc/portage/make.conf since I do not need GUI inside chroot.

I installed sudo and edited /etc/sudoers to allow users of wheel group running sudo

Finally, you may enter chroot from your host system with

sudo chroot ${CHROOT} sudo -i -u clchiou

For mounting and entering chroot, I took script excerpt from enter_chroot.sh

Creative Commons License
This blog by Che-Liang Chiou is licensed under a Creative Commons Attribution 4.0 International License.