Building My Own Minimal Debian-Based Distro and Testing it on Real Hardware

Building My Own Minimal Debian-Based Distro and Testing it on Real Hardware

●1 ●1 ●4
calendar_today ago • schedule5 min read

I'm a Linux and AI advocate. I like a minimal OS so decided to make my own distro using Debian netinstall with the Openbox Window Mgr, rather than a heavy desktop environment that will use up my CPU cycles. The result is XiraLinux: Debian 12, Openbox, my own themes and the Calamares graphical installer, all packed into a live ISO that boots on both UEFI and old BIOS machines.

It took two versions, four computers and a lot of things breaking in live-build that were important to get right. I did the work with an AI assistant (Claude), which wrote most of the scripts while I made the decisions, created the USB drives and performed every test on real hardware. This article is about those tests, because the bugs I found there are the useful part.

Why build a distro at all?

All my PCs run Linux. I wanted a system that was entirely mine, built only from plain Debian packages and my own configs, preferred packages and applications.

I set three rules:

  1. Plain Debian 12 only. No third-party repos, no backports.
  2. Functionality first. It has to boot, install and run. Themes, keybindings, menus etc. can change later.
  3. Test on real hardware only. No virtual machines. If it works on my old laptops, I'm more confident that it will work for others.

How it's built

XiraLinux is built with Debian's own live-build tool. The recipe is a folder of plain text:

  • a package list (467 packages I chose, about 2,400 once dependencies are pulled in)
  • config files copied into every new user's home folder (/etc/skel)
  • hook scripts that run inside the new system during the build
  • five small packages of my own for the theme, branding, installer settings and tools
  • boot menus for BIOS and UEFI

One command turns that into a hybrid ISO you can write straight to a USB stick. Calamares gives it a proper point-and-click installer, the same one Manjaro and Debian's own live images use.

The first version installed and ran.

Then I started testing it on more machines.

Lesson 1: Check that the build can actually run

The first full build failed near the end with a conflict between grub-efi-amd64 and grub-pc. I wanted both on the ISO so the installer could set up either boot type offline. But live-build downloads each package list with a single apt-get install, and those two packages refuse to be installed together.

We'd checked that the packages existed. We hadn't checked that live-build could fetch them the way it actually does. The fix was to split them into separate lists, and to add a preflight script: a set of checks that runs before every build and simulates each step the way live-build will. Today, no build starts until preflight passes.

Lesson 2: Removing one package can silently remove a tool

I dropped a system-info tool called inxi that I didn't want. On the first live boot, lspci was gone too.

lspci comes from pciutils, and on my old system the only reason it was installed was as a dependency of inxi. Drop one and you lose the other, with no warning. Preflight didn't catch it because it only checked commands my own configs used.

The new rule: every program on my old system must be in the ISO or on a written list of deliberate drops, each with a reason. That check brought back seven tools I'd lost without noticing, including dig, tree and netcat.

Lesson 3: Order matters in systemd

A fresh install should create its SSH host keys on first boot. Mine didn't, so SSH refused to start.

I had added a systemd drop-in that runs ssh-keygen -A. But Debian's ssh.service already runs a config test, sshd -t, before starting, and that test fails when there are no host keys. My drop-in had added the key step after the test, so it never got a chance to run.

The fix was to clear the existing step and run them in the right order:

[Service]
ExecStartPre=
ExecStartPre=/usr/bin/ssh-keygen -A
ExecStartPre=/usr/sbin/sshd -t

The empty ExecStartPre= line is the trick: in a drop-in, it wipes the list before you add to it.

Lesson 4: An installer can fail halfway and leave a broken system

On an old Sony Vaio (AMD E-450, 3.4 GB of RAM), the install stopped partway through. The system booted, but it was badly broken:

  • the initramfs file (what the kernel needs to start the system) was 0 bytes
  • no package sources were set up, so apt had nowhere to install from
  • a speed setting the installer uses (dpkg "unsafe-io") was still switched on

All the setup steps after the failure point had never run, and the installer log was gone too. We never proved the cause; a power cut is my best guess.

The lesson wasn't about the Vaio. It was that an installer's last steps are the ones most likely to be skipped. Version 2 now has a small repair service that runs at boot, checks for exactly these leftovers and fixes them.

Lesson 5: The live desktop can fight the installer

Installing version 2 on a Toshiba Satellite L305 failed with "The installer failed to create partition on disk." The disk was fine.

The likely cause: the live desktop's file manager auto-mounted the new partition while Calamares was still working on it. Turning off automount in the live session, unmounting the partition and running the install again worked. If there's a version 3, automount gets switched off automatically before the installer starts.

Where it ended up

Version 2 was built on November 21, 2026. It boots live on a Dell OptiPlex in UEFI mode and installs on the Toshiba in BIOS mode. It runs every day on my HP laptop, which I converted in place from the old distro without reinstalling.

It's public on the Internet Archive, along with the build recipe:
https://archive.org/details/xiralinux-v2

What I'd tell anyone thinking about it

  • Debian's live-build needs to be re-run every time there's an issue - often taking up to 40 min each time. It's why I leaned on Claude Code in my terminal to catch things I'd surely miss myself. Once finished, it's satisfying. Most distros are a base system plus a package set, configs and an installer. That's a project you can finish.
  • Test on the oldest hardware you own. My best bugs came from a laptop that struggles to run a web browser. Not only do I enjoy saving machines that Microsoft deems 'obsolete' by installing a Linux OS, but those machines end up being valuable test boxes.
  • Write down every problem and its fix, and mark how sure you are. Many of my "causes" turned out to be guesses.
  • Automate your checks. Every bug in this article became a check that runs before the next build.

Building XiraLinux taught me more about how Linux actually starts up and installs than 15 years of simply using it. If you've ever thought about building your own distro, start with live-build and an old laptop. It's worth the journey!

Ben Santora - November 26 2026

Want more #linux-debian-distro-claude deep dives?

Join 6,047+ developers sharing real benchmarks, code breakdowns, and projects. Free forever.

More Posts

AAIF Hits 10 Projects. Its CTO on What to Adopt Now and the Security Gaps Left Open

Tom Smithverified - Oct 23

The Rowling-Galbraith Mystery: Testing Stylometry with Burrows’ Delta

nevmenandr - Oct 10

Make for Small Business: What It Is, What It Costs, and When to Use It

floxolab - Oct 23

Cisco's Amy Chang: A Model's "Passport" Doesn't Tell You Where It Actually Came From

Tom Smithverified - Aug 27

Your AI Agent Doesn't Need Your Token: Edera's Ariadne Conill on Object Capabilities

Tom Smithverified - Nov 5
chevron_left
130 Points • 6 Badges
Montserra MA
1Posts
3Comments
1Connections
Linux Tech - XiraLinux OS Distro - Linux Advocacy

Related Jobs

View all jobs →

Commenters (This Week)

1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!