Difference between revisions of "Custom Live USB"

From Organic Design wiki
m (Ventoy: Better formatting.)
m (= Manually Configure Ventoy: Fix title.)
Line 54: Line 54:
 
Once that is done reboot and choose the ISO from the menu then choose  the '''with persistence''' option.
 
Once that is done reboot and choose the ISO from the menu then choose  the '''with persistence''' option.
  
==== Manually Configure Ventoy ===
+
==== Manually Configure Ventoy ====
 
Instead of using the VentoyPlugson UI you can manually configure Ventoy to use the persistent storage file.
 
Instead of using the VentoyPlugson UI you can manually configure Ventoy to use the persistent storage file.
  

Revision as of 23:47, 30 January 2022

Custom ISO

It can be useful to customize an image to preinstall packages or pre-configure settings so that when the image gets live booted those packages are already installed and usable.

Ubuntu

CUBIC (Custom UBuntu Iso Creator) is a easy tool for customizing Ubuntu based distribution images such as Mint. The process gives you a virtual shell and you can install packages and configure the OS as you normally would, after doing this CUBIC packages it back up into an ISO. There appears to be many advanced options but for reinstalling applications and pre-saving data it is straight forward.

Debian

Looks like live-build is an option for customizing Debian ISOs but this method looks more difficult that CUBIC.

Multi ISO USB

Ventoy is a great tool if you would like to have multiple bootable ISOs on a single USB drive. Ventoy is fairly easy to use since it has a few scripts to handle things for you.

Ventoy Usage

  1. Download Ventoy from its releases.
  2. Run the the appropriate (for your architecture) Ventoy GUI program.
  3. Select your USB drive and flash it with the Ventoy software.
  4. Unplug and replug your USB drive.
  5. Copy any ISOs you like onto the drive (probably labeled "Ventoy").
  6. Boot into your usb and select the ISO you would like to boot from the menu.

Persistent Storage

Live images will not normally persist storage which can really limit their use-case, however there seems to be some options for solving this.

Partitioning/File

It seems possible for Ubuntu (and Debian?) distributions to persist storage through partitions or a file. It looks like if you partition your USB that has the ISO formatted on it with partitions labeled casper-rw and home-rw Ubuntu will detect these and use them as persistent storage. Alternatively it appears you can create a loopback file in the root directory that will be used as well, this file must be named casper-rw.

Ventoy

Ventoy has a plugin that allows you to use a persistent storage file for storing your data and this storage can be configured to be used across the images that support it's format.

Plug your Ventoy USB in and open a terminal and cd into your USB directory.


Run:

# Note: this will create the persistent file in whatever directory you run it so ensure you are in the mounted USB.
sudo /PATH/TO/VENTOY/CreatePersistentImg.sh -s <SIZE_IN_MB>

After that finishes change to your Ventoy installation directory and run:

# Note this script won't work if you are not in the right directory.
./VentoyPlugson.sh /YOUR/USB/MOUNT # e.g. /dev/sdb

Open your browser and navigate to http://127.0.0.1:24681 and configure the plugin by:

  1. Click Persistence Plugin on the left.
  2. Click Add down the bottom right.
  3. Fill the File Path with the path of your ISO inside the Ventoy USB.
  4. Fill the Dat Path with the path of the generated persistence file inside the Ventoy USB.


Once that is done reboot and choose the ISO from the menu then choose the with persistence option.

Manually Configure Ventoy

Instead of using the VentoyPlugson UI you can manually configure Ventoy to use the persistent storage file.

  1. Create the folder called ventoy in the root of your Ventoy USB if it doesn't already exist.
  2. Edit or create a file in there called ventoy.json.
  3. Modify the file to include the following JSON:
{
    "persistence":[
        {
            "image": "/YOUR_IMAGE_NAME.iso",
            "backend":[
                "/persistence.dat"
            ]
        }
    ]
}