Create Your Own Live Linux Distro

Creating your own custom Live Linux distro and resulting ISO file is not too complicated. However, there are many different approaches depending mainly on which Linux base you decide to use. Many popular Linux distributions such as Knoppix, Ubuntu and DSL are based on Debian. So in the following tutorial, we are going to focus on using Debian as our base to create a Live Linux ISO. The image can then be burned to a USB or CD.

From a locally installed up and running Debian operating environment, we will use a tool called Live-Helper. Which was originally part of the Debian Live Project created by Daniel Baumann. Live-Helper contains scripts that automate parts of the Live Linux creation process, making it easy to create your own personal Live Linux distribution.

Downloading and installing Live-Helper

1. Open a terminal and type the following, and then press Enter.

sudo gedit /etc/apt/sources.list

Add the following line to the sources list, and then save the file.

deb http://live.debian.net/debian/ etch main

2. Back at the terminal, type

sudo apt-get update
sudo apt-get install debian-unofficial-archive-keyring
sudo apt-get install live-helper

Configuring settings for your Live CD

1. Login as root and open a terminal (must be done as root user)
2. From the terminal, type

 lh_config

Now we can edit the configuration files that have been created in (root’s Home) debian-live/config/ directory

  • Open debian-live/config/chroot, Set the interactive parameter LIVE_INTERACTIVE=”enabled” (this allows you to chroot to the filesystem and make changes before it is compressed)
  • You should also set the live package to install. For example: LIVE_PACKAGES_LISTS=”gnome” (will install the gnome desktop)
  • Save changes and close the chroot file

USB IMG Option: To create a USB Image instead of an ISO file, open debian-live/config/binary and change the image type parameter from iso to usb-hdd LIVE_BINARY_IMAGES=”usb-hdd”

Create Your Own Live Linux Distribution ISO

Now that we have finished making a couple of basic configuration changes, we can proceed with the build process.

1. Back at the terminal (to move us to the debian-live directory, where our live distro is going to be built), type

 cd debian-live

2. Now (to start the build process based on our live configuration settings), type

 lh_build

During the build process, live-helper will create a directory named chroot containing the Linux filesystem that will later be compressed. Once live-helper has finished installing the core components, it will start an interactive shell (change root directory to chroot) pausing the build and allow you to install additional packages and make changes or adjustments before it compresses the filesystem and builds the final Live Linux ISO.

3. Back at the terminal, when the script responds with the following:
Pausing build: starting interactive shell…

  • make your changes, if any and then type exit to allow live-helper to continue.

Testing the Live Linux Distribution you created

Once live-helper has finished, you will find your completed ISO in the debian-live directory.

Burning ISO to a CD

1. Burn the ISO to a CD or DVD

2. Test your newly created distribution by restarting from the CD/DVD.

Or Write IMG to USB

1. From the terminal, type

 fdisk -l

and then locate your USB device. Example: dev/sdx (where x represents your flash drive).

2. Now to write the IMG to a USB drive, type

 dd if=binary.img of=/dev/sdx

3. Finally, restart your PC. Enter your BIOS or Boot Menu during startup. Then, select your USB as the first boot device. And reboot.

You should now be booting from your custom Live USB.

Note: With your CD or USB build, you can save your changes back to a drive via the persistent feature. Simply create a partition on the device labeled casper-rw and type live persistent at boot to enable saving and restoring of settings/changes.

Example: mkfs.ext2 -L casper-rw /dev/sdx2

As is also shown in the How to Install Ubuntu Linux ISO on USB with a secondary persistent partition tutorial.