Creating A LiveCD From An Existing Debian Installation Or VM

So you want to create a customized LiveCD from your already setup Linux installation or Virtual Machine (VM)? Easy task right? The answer is between yes and no - there are tools that work bugfree, tools that used to work and tools that work for simple LiveCD creation.

A few of the requirements I had for a LiveCD were:

  • Created from a relatively complex and fully configured system
  • Includes an installer
  • Maintains user information

Here are the steps I used to create a LiveCD of a Debian 6.04 VM that was already configured using Refracta (Yes this is part of a distribution, but the tools can be used for Debian!).

Adding the Refracta Installer:

If you don't require the installer - skip this step. This section will add an installer that will install the content of the LiveCD onto your hard drive.

I also used bleachbit to remove any extraneous files from being included in the image. Run bleachbit as root and whatever non-root user you have installed. Uncheck memory, localization, free disk space and broken desktop links.

  1. sudo apt-get install bleachbit
  2. sudo bleachbit

Moving on...

  1. Make sure the dependencies were installed: rsync sed grep coreutils e2fsprogs  mount  util-linux grub-pc grub-legacy
  2. sudo apt-get install gparted (they forgot this one)
  3. sudo dpkg -i refractainstaller-base_9.0.4_all.deb
  4. sudo dpkg -i refractainstaller-gui_9.0.4_all.deb

By default, the menu item under Applications > System Tools > Refracta Installer breaks because it is using xfce4-terminal. This is easy to change, but you can test it by running:

sudo gksu 'gnome-terminal -e /usr/bin/refractainstaller-gui'

Later you can edit the Gnome Menu Item by going to System > Preferences > Main Menu and hunting down the Refracta Installer item.

Creating the LiveCD ISO:

This section will create a snapshot LiveCD of your filesystem which can be used and distributed for use on other computers.

  1. Install prerequisites: squashfs-tools genisoimage gawklive-boot live-config syslinux
  2. Install base package (I used refractainstaller-base_9.0.2-2_all.deb)
  3. Install GUI package (Again I used refractasnapshot-gui_9.0.2-4_all.deb)
  4. sudo refractasnapshot-gui

Then your image and a MD5sum is located in /home/snapshot

Finally Test Test Test:

Load it up in a VM or burn a disk and boot.

More Information:

For additional information, look at:
http://www.ibiblio.org/refracta/release_notes.txt
http://refracta.freeforums.org/

Comments

Default terminal in refractainstaller

Refracta Installer 9.0.5 and later shouldn't have a problem with gnome-terminal. The Exec line in /usr/share/applications/refractainstaller.desktop was changed to:
gksu 'x-terminal-emulator -e /usr/bin/refractainstaller-gui'

There are some other changes to make the installer and the snapshot tool work better with other desktops and with other debian-based distros.

How do I add Debians default installer instead of refracta

Hello, thanks for this tutorial, because, I was searching for an entire week on "how to convert my hdd installation into an iso" , but never have found a result. Today, while googling, I found this, and is interesting.

But, I have a question. Can we replace refracta installer with Debian's default installer ?

debian live installer

If you prefer the debian installer, you can install the debian-installer-launcher package before you create your live iso with refractasnapshot. Below is the official description of the package. I haven't tried it, so I'm not sure how much of your setup and configuration it preserves. Refractainstaller and refractasnapshot will copy any changes you've made to your system, your desktop and your personal files, with a few necessary exceptions. Reviewing the excludes file before you make the snapshot is recommended, especially if you have a lot of files.

-----
Description: Debian Installer desktop launcher
This is a desktop launcher for Debian Installer images. It is intended to be used on Debian Live systems.

You probably do not want to install this package onto a non-live system, although it will do no harm.
-----

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.