Howto: make your own Linux LiveCD
Posted by Aapo Rantalainen on April 16, 2010
I made my own Linux Distribution. Truly speaking I just made my own customized Ubuntu Live CD.
Use Case: I’m working with Linux application and I want show it to users who are not using Linux.
One approach is use virtualised Linux, but what virtualization system to use: VirtualBox, VMware, qemu? I made LIVE cd image, which can be used with any virtualization system or it can burned to CD or copied to bootable USB-stick.
Environment
My problem is that my application uses graphics and audio. And it contains lot of data files (more than 300M).
I used VirtualBox and remastersys. So I first install and configure whole system inside VirtualBox and then made ISO-image with remastersys.
I decided to star with Karmic (Ubuntu 9.10) mini netboot installation cd.
wget http://archive.ubuntu.com/ubuntu/dists/karmic/main/installer-i386/current/images/netboot/mini.iso
And then made ‘command line install’. It was easy installation, I just pressed enter in every question.
Graphical -X
Then I have base command line running. First task was install Xorg (graphical).
I decided to use openbox, so I can get start menu.
sudo apt-get install openbox xserver-xorg xinit
This took 90M of space.
Autologin
Actuallu LIVE cd has always autologin, but I wanted start X on start.
So I added in file /etc/bash.bashrc
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty1 ]; then
startx
fi
Xterm
Because I was working inside Virtualbox (there are hard to achieve virtual console (e.g.ALT-CTRL-F2)), I install also xterm.
sudo apt-get install xterm sudo touch /usr/bin/xrdb sudo chmod a+x /usr/bin/xrdb
Xterm gives error if xrdb is not founded.
Start menu
Openbox handles startmenu via file /etc/xdg/openbox/menu.xml
It is very straighforward to throw useless stuff away and add one new entry.
Sounds
This was harder part. Normally sounds are handled via desktop environment.
This is minimal what is needed to use audio:
sudo apt-get install linux-sound-base alsa-base alsa-utils
User must belong to group ‘audio’ to use audio. This was tricky, because nothing I change for this user will not go to LIVE-cd.
I added to file /etc/rc.loca (before exit 0)
adduser custom audio
(I knew my LIVE user will be ‘custom’)
For some mysterious reason sound doesn’t work very well. I decided to install pulseaudio too.
sudo apt-get install pulseaudio pavucontrol
And /etc/xdg/autostart.sh
pulseaudio -D
Normally login manager is handling this, but we do not have login manager at all.
Simple way to test audio
arecord > tmpfile aplay < tmpfle
Use CTRL+c to break recording.
Changing volume and unmuting
Use both alsamixer (command line) and pavucontrol (graphical) to check that audio is unmuted.
Own customization
This is the reason why I’m doing LIVE cd.
sudo apt-get install python-software-properties sudo add-apt-repository ppa:aapo-rantalainen/jammo-stable-ubuntu sudo apt-get update sudo apt-get install jammo
It has lot’s of data and some dependencies and it uses 485M.
Remastersys
This is not only tool to make LIVE-cd, but this is easy and it fetch all needed dependencies sametime.
echo 'deb http://www.geekconnection.org/remastersys/repository karmic/' | sudo tee -a /etc/apt/sources.list sudo apt-get update sudo apt-get install remastersys
This will add 55M to disk usage.
Making disk
There are config files in /etc/remastersys.conf and /etc/remastersys/isolinux/isolinux.cfg
First contains username and hostname, latter contains start up menu and timeout for it. I set TIMEOUT=1 and empty isolinux.txt.
Then run:
sudo remastersys dist
Copy ISO out of VirtualBox and run
sudo remastersys clean
Result
If you want test my LIVE cd, read section “Live CD containing JamMo” on http://jammo.garage.maemo.org/download.html