Booting ISO with rEFInd

2025-05-18

Unfortunately rEFInd can’t boot an ISO file directly. We need to prepare a separate partition and dd the ISO to it (replace sdXY with your actual partition):

# dd if=void-live-x86_64-musl-20250202-xfce.iso of=/dev/sdXY bs=100k

I mount my esp at /efi. My rEFInd configuration is located at /efi/EFI/refind/refind.conf and contains:

log_level 5
scanfor external,internal,optical,manual
  • log_level more logging for easier debugging
  • scanfor what kind of devices to search for bootloaders

See rEFInd configuration for all options.

It may already work without any further configuration. However, depending on the ISO structure, rEFInd might not find anything to load automatically—or at all.

Let rEFInd find bootloaders on the ISO

1. Driver for the filesystem

REFInd needs a driver for the ISO-9660 filesystem. Copy the file drivers_x64/iso9660_x64.efi (replace x64 with your architecture) from your rEFInd download into the drivers_x64 folder of rEFInd on your ESP partition if it isn’t already there. For example:

# cp /usr/share/refind/drivers_x64/iso9660_x64.efi /efi/EFI/refind/drivers_x64

After reboot you should see it mentioned in refind.log:

'EFI\refind\drivers_x64\iso9660_x64.efi' is a valid loader file

2. Location of bootloader

REFind can read the filesystem, but the bootloaders may be in paths it does not scan by default (/ and boot). Mount the ISO partition. These are the files that rEFInd can see. If there is an .efi file, rEFInd should be able to find it, if you tell it where to look.

# mkdir /mnt/iso
# mount /dev/sdXY /mnt/iso

Specify additional paths in refind.conf:

also_scan_dirs +,iso:/path/to/scan
  • + means “in addition” to already scanned paths
  • iso is the partition label

After reboot, check refind.log for:

Beginning to scan directory 'path\to\scan' for '*.efi,*.EFI,vmlinuz*,bzImage*,kernel*'

If rEFInd finds something and it boots — great!

If it finds something but it does not boot, the issue might be (as with the void ISO used here) that the actual bootloader is inside a compressed image (boot/grub/efiboot.img), which rEFInd cannot read. Instead, it may find and try to boot the kernel (thanks to EFI boot stub), but the kernel expects to be passed boot options from another bootloader (like grub), without them it may complains and fails. For example:

dracut Warning: dracut: FATAL: No or empty root= argument

Define menu entry

Pass kernel options by defining a menu entry in refind.conf:

menuentry "void live" {
    volume iso
    loader /boot/vmlinuz
    initrd /boot/initrd
    options "root=live:CDLABEL=VOID_LIVE ro init=/sbin/init rd.luks=0 rd.md=0 rd.dm=0 loglevel=4 gpt add_efi_memmap vconsole.unicode=1 vconsole.keymap=us locale.LANG=en_US.UTF-8  rd.live.overlay.overlayfs=1 "
}

Ensure manual is included in scanfor. You do not need also_scan_dirs here, since the paths are specified directly. The options used above were copied from /boot/grub/grub_void.cfg on the ISO.

Edit the ISO

Another way to pass options to kernel requires editing the ISO. REFInd can pass boot parameters from a refind_linux.conf file located in the same directory as the kernel image. To create this file, we need to copy the iso files to a writable location, edit them, rebuild the ISO and dd it back to the partition.

Mount the ISO partition, copy its contents to empty directory, then unmount.

# mount /dev/sdXY /mnt/iso
# cp -r /mnt/iso/* workdir/
# umount /mnt/iso/

Create refind_linux.conf in the same folder as kernel image (e.g. /mnt/iso/boot) with contents:

"VOID_LIVE"	"root=live:CDLABEL=VOID_LIVE ro init=/sbin/init rd.luks=0 rd.md=0 rd.dm=0 loglevel=4 gpt add_efi_memmap vconsole.unicode=1 vconsole.keymap=us locale.LANG=en_US.UTF-8  rd.live.overlay.overlayfs=1"

You can add multiple lines with different options. I also removed the boot/grub and boot/isolinux folders since they are not needed in this setup.

To recreate the ISO, refer to how your distro builds its live images, e.g.: https://github.com/void-linux/void-mklive/blob/master/mklive.sh

Install xorriso and use it. Then use dd to write the .iso file back to the ISO partition.

# xbps-install xorriso
# xorriso -as mkisofs -o modified.iso -volid VOID_LIVE  workdir/
# dd if=modified.iso of=/dev/sdXY bs=100k

It actually works!

Or extract bootloader from the ISO

If rEFInd cannot find a boatloader on the ISO, you can extract it and place it somewhere rEFind can access - such as your ESP.

In this case, rEFInd does not need the ISO-9660 driver.

Mount the ISO partition:

# mount /dev/sdXY /mnt/iso

Locate and mount the EFI image (rEFInd is not able to do this):

# mkdir /mnt/iso_efi
# mount -o loop /mnt/iso/boot/grub/efiboot.img /mnt/iso_efi

Make a directory on your ESP and copy the bootloader there:

# mkdir /efi/EFI/iso
# cp /mnt/iso_efi/EFI/BOOT/BOOTX64.EFI /efi/EFI/iso/

REFInd should detect it automatically, since it searches folders on the ESP. If you put is elsewhere, use also_scan_dirs to point to that path or define a manual entry, both in refind.conf:

menuentry "void live" {
    loader /EFI/iso/BOOTX64.EFI
}