A tool for distro hoppers

Tutorial – Ventoy

Author(s):

With Ventoy you can conveniently put multiple bootable ISO images on a single USB drive.

The Linux community teems with "distro hoppers," users who are always trying out new distributions. There is nothing at all wrong with that; we are always happy to discover new treasures in the Linux universe. Nevertheless, distro hopping can be hard work. Just downloading and transferring the ISO images to a USB memory stick takes time and involves risks. A simple typo in a command might cause you to move the image to the wrong place by mistake and accidentally delete important data.

Wouldn't it be far simpler if you could simply copy an ISO image off the web to a USB stick with a file manager and boot directly from the drive? Ideally, such a Linux USB memory stick would not only carry a distribution but even offer a selection of systems. For example, you could quickly demonstrate the differences between Ubuntu, Fedora, and Manjaro to a friend without having to prepare and carry around several USB drives. The Ventoy boot manager offers precisely this solution [1].

Installing Ventoy

Ventoy is available for both Linux and Windows. On Linux, however, the program is currently only available in Arch Linux and its Manjaro derivative. Ventoy is found in the Arch User Repository (AUR). To install, you will therefore need to use an AUR helper like Yay, where you load the program into your system by typing yay -S ventoy.

For other distributions, use the release packages provided by the developers [2]. To install, download the ventoy-<version>-linux.tar.gz archive from the project's GitHub page, unpack the tarball, and then run the ./Ventoy2Disk.sh command. Ventoy shows the structure of its syntax and an explanation of the individual parameters. Listing 1 shows the process for the 1.0.18 version, current at the time of writing.

Listing 1

Ventoy2Disk

$ tar xzf ventoy-1.0.18-linux.tar.gz
$ cd ventoy-1.0.18
$ ./Ventoy2Disk.sh
***********************************************************
*                Ventoy2Disk Script                       *
*             longpanda  admin@ventoy.net                 *
***********************************************************
Usage:  Ventoy2Disk.sh CMD [ OPTION ] /dev/sdX
  CMD:
   -i  install ventoy to sdX (fail if disk already installed with ventoy)
   -I  force install ventoy to sdX (no matter installed or not)
   -u  update ventoy in sdX
  OPTION: (optional)
   -r SIZE_MB  preserve some space at the bottom of the disk (only for install)
   -s          enable secure boot support (default is disabled)
   -g          use GPT partition style, default is MBR (only for install)

Preparing a USB Memory Stick

Even with Ventoy, you can't avoid formatting a USB memory stick, hard disk, or SSD. However, you only need to perform the operation once. Plug the Ventoy USB drive into the computer and use lsblk or graphical tools such as the Gnome desktop disk manager (Figure 1) to discover the device ID of the Ventoy USB memory stick. Listing 2 shows the lsblk output in a terminal window. The correct device ID can be found using the information on the size of the disk in the fourth column.

Figure 1: You can discover the USB memory stick's device ID to be written to at the command line with lsblk or, as shown here, with the Gnome desktop disk manager.

Listing 2

lsblk Output

$ lsblk
NAME     MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda        8:0    0 232,9G  0 disk
|-sda1     8:1    0 232,9G  0 part /home
[...]
sdc        8:32   1   7,5G  0 disk
|-sdc1     8:33   1   256M  0 part /run/media/toff/boot
|-sdc2     8:34   1   7,2G  0 part /run/media/toff/rootfs
[...]
$ sudo ./Ventoy2Disk.sh -i /dev/sdc

Armed with this information, then change back in the terminal to the folder in which you unpacked Ventoy. When you get there, call the program with root privileges (Listing 2, last line). Pass in the -i (install) option and the device ID of the USB drive. To be on the safe side, Ventoy displays the most important information again, such as the device name and the size of the selected data carrier (Figure 2). In this way you can quickly see whether you accidentally specified a hard disk that is normally used for backups.

Figure 2: The command-line tool Ventoy2Disk.sh lets you format a USB memory stick with Ventoy. Afterwards you only need to copy the ISO images to be booted onto the stick.

The Ventoy installation routine now automatically partitions the disk. A small partition is used by the boot manager to start the system; you cannot and never should change anything here. The program searches for ISO images on the partition labeled ventoy and formatted with exFAT. It does not matter how you organize the images there. You can move the ISO files directly into the root folder or organize them in subfolders. The only conditions are that the file names can only contain ASCII characters and spaces can't be used.

Both the developers and the Ventoy community are constantly testing current distributions for compatibility [3]. A wide range of older and recent distros has already been tested, from Debian, Ubuntu, and Fedora through to more exotic candidates such as Zorin, ArcoLinux, and Untangle. The project also supports booting from Windows images and FreeBSD-based systems, including pfSense, GhostBSD, and FreeNAS (see also the box "Secure Boot").

Secure Boot

