linux-libre-vm: a super minimal Linux Libre system, built from source
I wanted a Linux system small enough to understand end to end: every package built from a pinned source revision, no mystery blobs, nothing I didn’t choose.
linux-libre-vm is that system. It builds a stripped-down GNU/Linux from scratch using the Linux-libre kernel, GNU coreutils, glibc and GCC - no non-free firmware, minimal footprint, minimal attack surface.
Both x86_64 (QEMU q35 + virtio-pci) and arm64 (QEMU virt + virtio-pci) boot to a shell with DHCP networking. The build host can be x86_64 or aarch64 Linux, and it’s auto-detected.
- Source: github.com/stan-kondrat/linux-libre-vm
- Releases: github.com/stan-kondrat/linux-libre-vm/releases
Just run it
You don’t have to build anything. The VM targets download the latest release by default. On an Apple Silicon Mac the arm64 image runs in UTM with hardware virtualization:
make utm-create utm-start utm-console
With plain QEMU on any host, including inside a Linux build VM:
make qemu-start qemu-console
VM_SOURCE=local uses your own build instead, and VM_RELEASE=edge picks the newest build of main.
Or build it
scripts/fetch-submodules.sh # shallow, pinned commits only
make build # all userland + kernel, both arches
make install # install to rootfs/
make disk-image # ext4 images, no root needed
make qemu-x86_64 # boot x86_64 in QEMU (Ctrl-C to exit)
make qemu-arm64 # boot arm64 in QEMU (Ctrl-C to exit)
All third-party sources are git submodules under sources/, and they are never modified in place: patches live in sources-patches/ and are applied to a copy. GCC, glibc and binutils come from the host.
What’s inside
The userland is deliberately small:
- Kernel: linux-libre (the deblobbed kernel).
- Core tools: bash, GNU coreutils, grep, sed, gawk, findutils, diffutils, gzip, tar, vim.
- System: util-linux, procps-ng, iproute2, ncurses, libxcrypt.
- Init and network: runit and dhcpcd.
- Remote access: OpenSSH (with OpenSSL’s libcrypto), for key and password logins.
The Makefile is split into modular fragments under mk/, one per concern: sources, packages, kernel, init, disk images, tests, and the UTM and QEMU runners. A smoke test boots an image and checks the console, DHCP and the ssh key and password logins.
A dev image, too
A second, larger image carries a toolchain built from the same pinned sources (gcc, binutils, glibc, make, perl, Python, Node.js) plus cross compilers for seven targets under /opt/cross. Like the base image, it’s built once and used as it is: a build runtime for other projects, not a system that rebuilds itself.
It’s also published as a container image, so a CI job can build inside it:
runs-on: ubuntu-24.04 # or ubuntu-24.04-arm
container: ghcr.io/stan-kondrat/linux-libre-vm-dev:v0.4.0
/usr/share/linux-libre-vm/release (and /etc/os-release) say which release you’re in. The repository docs cover the native toolchain, the cross toolchains, and building and publishing both in CI.
Built on top of it
- linux-devbox-vm uses linux-libre-vm as its base. One script turns an empty folder on an Apple Silicon Mac into a development VM: it runs the linux-libre-vm arm64 image in UTM and serves the Theia IDE (a VS Code-like IDE in the browser) and OpenSSH with a user and password login. The image itself isn’t modified. The devbox adds its pieces (Theia, Node.js, git and a few libraries) through a shared folder and boot-time settings, and
./vm.sh recreategives you a fresh disk from the release. - Eclogite Linux boots a pinned linux-libre-vm development image and builds packages inside it.