macos – Create a Bootable ISO (DVD) image from a directory

Spread the love


I am attempting to create a custom FreeBSD bootable ISO to be used to create VirtualBox headless VMs. I have to make a small change in the /boot/loader.conf file to allow FreeBSD to output messages to the serial port (UART) and not to the display.

I can create this image in FreeBSD with no problem. I can boot the image in VirtualBox using the serial console as expected. The command that I use on my FreeBSD laptop is:

 $ mkisofs -v -b boot/cdboot -no-emul-boot -r -J -V "Headless_Installer" 
    -o Headless_Installer.iso /path/to/headless-iso

The parameters are as follows:

  • -v → Verbose output (not critical)
  • -b → El Torito Boot Image. This is the path where the boot image is located
  • no-emul-boot → No hard or floppy drive boot emulation
  • r → Generate SUSP and RR records to describe files on Joliet file system
  • -J → Generate Joliet directory records
  • -V → Volume ID. This is a 32 char. string
  • -o → outputfile. This is the Installer.iso image
  • /path/to/headless-iso → directory of files to create the ISO

When I try to do the same thing on macOS using hdiutil, it fails to boot. It creates the ISO with no errors but the VM will not boot the ISO image. Here’s the relevant command I use:

% hdihdiutil makehybrid -o Installer.iso  
  -iso -Joliet 
  -no-emul-boot 
  -eltorito-boot boot/cdboot 
  -default-volume-name "Headless_Installer"  FreeBSD-13.1-Headless-iso-dir

Other than the option that generates the SUSP and RR records, these options match the options above. I’ve looked at Create Iso from directory as it was the closet in relevance to my question, but it’s not about a bootable image.

Does anyone know what the issue is why I can’t create a bootable ISO on macOS?

Author: Dhanraj7978

Leave a Reply

Your email address will not be published. Required fields are marked *