2 Answers
2

To create a bootable file use the following script. You may have to modify some paths (i.e. the user name in the last line and the path to Install OS X El Capitan.app (and the inner InstallESD.dmg file) in the 6th line):

Great stuff! Thank you! Do you happen to know what is the appropriate storage space to reserve for this VB? According to support.apple.com/kb/SP728?locale=en_US it's 8.8GB. I reserved 30GB and I am still getting an error "There is not enough free space on OS X Base System to install"
– sanjihanApr 5 '16 at 7:09

@sanjihan Thanks – this question and your other question link above helped me with installing El Capitan in VirtualBox on OS X. Also, this page was of help with some problems along the way, including if conversion fails (force eject and run that hdutil convert line again) and black screen on boot (change the motherboard chipset to PIIX3 if you have increased RAM from 2 Gb).
– WinterflagsSep 8 '16 at 8:14

That first line in the script fails for me with Sierra. Error is: hdiutil: attach failed - No such file or directory. I know the path to the InstallESD.dmg is correct because I dragged-and-dropped from the Finder to the Terminal. What is /Volumes/esd? Should I have created a volume? My line: hdiutil attach "/Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg" -noverify -nobrowse -mountpoint /Volumes/esd
– Basil BourqueOct 31 '16 at 0:08

I tested klanomoath's accepted answer to this question using a Mac mini (2018) running macOS Catalina Version 10.15.4. I needed to make the following changes.

I downloaded InstallMacOSX.dmg from the Apple website How to upgrade to OS X El Capitan. The file was placed in my Downloads folder. After downloading, the file needs to be opened with the Finder Application.