Setting up a Gentoo chroot environment on any OS
Steps
- Create and enter a directory for the chroot environment, for example,
host/
. - Choose a stage archive from get.gentoo.org. For a chroot system, the
following are required:
- Architecture: Should be the same as the host device (e.g. amd64).
- Init system: Any init system is fine (OpenRC or systemd).
- C library: Any C library is fine (musl or glibc).
- Multilib: Not required, unless 32-bit applications are required (WINE or Steam).
- Desktop: Not required, unless graphical applications are required (e.g. Firefox).
- Download the stage file into your chroot directory (Handbook: Alpha AMD64 HPPA (PA-RISC) MIPS PowerPC PPC64 SPARC x86).
- Extract the stage file (Handbook: Alpha AMD64 HPPA (PA-RISC) MIPS PowerPC PPC64 SPARC x86).
# As root, in any directory:
CHROOT_DIR=host
STAGE_ARCHIVE=https://distfiles.gentoo.org/releases/amd64/autobuilds\
/20250601T163943Z/stage3-amd64-musl-20250601T163943Z.tar.xz
TIME=061312182025 # MMDDhhmmYYYY
mkdir -- "$CHROOT_DIR"
cd -- "$CHROOT_DIR"
wget -- "$STAGE_ARCHIVE"
# If the machine's date is not set correctly (e.g. a live USB)
date -- "$TIME"
tar --extract --preserve-permissions --file stage3-*.tar.xz --xattrs-include='*.*' --numeric-owner