Create a USB stick with multiple Linux install images using Ventoy

Last edited on 2024-06-30 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 stick to hold multiple Linux install images and continue to operate as a typical USB storage device for files. Simply copy Linux install *.iso images to the USB stick like any other file, 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 the USB stick

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

Plugin a USB stick.

Download the latest release of ventoy-VERSION-linux.tar.gz and sha256.txt.

Verify:

$ $ sha256sum -c --ignore-missing sha256.txt
ventoy-1.0.99-linux.tar.gz: OK

Unpack:

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

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 Optional: Reserve disk space

If using a USB stick 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:

{
    "control": [
        { "VTOY_DEFAULT_MENU_MODE": "0" },
        { "VTOY_DEFAULT_SEARCH_ROOT": "/iso" }
    ],
    
    "theme": {
        "display_mode": "CLI"
    },
    
    "menu_alias": [
        {
            "image": "/iso/debian-12.6.0-amd64-netinst.iso",
            "alias": "Debian 12.6.0 amd64-netinst"
        },
        {
            "image": "/iso/debian-live-12.6.0-amd64-standard.iso",
            "alias": "Debian Live 12.6.0 amd64-netinst"
        },
        {
            "image": "/iso/lmde-6-cinnamon-64bit.iso",
            "alias": "Linux Mint Debian Edition 6"
        },
        {
            "image": "/iso/mt86plus_7.00_64.iso",
            "alias": "Memtest86+ v7 (64bit)"
        }
    ]
}

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

You can like, share, or comment on this post on Mastodon 💬

Thanks for reading! Read other posts?

» Next: Install FreeBSD 14.1 (Short and Sweet Version)

« Previous: Rename photos automatically using Python and Cron