TinyBox Linux is a minimal, educational Linux distribution built from scratch. It demonstrates how to build a Linux system using the Linux Kernel and ToyBox for the userspace. The entire distribution fits in a few megabytes.
- Extremely Small: ~3 MB (Kernel + Initramfs).
- Educational: Built from source to understand the Linux boot process.
- Networking: Includes networking support (DHCP, DNS).
- Custom Kernel: Uses a highly optimized
tinyconfigkernel. - ToyBox: Uses minimal utilities for the shell and user environment.
- Linux Kernel: 6.17.91 (
bzImage: 2.65 MB) - ToyBox: 0.8.13 (
initramfs.cpio.gz: 500 KB) - ISO Image:
image.iso: 3.7 MB
- QEMU: To run the distribution.
- Docker (Optional): For building in a clean environment.
- Linux Build Tools:
build-essential,git,curl,cpio,bison,flex,bc,libelf-dev,libssl-dev.
- QEMU Prebuilt Zip [38.5 MB] - concise version of the installer [172 MB]
Exe files can be downloaded from here: https://qemu.weilnetz.de/w64/
To recreate the zip using a downloaded installer:
./extract_qemu.sh qemu-w64-setup-20250826.exeYou can run the pre-built images located in bootfiles/ or cd-root/ using QEMU.
On Windows:
# Run from ISO
.\qemu-system-x86_64.exe -cdrom image.iso
# Run from Kernel + Initrd
.\qemu-system-x86_64.exe -kernel bzImage -initrd initramfs.cpio.gzThe build process is divided into three main parts: the Kernel, the Userspace (Root Filesystem), and the Bootable ISO.
The kernel is the core of the OS. We use a minimal configuration.
- Script:
setup.sh(for defconfig) or followtinymenuconfig.md(for tinyconfig). - Process:
- Clone the Linux kernel source.
- Configure it (
make tinyconfigthenmake menuconfig). - Enable necessary features: 64-bit, TTY, Printk, ELF support, Networking (TCP/IP), PCI, E1000 driver.
- Compile:
make -j $(nproc). - Result:
arch/x86/boot/bzImage.
git clone -b linux-6.99.y --depth 1 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
wget https://raw.githubusercontent.com/EN10/TinyBoxLinux/refs/heads/main/bootfiles/.config
time yes "" | make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- -j 4The userspace contains the shell (/bin/sh) and utilities (ls, cp, ip, etc.). We use ToyBox.
- Guide:
toybox.md - Process:
- Download the latest pre-built root filesystem from landley.net.
- Extract
initramfs.cpio.gz.
To boot from a CD/DVD or USB, we wrap the Kernel and Initramfs into an ISO using Syslinux.
- Guide:
make-isoimage.md - Process:
- Install
syslinuxandisolinux. - Use the kernel's
make isoimagetarget or manually create the ISO structure withisolinux.binandisolinux.cfg. - Note: Ensure you point to the correct initramfs (
initramfs.cpio.gz).
- Install
bootfiles/: Contains the compiled kernel (bzImage) and initramfs (initramfs.cpio.gz). Also contains QEMU helper scripts.cd-root/: Contains the ISO image and ISOLINUX configuration.lib/: Helper scripts for finding dependencies and installing extra packages (likeelinks,wget,strace).setup.sh: Script to setup the environment and build a basic system.networking.sh: Script to build BusyBox with networking support.tinymenuconfig.md: Documentation for the minimal kernel configuration.toybox.md: Documentation for ToyBox.CROSS_COMPILE.sh: Helper for cross-compiling.