| Itjih Sjamsul Nursalim |
| TheLadders |
| ReputationDefender |

First of all, we are going to remove non-english language pack, and in order to free some more space, we are going to remove gnome-games packages.
# apt-get remove --purge gnome-games*
# apt-get remove --purge `dpkg-query -W --showformat='${Package}\n' | grep language-pack | egrep -v '\-en'`
Mind that you might want to remove some other software. In order to see installed software, you can run the following:
# dpkg-query -W --showformat='${Package}\n' | less
Now that we have remove softwares we do not need, we can update our /etc/apt/sources.list in order to enable universe and multiverse repository along with gutsy-updates, gutsy-security and the partner repository so we can install vmware-server.
Open and edit /etc/apt/sources.list
# vim /etc/apt/sources.list
and make it look like:
deb http://archive.ubuntu.com/ubuntu gutsy main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu gutsy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu gutsy-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu gutsy-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu gutsy-security main restricted universe multiverse
deb-src http://security.ubuntu.com/ubuntu gutsy-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu gutsy partner
deb-src http://archive.canonical.com/ubuntu gutsy partner
Now we can update the image by running:
# apt-get update
# apt-get dist-upgrade
Let install all multimedia packages that we might need. As per http://www.debuntu.org/how-to-play-dvd-under-ubuntu-linux, we need to install:
# apt-get install gstreamer0.10-ffmpeg gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse vlc mplayer mplayer-fonts
# /usr/share/doc/libdvdread3/install-css.sh
Then, let install RealPlayer:
# wget http://www.debian-multimedia.org/pool/main/r/realplay/realplayer_10.0.9-0.1_i386.deb -O /tmp/realplay.deb
# dpkg -i /tmp/realplay.deb
Now, let's install some utils that are not included by default on Ubuntu live cd but become handy most of the time:
# apt-get install rar unrar unace-nonfree
Plus, let's install some wireless network utils so we might be able to get wireless functionning with the live CD:
# apt-get install ndiswrapper-common ndiswrapper-utils-1.9 cabextract unshield \
bcm43xx-fwcutter \
kismet aircrack-ng
Let's add some other network network utility tools:
# apt-get install wireshark nmap ettercap traceroute
Also, we are going to add some firefox plugins:
# apt-get install flashplugin-nonfree mozilla-plugin-vlc
On the top of this, I want to be able to use skype and vmware-server:
# apt-get install libqt4-core libqt4-gui
# wget http://skype.com/go/getskype-linux-ubuntu -O /tmp/skype.deb
# dpkg -i /tmp/skype.deb
# apt-get install vmware-server
Well, that's about it, we now have whatever software that we (I) will need when using our live CD.
It is now about time to do some clean up.
When we install packages, apt caches the packages, we will need to remove them in order to save some space:
# apt-get clean
Also, there is some files in /tmp that need to be removed:
# rm -rf /tmp/*
Before chrooting, we have added 2 files: /etc/hosts and /etc/resolv.conf, let remove them:
# rm -f /etc/hosts /etc/resolv.conf
Finally, we are ready to exit the chroot and repack the CD. We need first to umount /proc and /sys:
# umount /proc/
# umount /sys/
# exit
Finally, we are back to our host, as we have modified some packages, we need to rebuild some manifest files, recreate the squashfs and recreate the ISO.
Fisrt, lets recreate the manifest files:
$ chmod +w ~/livecd/cd/casper/filesystem.manifest
$ sudo chroot ~/livecd/custom dpkg-query -W --showformat='${Package} ${Version}\n' > ~/livecd/cd/casper/filesystem.manifest
sudo cp ~/livecd/cd/casper/filesystem.manifest ~/livecd/cd/casper/filesystem.manifest-desktop
And regenerate the squashfs file:
$ sudo mksquashfs ~/livecd/custom ~/livecd/cd/casper/filesystem.squashfs
Parallel mksquashfs: Using 2 processors
Creating little endian 3.0 filesystem on ~/livecd/cd/casper/filesystem.squashfs, block size 65536.
....
....
Now, alternatively, you might want to customize the file: ~/livecd/cd/README.diskdefines
and finally, update ~/livecd/cd/md5sum.txt which contains the files in ~/livecd/cd md5 sums:
$ sudo rm ~/livecd/cd/md5sum.txt
$ sudo -s
# (cd ~/livecd/cd && find . -type f -print0 | xargs -0 md5sum > md5sum.txt)
We are now almost done, the last thing left is too create the ISO with the following command:
$ cd ~/livecd/cd
$ sudo mkisofs -r -V "Ubuntu-Live-Custom" -b isolinux/isolinux.bin -c isolinux/boot.cat -cache-inodes -J -l -no-emul-boot -boot-load-size 4 -boot-info-table -o ~/Desktop/Ubuntu-Live-7.10-custom.iso .
Here you go, you can now test your image by either booting your computer with or by using a virtualization/emulation software such as qemu, kvm, vmware.....
With a bit of work, one can customize an Ubuntu Live CD in order to remove/include some softwares, make sure the live CD is up-to-date, and on the top of this, allow administrator to deploy pre-customized Ubuntu distros.
error creating iso image
Hi Chantra,
I need your help. I stucked at the last step.
When i type: sudo mkisofs -r -V "Ubuntu-Live-Custom" -b isolinux/isolinux.bin -c isolinux/boot.cat -cache-inodes -J -l -no-emul-boot -boot-load-size 4 -boot-info-table -o ~/Desktop/Ubuntu-Live-7.10-custom.iso
I get the following error:
"I: -input-charset not specified, using utf-8 (detected in locale settings)
genisoimage: Missing pathspec.
Usage: genisoimage [options] -o file directory ...
Use genisoimage -help
to get a list of valid options.
Report problems to debburn-devel@lists.alioth.debian.org."
I am using Ubuntu Jaunty alpha 4 version, and tried to customize a 8.10 Ubuntu.
Thanks in advance for your help!
Nandorka
You need to include...
The trailing dot. If you type it in the way you have it, then you get that error, but if you include the trailing dot the code works.
no internet access in chroot environment
All commands worked fine until
where it wasn't able to resolve the internet addresses. I'm also not able to
within the chroot environment, but it works in another tab without chroot in my terminal.
What do I have to do?
edit (solution):
e.g. $IP_OF_DNS_SERVER = 213.162.69.170
edit:
Somehow I must have forgotten the last command of step 1, sorry.
Removal of Ubiquity (Ubuntu installer)
In the above instructions, I see the following command:
sudo cp ~/livecd/cd/casper/filesystem.manifest ~/livecd/cd/casper/filesystem.manifest-desktopWhich basically copies the filesystem manifest to the desktop manifest. What these manifests do is say which packages should and should not be installed when Ubuntu is installed to the hard drive.
If you compare these two files from the original Ubuntu CD, you'll notice that they are different. The difference between them is that the filesystem.manifest contains a list of all packages installed on the CD. But filesystem.manifest-desktop contains all these packages _except_ for ones related to the installer.
So filesystem.manifest-desktop won't contain ubiquity, and some other minor things.
The Ubuntu installers uses these files to determine which packages to uninstall while installing Ubuntu. If these files are the same, then the Ubuntu installer won't be removed when Ubuntu installed, resulting in an "Install" icon on the desktop, even when booting off the hard drive.
So make sure you check the differences between the files, and make the necessary adjustments manually.
Live
Awesome guide!
Will try again.
Using a Kubuntu Hardy disk, I wound up with a 25 mb iso!!! Disappointing, but nothing ever works for me on the first try.
Perhaps you can help me with the customizations I have in mind. I didn't see anything that directly related.
I want to run kde applications with Fluxbox, and insert my own custom fluxbox files. The files are all in one directory that sits in the home directory ~/.fluxbox. Is there a way to add files directly to ~ for the live cd user?
And is there a way to make the disk boot with fluxbox by default? (I guess I could try fluxbuntu, install KDE, and make it a DVD.)
/etc/skel
Adding the content of .fluxbox in /etc/skel should resolve your issue.
When the user is created, those files are copied to its home dir.
This is how the examples link ends in your homedir when installing ubuntu.
Debuntu
In case anyone else is as clueless as I was
I'm going to be more specific.
I finally got this done by copying the file to ~/livecd/custom/etc/skel
I made a point of doing this just before starting the chroot, but I don't know for sure if that was necessary.
I think you could have covered /etc/skel better, but overall this tutorial is beyond awesome. I say this as someone who has been looking for the perfect Live CD remastering method. There are a lot of tutorials out there that say it's not possible to use apt-get to install to the chroot directly from the online repos. You have to use apt-get to download the deb packages, and install them in a seperate step with dpkg. Well, apparently, they're wrong!
I'm wondering what it would take to apply this method to live CDs other than Ubuntu. Is there any reason why this will or will not work with Knoppix, Kanotix, or Sidux? I love my new Kubuntu based live CD, but the Ubuntu live CDs are really intended as trial/installation tools, and I think they tend to run slower than Knoppix, which is intended as a tool, and a live CD for live CD's sake.
cloop against squashfs
Distros like knoppix uses "cloop" filesystem, while ubuntu uses squashfs, so they might be different method.
Even though I believe the overall process is quite the same.
Debuntu
I have a better question
Suppose I have a hard drive with a base Debian system... Let's say it's Lenny. Just the base, nothing added. Let's just put aside the fact that it's not a live CD, there are applications for that. What would I need to add to the base system in order for this method to work. Will I find it in the Lenny repos, or will I have to go elsewhere?
debian live project?
I guess you are looking for http://debian-live.alioth.debian.org/ :)
Debuntu
Well, I haven't given up on
Well, I haven't given up on Ubuntu yet, but my first successful live CD is painfully slow, so I know that I can't can't just hack my modified Fluxbox onto a Kubuntu system. I'll have to try something different. I think I'll try to use remastersys to turn a barebones Ubuntu server system into a Live CD, and then if that works I can build up for there. Thanks for all your help so far, and quite possibly into the future.
Well, once again, that
Well, once again, that didn't work the first time I tried it. I think I need to understand how chroot works a lot better than I do. However, I have managed to produce a working live cd with all of the applications I installed (fluxbox, feh, firefox, the non-free flash plugin.) Every day, I attempt another remaster.
I think that the reason that I did so much better was that I added 5 gigabytes of swap to the /tmp directory, like so:
$ sudo dd if=/dev/zero of=/tmp/swap bs=1M count=5000
$ sudo mkswap /tmp/swap
$ sudo swapon /tmp/swap
I think this is probably essential for anyone who wants to remaster a live CD without a really great computer. When I reinstalled my system today, I deliberately created a huge / directory-- 35 GBs, with a seperate /home directory, my /tmp can be as big as I want it to be.
My advice to anyone who, like me, is new at remastering, and has an ambitious idea for a linux distro, is not to try to make all the changes at once. You can remaster the disk several times, making small changes as you go.
Inidentally, using Kubuntu 8.04, I gained all the disk space I needed by removing openoffice.org, and replacing it with Abiword.