Create Your Own Live Linux CD or USB distribution
Creating your own custom Live Linux CD or USB distribution is not complicated. However, there are many different approaches depending mainly on which Linux base you decide to use. Many popular Linux distro's such as Knoppix, Ubuntu and DSL are based on Debian so for the following tutorial, we are going to focus on the simple creation of a Live Linux CD using Debian Linux as our base.
From a Debian installed operating environment, we will use a tool called Live-Helper which was created by Daniel Baumann as a part of the Debian Live project. Live-Helper contains scripts that automate parts of the Live Linux CD or USB creation process, making it easy to create your own personal Live Linux CD or USB distribution.
Downloading and installing Live-Helper:
1. Open a terminal and type sudo gedit /etc/apt/sources.list
Add deb http://live.debian.net/debian/ etch main to the list and save the file.
2. Back at the terminal, type sudo apt-get update
3. Type sudo apt-get install debian-unofficial-archive-keyring
4. Type sudo apt-get install live-helper
Configuring the settings for your Debian based 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
Note: To create a USB Image instead of an ISO, open debian-live/config/binary and change the image type parameter from iso to usb-hdd LIVE_BINARY_IMAGES="usb-hdd"
Building the Debian based Live Linux ISO or IMG:
Now that we have made a couple of basic configuration changes we can proceed with the build process.
1. Back at the terminal type cd debian-live (moves us to debian-live, where our live distro is going to be built)
2. Type lh_build (starts the build process based on our live configuration settings)
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. 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.
Burn the ISO and test your new creation:
Once live-helper has finished, you'll find your completed ISO in the debian-live directory.
1. Burn the ISO to a CD or DVD
2. Test your new creation by rebooting from the CD/DVD.
Or to Copy the IMG to the USB device:
1. From the terminal type fdisk -l and locate your USB device. Example: dev/sdX (where X represents your USB device)
2. Type dd if=binary.img of=/dev/sdX
3. Reboot your PC, booting from the USB device
Note: With your CD/DVD or USB build, you can save your changes back to a USB device 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 Ubuntu tutorial!