I am building a custom iso using xorriso in mkisofs mode. The build seems correct, inspecting the iso afterwards shows 2 boot images (1 BIOS, 2 UEFI), yet booting to the ISO from qemu using the OVMF firmware fails to find any bootable media.

If I try the exact same boot in qemu but using a clean downloaded ubuntu 16.04 server iso, it boots without a problem.

If I use BIOS (not UEFI), both boot just fine.

xorriso command:

xorriso -as mkisofs \
   -l -J -R -V version \
   -no-emul-boot -boot-load-size 4 -boot-info-table \
   -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \
   -isohybrid-mbr isohhdpfx.bin \
   -eltorito-alt-boot -e EFI/BOOT/BOOTX64.EFI -no-emul-boot \
   -isohybrid-gpt-basdat \
   -o testos.iso ./cddir/

The details of examining the 2 iso (ubuntu and my custom built one) with xorriso -report_el_torito plain and cmd are in the following gist https://gist.github.com/deitch/e069268f92402d6a2b1c7e060ddba622

  • The program mkisofs does not have an option called -e. If you like to create a EFI boot, you would need to use -eltorito-platform EFI. .... Just in case you believe that xorriso implents the mkisofs behavior. There are more deviations, like the built in -findand UDF support in mkisofs that is missing from xorrise. – schily Jul 9 '18 at 11:54

Thank you for flying xorriso.

The problem is in the image file which you let xorriso mark as EFI System Partition. It is supposed to be a FAT filesystem image which contains a binary file named /EFI/BOOT/BOOTX64.EFI (or .../BOOTIA32.EFI for 32 bit x86) plus possibly other files. Mount the file /boot/grub/efi.img from the Ubuntu ISO for learning about its content.

The FAT filesystems used by Ubuntu and others are probably produced by GRUB2 program grub-mkimage. ISOLINUX/SYSLINUX EFI software cannot be used because it bails out when seeing a CD-ROM device.

A quite convenient way to get a bootable ISO is program grub-mkrescue. If GRUB2 is configured for BIOS and EFI (e.g. by installing binary packages grub-pc, grub-efi-amd64, and grub-efi-ia32) then grub-mkrescue will produce an ISO which boots on BIOS and EFI of 32 bit and 64 bit x86 machines: El Torito boot images for BIOS and EFI, EFI image having BOOTX64.EFI and BOOTIA32.EFI, MBR for BIOS from hard disk, GPT for EFI from hard disk.

| improve this answer | |
  • And I knew it! I knew it had to be not the EFI file, but the EFI file bound up in a single file vfat img... and completely forgot. Thank you, @ThomasSchmit! – deitch May 18 '16 at 8:11
  • And another problem; kernel options not being passed. They really did make this whole thing too hard! See unix.stackexchange.com/questions/283994/… – deitch May 18 '16 at 17:29
  • @GAD3R thanks for the updates. grub-mkrescue isn't relevant here, since I am working on a custom install iso. – deitch May 18 '16 at 17:30
  • FWIW, the kernel options was a grub2 bug. – deitch Jun 3 '16 at 9:02

A very easy way to do it is this:

Append efi.img (from ubuntu ISO at boot/grub/efi.img) to your ISO and it will boot in every system.

cat efi.img >> youriso.iso

After that your ISO will work both as cdrom and as USB pendrive. :D

| improve this answer | |
  • Seriously? It cannot be that simple. Why would I need to use xorriso with the complex options? – deitch Nov 30 '16 at 8:57
  • did you try it?! – Zibri Dec 27 '16 at 11:58
  • I didn't have the chance, but I will. It still boggles my mind that it can be that simple. – deitch Dec 31 '16 at 16:54
  • So is the simple method working ? – Overmind Feb 1 '17 at 12:22
  • Didn't work here. – Dominic Hayes Jul 12 '18 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.