Create a customized Ubuntu Live USB [duplicate]

Solution 1:

Create a custom .iso

Graphical way to customize a clean iso (recommended)

  1. Install the latest Ubuntu Builder from here
  2. Choose "Select ISO > From local disk"
  3. Choose 'Synaptic' to customize packages or 'Desktop' to run easily a VM with the ISO to make changes
  4. Click 'Build ISO' to save your customized ISO somewhere

Guide here

To customize a clean .iso from the command line

  1. You can use the 'Ubuntu Customization Kit' which can be installed like this:

    sudo apt-get install uck
    
  2. Launch it from the dash

  3. Follow the instructions
  4. Eventually, you will be given an option to run the console of the iso to install/remove packages and make customizations

You will need a pre downloaded ISO to be the base for your customizations

(source)

To create a copy of your existing Ubuntu installation

You can use the tool System Imager, available from here

System Imager is a tool that images your running system and allows you to make a image of your running machine and install it on another. System Imager is based on the work of Remastersys.

This is probably easier if you aren't familiar with the command line. It'll be easier to make customizations

To test the ISO without writing to USB

  1. Install qemu with

    sudo apt-get install qemu
    
  2. Run it with the command

    qemu -cdrom /path/to/your/.iso -boot d -m 256
    

Finally

To write the iso to a USB and make it non persistent

  1. Run "Startup Disk Creator" from the Dash
  2. Choose your .iso and target USB drive
  3. Set "documents and settings" option to "discarded on shutdown"

NOTE: This is only non persistent when booting from the USB, not in the final installed system

Solution 2:

Look at this, live-build contains the scripts that build a Debian Live system image from a configuration directory.

# apt-get install live-build

# mkdir -p /usr/src/live

# cd /usr/src/live

# lb clean

# echo "Configure:"

# lb config noauto \
        --bootappend-live toram \
        --package-lists minimal \
        --package aufs-util \
        --linux-flavours clean \
        --binary-images usb-hdd \
        --bootloader grub \
        --verbose

# echo "Building..."
# lb build --verbose