As of version 1.0.07, Ventoy also supports booting on computers where the Secure Boot mechanism is activated. When formatting the Ventoy USB memory stick, you need to use the -s option to do this:

$ sudo ./Ventoy2Disk.sh -s -i /dev/sd<X>

You also need to import the shim UEFI key when you first boot from the Ventoy stick. In the documentation, the developers explain the process, but also recommend disabling Secure Boot in UEFI in case of problems [4].

Booting with Ventoy

To boot a Linux distribution with Ventoy, download its ISO image off the web and copy it to the Ventoy partition. This works on Linux as well as on macOS or Windows, because Ventoy uses exFAT for the data partition. You do not need special rights or special programs; a file manager is fine. After the copy process is complete, remove the USB memory stick from the prep computer and boot the target computer with it. Like with any normal Linux image, you need to be sure to boot from the USB drive. Usually you change the boot medium in the UEFI/BIOS or via a boot menu, which can often be enabled by pressing Esc or F12.

Once Ventoy has booted, you now have the option to boot the images copied to the data partition yourself (Figure 3). Use the up and down arrow keys to navigate in the menu, and press Enter to launch the selected image. Ventoy displays all images found on the data partition on one level. If necessary, you can press F3 to enable a tree view. Use Enter to select directories or Esc to move up one level. The menu is updated automatically during the next boot process if you copy more ISO images to the partition or delete existing ones.

Figure 3: Ventoy in use: We simply used the file manager to copy the Linux images to the Ventoy partition on the USB memory stick.

Updates and Persistence

If you repeat the installation routine, the Ventoy2Disk script will abort with the message that Ventoy is already installed on the USB stick. However, by using the switches -u and -I (i.e., say, sudo ./Ventoy2Disk.sh -u /dev/sd<X>), Ventoy gives you the option of updating Ventoy on the USB stick (-u, preserving the images) or completely reformatting the stick with Ventoy and deleting all data (-I).

Ventoy can also be extended to include additional functions thanks to a plugin system. For example, the program supports the installation of your own themes to change the look or the contents of the boot manager [5]. Since Ventoy itself is based on GRUB 2, there is a wide selection on the web [6]. Further plugins allow the integration of logos, titles instead of file names in the menus, and the ability to add descriptions. You can also automate the installation process for operating systems with your own scripts (Kickstart for RHEL or Fedora, Preseed for Debian or Ubuntu, AutoYaST for SUSE).

The Persistence plugin is also interesting; it lets users define a separate image file as nonvolatile memory [7]. This means that you can work with a distribution you booted started as a Live system as if it were permanently installed on the system. All data and settings are kept on restarting. The distributions tested for this operating mode include Ubuntu, Linux Mint, elementary OS, and Zorin. Persistence images are either created with the CreatePersistentImg.sh script, or you can download a prepared image from the project website.

To configure the plugins, you first need to create a ventoy/ subfolder on the Ventoy stick's data partition or create a file there named ventoy.json. Then enter the desired settings in line with the specifications in the documentation. The example in Listing 3 activates the Tela theme [8], which I copied to ventoy/theme/tela/, defines aliases for the three Linux ISOs stored on the stick, and defines nonvolatile memory for the Ubuntu image (Figure 4). The root folder of the USB memory stick acts as the root for all paths. If a configuration does not work, the error can be analyzed using Ventoy's debug mode, which you enable by pressing F5.

Listing 3

Tela Theme

{
  "theme": {
    "file": "/ventoy/theme/tela/theme.txt",
    "gfxmode": "1920x1080"
  },
  "menu_alias": [
    {
      "image": "/images/ubuntu-20.04-desktop-amd64.iso",
      "alias": "Ubuntu 20.04 LTS"
    },
    {
      "image": "/images/tahr64-6.0.5.iso",
      "alias": "Puppy Linux: Tahrpup64 6.0.5"
    },
    {
      "image": "/images/manjaro-gnome-20.0.3-minimal-200606-linux56.iso",
      "alias": "Manjaro Gnome 20.0.3 Minimal"
    }
  ],
  "persistence": [
     {
       "image": "/images/ubuntu-20.04-desktop-amd64.iso",
       "backend": "/persistence/ubuntu-20.04-desktop-amd64.img"
     }
  ]
}
Figure 4: Ventoy with the Tela GRUB theme courtesy of Gnome-look.org and aliases for the Linux images on the USB memory stick.

Conclusions

Ventoy proves to be an extremely practical tool for users who frequently try out new distributions. A USB memory stick, once equipped with a boot manager, removes the need to "burn" images in the future. To boot a new distribution, you simply move the ISO file there using your choice of file manager. This saves time, can also be done on Windows, and reduces the risk of accidentally overwriting a disk. This makes Ventoy ideal for sharing your favorite new distributions. For example, you could present a colorful bouquet of distributions to the participants at an installation party.