Create a multiboot Linux USB installer with Ventoy

Last edited on 2023-07-29 Tagged under  #ventoy   #linux 

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

But there is 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 stick. Download the latest release of ventoy-VERSION-linux.tar.gz and unpack ...

$ tar xvf ventoy-VERSION-linux.tar.gz

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 stick (example: /dev/sdX) ...

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

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

  • Partition #1 - 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 *.iso files and list them in the boot menu alphabetically. When not using the USB stick as a boot installer, this partition can be used as a typical storage device.
  • Partition #2 - A small space reserved for the Ventoy tools.

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 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 to a ventoy.json file.

On the first partition of the Ventoy USB stick, create a directory named ventoy and place ventoy.json inside that directory.

Example: My own ventoy.json ...

{
    "control": [
        { "VTOY_DEFAULT_MENU_MODE": "0" },
        { "VTOY_DEFAULT_SEARCH_ROOT": "/iso" }
    ],
    
    "theme": {
        "display_mode": "CLI"
    },
    
    "menu_alias": [
        {
            "image": "/iso/debian-12.1.0-amd64-netinst.iso",
            "alias": "Debian 12.1.0 amd64-netinst"
        },
        {
            "image": "/iso/lmde-5-cinnamon-64bit.iso",
            "alias": "Linux Mint Debian Edition 5"
        },
        {
            "image": "/iso/mt86plus_6.20_64.iso",
            "alias": "Memtest86+ v6.20"
        },
        {
            "image": "/iso/systemrescue-10.01-amd64.iso",
            "alias": "SystemRescue 10.01 amd64 "
        }
    ]
}

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 - with the Ventoy USB stick unmounted - run ...

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

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

« Previous: #24. Embedded Linux in Space