Create a multiboot Linux USB installer with Ventoy

Last updated on 2022-09-06 Tagged under  #linux 

When I want to try out a Linux distro on a physical machine, I download the iso installer file, flash it to a USB drive using the dd command, and away I go. New distro, download, wipe USB, flash, repeat.

But a friend told me about a better way, and its name is Ventoy.

What it does is configure a USB drive to be a multiboot installer. Simply copy Linux installer .iso images to the USB, reboot, and the auto-generated menu lists all the images available to boot. You can also press F2 to directly browse and boot files on the drive.

1. Install to USB

Plugin a USB drive. Download the latest release of ventoy-VERSION-linux.tar.gz and unpack.

Note: All contents currently on the USB drive will be completely wiped during the install.

Change into the unpacked Ventoy directory and run script to install to the USB drive (example: /dev/sdX) ...

$ cd ventoy-VERSION/
$ sudo sh Ventoy2Disk.sh -i /dev/sdX

After the installation is complete, the USB will be divided into 2 partitions.

First partition is formatted with the exFAT filesystem. Copy iso files to this partition and place them anywhere. Ventoy will search all the directories and subdirectories recursively to find all the image files and list them in the boot menu alphabetically. When not using the USB as a boot installer, it will serve as a normal storage device.

Second partition is a small dedicated space for the Ventoy tools and is reserved for its use.

1.1 Reserve disk space

If using a USB drive with plenty of space, rather than use all of it in a single partition, there is an option to reserve disk space and leave it free for later use.

Example: Configure a 128GB USB drive and set aside 32GB as reserved space ...

$ sudo sh Ventoy2Disk.sh -i -r 32000 /dev/sdX

Note: Keeping the first partition sized less than 137GB also avoids potential legacy BIOS issues on some machines.

2. Plugins

After install, Ventoy can be customized with various plugins. These are snippets of code written in a ventoy.json file that is placed inside a ventoy directory created on the first partition of the Ventoy drive

Example: My own ventoy.json ...

{
    "control": [
        { "VTOY_DEFAULT_MENU_MODE": "0" },
        { "VTOY_DEFAULT_SEARCH_ROOT": "/iso" }
    ],
    
    "theme": {
        "display_mode": "CLI"
    },
    
    "menu_alias": [
        {
            "image": "/iso/firmware-11.4.0-amd64-netinst.iso",
            "alias": "Debian 11.4 Firmware-netinst"
        },
        {
            "image": "/iso/linuxmint-21-cinnamon-64bit.iso",
            "alias": "Linux Mint 21 Cinnamon"
        }
    ]
}

3. Update

Updating to a new version of Ventoy is non-destructive. All the files in the first partition will be unchanged.

Download the latest version as before, and run ...

$ sudo sh Ventoy2Disk.sh -u /dev/sdX
Thanks for reading! Read other posts?

» Later: Build a custom kernel package for Debian

« Earlier: Install Linux Mint 21 with custom LVM on LUKS