We produce a kiosk image for deploying our systems and take a different approach. It is a cut-down Ubuntu image that is maintained in a VM (VirtualBox) but we actually produce an ISO instead. This has the advantage that it can be installed in any VM or on a physical system.
The steps involved are:
- Remove unnecessary packages from a basic Ubuntu install.
- Whenever it has been updated make sure to clean up the package downloads with “sudo apt-get clean”.
- Shutdown the VM and then run a backup script on the host.
a. Mount the virtual disk.
b. Archive the contents (excluding proc, sys, mnt, media and dev) using something like tar.bz2.
c. Create an ISO using a minimalist OS designed to run from CD (we use ploplinux).
It is relatively straightforward to customise something like ploplinux to boot straight into an install script that will create a partition, extract the image archive and update grub.
The ISO is created using mkisofs found in the genisoimage package.
With this method we are able to produce ISO images that are around 260MB in size. Our systems are designed to run headless and therefore the image does not contain a desktop environment which greatly helps to reduce the size.
The ISO can then be burnt to CD, used to create a bootable USB stick or mounted directly within a fresh VM of your choosing.
I’m not saying that you necessarily should do it in the same way, but hopefully our approach might give you some ideas.
EDIT: Also bear in mind that the kernel and associated packages are quite big, so make sure that all but the latest kernel have been purged from the image before archiving.