2

I have a Macbook that runs Catalina OS, but I would like to have a VirtualBox version of it.

I was able to successfully download Catalina from the App Store, and followed a tutorial to convert it into an .iso image. The problem now is that whenever I try to launch it in VirtualBox all I see is the UEFI Interactive Shell v2.2

The shell displays a Mapping Table and it just hangs there waiting for a command.

  • The problem is that VirtualBox doesn't support booting from APFS (yet) – Allan Feb 17 at 4:39
  • It's a VBox problem. I have the same problem with High Sierra with APFS. However, if I use FAT and JHFS+, I can get it to work. I found a link on the VBox forums that confirmed that it wasn't supported but there is a support ticket. Here's one of the threads: forums.virtualbox.org/viewtopic.php?t=88258&start=15 – Allan Feb 17 at 4:44
  • When you mention the file system formats, you're talking about the .iso that is used in creating the virtual OS? The tutorial I followed used this command ` hdiutil create -o /tmp/Catalina -size 8500m -volname Catalina -layout SPUD -fs HFS+J` -- so I think the file system remained as HFS. – Matthew Lerner Feb 17 at 4:51
  • They're HFS on the ISO (I'm assuming since I didn't see you install it), but I'm not referring to your install media. Catalina won't install/boot in VirtualBox because the drive you create will be APFS. it won't work. – Allan Feb 17 at 4:54
  • macOS Catalina works in VMware Fusion. – user3439894 Feb 17 at 5:16
2

The command you mention in your comments hdiutil create -o /tmp/Catalina -size 8500m -volname Catalina -layout SPUD -fs HFS+J appears to come from this tutorial which in full does this:

Note: I have increased the size of the /tmp/Catalina.dmg from 8500m to 9000m so it is big enough to fit 10.15.4 (previous versions worked fine). If the .dmg is too small the subsequent createinstallmedia command will fail with "Error erasing disk error number (22, 0)"

Note: I have increased the size of the /tmp/Catalina.dmg from 9000m to 9500m so it is big enough to fit 10.15.5.

hdiutil create -o /tmp/Catalina -size 9500m -volname Catalina -layout SPUD -fs HFS+J
hdiutil attach /tmp/Catalina.dmg -noverify -mountpoint /Volumes/Catalina
sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia --volume /Volumes/Catalina --nointeraction
hdiutil detach /volumes/Install\ macOS\ Catalina
hdiutil convert /tmp/Catalina.dmg -format UDTO -o ~/Desktop/Catalina.cdr
mv ~/Desktop/Catalina.cdr ~/Desktop/Catalina.iso

These steps work absolutely fine to create an ISO but you have 2 issues which are resolved in VirtualBox 6.1.4 - from the changelog

Virtualization core: Fixed macOS Catalina guests failing to boot after upgrading to 10.15.2 onwards (bug #19188)


For versions of VirtualBox prior to 6.1.4 the following steps are required:

You must tell VirtualBox what to boot

The ISO produced will work fine with VirtualBox but will not run automatically as Apple have put boot.efi in a non-standard place. Unlike a real mac the firmware doesn't know where to look.

In the EFI shell, if you enter FS0:\System\Library\Coreservices\boot.efi (it may be FS1:, FS2: &c depending on the order of your virtual disks) it will run. This can be automated by putting the command in a startup.nsh script which in fact is contained in the VirtualBox Boot.vdmk mentioned in the tutorial.

If you would rather create your own than download from a random google drive you can do it like this:

hdiutil create -o /tmp/CatalinaBoot -size 50m -volname MACOS_BOOT -fs FAT32
hdiutil attach /tmp/CatalinaBoot.dmg -noverify -mountpoint /Volumes/CatalinaBoot
echo 'FS0:\System\Library\Coreservices\\boot.efi' > /Volumes/CatalinaBoot/startup.nsh
echo 'FS1:\System\Library\Coreservices\\boot.efi' >> /Volumes/CatalinaBoot/startup.nsh
echo 'FS2:\System\Library\Coreservices\\boot.efi' >> /Volumes/CatalinaBoot/startup.nsh
echo 'FS3:\System\Library\Coreservices\\boot.efi' >> /Volumes/CatalinaBoot/startup.nsh
echo 'FS4:\System\Library\Coreservices\\boot.efi' >> /Volumes/CatalinaBoot/startup.nsh
hdiutil detach /Volumes/CatalinaBoot
VBoxManage convertfromraw --format VDI /tmp/CatalinaBoot.dmg ~/Desktop/CatalinaBoot.vdi

Attach the created CatalinaBoot.vdi disk first in your VM and it will automatically run the boot.efi from the ISO created as they describe.

Note when I tested it on VirtualBox 6.1.2 the ISO generated by the tutorial would fail when using a SATA controller giving the error: "BdsDxe: loading Boot0001 “UEFI VBOX CD-ROM VB1-1a2b3c4d ”". When connected to an IDE controller it worked fine.


VirtualBox 6.1.2 will not run Catalina 10.15.2 and later guests

Virtualbox 6.1.0 added support for booting APFS. Unfortunately there is a problem if you do not have 10.15.1 version of Install macOS Catalina.app.

There is a bug in VirtualBox which is exposed by 10.15.2 and later versions of boot.efi. See this VirtualBox forum thread Catalina 10.15.2 does not start. As mentioned in the relevant VirtualBox Ticket #19188

The source of the boot hangs has been identified, although fixing it correctly isn't entirely trivial. It's triggered by a very, very old problem in VirtualBox. <snip> At any rate it will be fixed for the next maintenance release.

If you want to run a macOS 10.15.2 or later guest (on any VirtualBox 6.0.2 host) you must use boot.efi from Catalina 10.15.1 or Mojave. You could do this yourself following the steps in the VirtualBox forum thread or use this script on GitHub macos-guest-virtualbox

As 10.15.1 is no longer available on Apple servers you may need to download and unpack Mojave to get boot.efi and then copy this first to unpacked Catalina installer and then afterwards to Catalina itself. As they say in their linked workaround

The real easy way to run Catalina is to use the script to install Mojave on VirtualBox and then run it in VMWare and upgrade it to Catalina.

| improve this answer | |
  • 1
    I downloaded the latest Catalina (macOS 10.15.4). When running the command sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia --volume /Volumes/Catalina --nointeraction, I get the error message Error erasing disk error number (22, 0) followed by An error occurred erasing the disk.. Any thoughts? – David Anderson Apr 8 at 19:19
  • 1
    How did the Catalina.dmg become a Catalina.sparseimage? That has to be an error. – David Anderson Apr 8 at 22:00
  • 1
    @Makmeksam: I did not replace boot.efi. I installed the VM directly from the iso that was created using the instructions in the first part of the answer. When I first started the VM, I received a popup similar to this image. If you get a similar popup, then click on the Cancel button. – David Anderson Apr 9 at 2:51
  • 1
    @Makmeksam: To install Catalina, I used the defaults for a High Sierra installation, except for the following: 1) 4096 MB memory size; 2) 200 GB drive size; 3) 2 processors; 4) 128 MB video memory; 5) Catalina.iso in the virtual optical drive. AFAIK, the use of the iso file is the only change that is required. – David Anderson Apr 9 at 3:07
  • 1
    @DavidAnderson - Ticket 19188 was fixed in VirtualBox 6.1.4. I've updated the answer to say later steps no longer required. – lx07 Apr 9 at 5:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .