Create a multiboot USB installer with Ventoy

Last updated on 2021-06-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 setup a USB drive to be a multiboot installer. Simply copy however many iso files to the USB, reboot, and the auto-generated menu lists all the disk images available to boot.

Let's go!

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

Plugin a USB drive. Download and unpack the latest release.

There are graphical installers available for both Windows and Linux. Or, using the commandline, change into the unpacked Ventoy directory and run the installer script ...

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

... where sdX is the ID of your USB drive.

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

First partition is formated with the exFAT filesystem (which you can reformat manually if desired to NTFS/FAT32/UDF/XFS/Ext2/3/4). 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, the partition continues to be available as a storage device.

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

If using a USB storage device 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 256GB USB stick with a GPT partition table, and set aside 200GB as reserved space ...

$ sudo sh Ventoy2Disk.sh -i -g -r 200000 /dev/sdb

Keeping the first partition sized <137GB also avoids potential legacy BIOS issues on some machines.

After install, Ventoy can be customized with various plugins. These are snippets of code placed in a ventoy.json file inside a ventoy/ directory which you have the option to create on the first partition.

Example: My own ventoy.json ...

{
    "control": [
        { "VTOY_DEFAULT_MENU_MODE": "0" },
        { "VTOY_DEFAULT_SEARCH_ROOT": "/iso" },
        { "VTOY_DEFAULT_KBD_LAYOUT": "QWERTY_USA" }
    ],

    "theme": {
        "display_mode": "CLI"
    },

    "menu_alias": [
        {
            "image": "/iso/archlinux-2021.06.01-x86_64.iso",
            "alias": "Arch 21.06.01"
        },
        {
            "image": "/iso/firmware-10.9.0-amd64-netinst.iso",
            "alias": "Debian 10.9 Buster"
        },
        {
            "image": "/iso/firmware-testing-amd64-netinst.iso",
            "alias": "Debian 11 Bullseye (weekly build 05.31)"
        },
        {
            "image": "/iso/linuxmint-20.1-cinnamon-64bit.iso",
            "alias": "Linux Mint 20.1 Cinnamon"
        },
        {
            "image": "/iso/linuxmint-20.1-cinnamon-64bit-edge.iso",
            "alias": "Linux Mint 20.1 Cinnamon Edge (for newer machines)"
        },        
        {
            "image": "/iso/ubuntu-20.04.2-live-server-amd64.iso",
            "alias": "Ubuntu 20.04.2 Server"
        }
    ]
}

Good stuff!


» Later: Remotely unlock a LUKS-encrypted Linux server using Dropbear

« Earlier: Rearrange LVM after installing Linux Mint