Mojave on VirtualBox 6.1 Linux

update 03.03.2020 Please use the latest VirtualBox 6.1.4 (works also for Catalina 10.15.2 >)

With the major release of VirtualBox 6.1 came the support to APFS which was problematic before especially for virtualizing macOS Mojave or Catalina. I have realized this is a major improvement and decided to post yet another macOS Movaje installation procedure under VirtualBox 6.1 and Linux x86_64.

The Changelog for VirtualBox 6.1 is here https://www.virtualbox.org/wiki/Changelog-6.1  and lurking at the end is the small note which matters

EFI: Added support for booting from APFS 

So lets move on and do a quick recap of what needs to be done. We need to get macOS Mojave obviously in an ISO format first onto our Linux machine, there are several methods how to do this (macOS is available for free from App-store ) but you need a macOS to do this or you can use an ISO created for this especially. Here is a good source how to do this http://osxdaily.com/2018/09/29/download-full-macos-mojave-installer/

Or you can get a working copy here https://gofile.io/?c=sjlJRS

We create the Mojave VirtualBox template and name it Mojave, make sure to set the following

  • RAM > 2048 MB
  • 2 CPUs minimum
  • Chipset – ICH9
  • Pointing Device – USB Tablet
  • Display 128 MB Video Memory + Enable 3d acceleration
  • Storage – Mojave.iso
  • Network (I use Host-only-Adapter  vboxnet0)
  • USB – USB 3.0 xHCI

Network – vboxnet0

  • Networking scripts needed for TCP/IP if we use vboxnet0 under VirtualBox 6.1
  • apt-get install  uml-utilities bridge-utils
  • IMPORTANT  – load this script as root only after you run VirtualBox so that the vboxnet0 gets created, next time when you reboot either make sure this is automated or keep in mind that you need to first stat VirtualBox console, then run the below script as root for the vboxnet0 network to be ready.
# Typical networking script used along with VirtualBox 
# Where the internet connected interface is the Wireless wlan0 
# This can of course be customized to ones needs 
# This script needs to be executed prior the simulator start as root 

tunctl -t tap0 -u user
ifconfig tap0 up
brctl addbr br0
brctl setfd br0 0
ifconfig br0 10.0.2.2 netmask 255.255.255.0 broadcast 10.0.2.255 up
brctl addif br0 tap0  
ifconfig tap0 0.0.0.0
sysctl net.ipv4.ip_forward=1
iptables --table nat -A POSTROUTING --out-interface wlan0 -j MASQUERADE

Once you are done, before booting Mojave, save the below scripts on your system and execute them, change the $NAME variable to whatever you have called Mojave in VirtualBox and choose the VM_RES value to use (it cannot be changed in the VM)

1680×1050 resolution preset script to be executed once we create the VM Mojave template

#!/bin/bash
readonly VM_RES="1680x1050"
readonly NAME="Mojave"

VBoxManage modifyvm "$NAME" --usbxhci on --firmware efi --chipset ich9 --mouse usbtablet --keyboard usb
VBoxManage setextradata "$NAME" "CustomVideoMode1" "${VM_RES}x32"
VBoxManage setextradata "$NAME" VBoxInternal2/EfiGraphicsResolution "$VM_RES"
VBoxManage modifyvm "$NAME" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata "$NAME" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata "$NAME" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "$NAME" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "$NAME" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "$NAME" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1

1280×1024 resolution preset script to be executed once we create the VM Mojave template

#!/bin/bash
readonly VM_RES="1280x1024"
readonly NAME="Mojave"

VBoxManage modifyvm "$NAME" --usbxhci on --firmware efi --chipset ich9 --mouse usbtablet --keyboard usb
VBoxManage setextradata "$NAME" "CustomVideoMode1" "${VM_RES}x32"
VBoxManage setextradata "$NAME" VBoxInternal2/EfiGraphicsResolution "$VM_RES"
VBoxManage modifyvm "$NAME" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata "$NAME" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata "$NAME" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "$NAME" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "$NAME" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "$NAME" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC"

Next its pretty straight forward, boot Mojave, load Disk Utility, Erase the VM HDD and let the installer run, this time VirtualBox has no issues with EFI APFS boot, so no Clover.iso needed :)

Setup network – since I don’t run DHCPd in my virtual networks I choose the  manual IP configuration. I have used for the Mojave en0 the following values

  • IP 10.0.2.12
  • Netmask 255.255.255.0
  • Gateway 10.0.2.2
  • DNS 8.8.8.8

disable Apple telemetry (location services and usage statistics during setup) and we are ready to start testing :) Do not upgrade to Catalina if you want to use Mojave  (Upgrade to Catalina  works, but you need to run the latest VirtualBox 6.1.4 for Catalina 10.15.2 and above to boot) , however the normal system/software updates for Mojave work fine

Then system will reboot (takes some time, so be patient) ; all is smooth now and no need to switch between EFI shells anymore !

Reboot one more time, this time longer estimated time to finish

And after about 30 minutes (SSD drive)  the fresh Mojave updated comes up

Here is Catalina 10.15.2

About astr0baby

Please run Adblock or similar... we have been told to do so since Carl Sagan wrote the Contact .
Gallery | This entry was posted in Uncategorized. Bookmark the permalink.

19 Responses to Mojave on VirtualBox 6.1 Linux

  1. Zakary says:

    I am having issues downloading the Mojave.iso, You provided this link https://gofile.io/?c=sjlJRS, everytime i tried download its say am not authorized to download the file. please me with that. thanks

  2. DEcho says:

    Is there no vmdk, or all ready configured virtualbox “image” one can download and add to virtualbox 6.1 for Linux Mint??

  3. DrFAlbrecht says:

    Catalina 15.0 rsp. 15.1 are installable ond bootable

  4. Pingback: Mojave on VirtualBox 6.1 | 0ddn1x: tricks with *nix

  5. I have the Mojave iso here! I have just re-uploaded it to MEGA for quick download:
    https://mega.nz/#F!KGZDgIZQ!Nct0_zq5-LABTtFDo1hTjQ

  6. REM REM says:

    NS_ERROR_FAILURE (0x80004005)

    Any idea ? I followed the step

  7. DrFAlbrecht says:

    with virtualbox 6.1.4 catalina 10.15.x works propper

  8. nekojet says:

    Thanks for this (and the great Pinebook Pro stuff your doing)! I got Catalina 10.15.3 working in VirtualBox 6.1.4 on Pop!_OS and Fedora. A couple of questions: Is there any gain to be had by setting the System | Acceleration to KVM (instead of Default)? And, since VirtualBox generates random MAC addresses, is it safe to use my Apple ID in the VM without Apple blocking it? Thanks!

    • astr0baby says:

      I have only used a separate AppleID for any tests with AppleStore during the virtualization, so I cannot really tell if its safe or not to use your real one :)

  9. alordiel says:

    Hi, I’m stuck at the installation of the Mojave. For few hours the installer is stating ‘About 16 minutes remaining’. I’m running VirtualBox 6.1.6 and Linux Manjaro (linux-kerner 5.4.35). The only thing that I made differently in configuring the VM was that for network type I left the default option. Do you have any hints on what I might try differently? Thank you.

  10. alordiel says:

    Ok, so this time it worked. I guess the problem was space. As the only thing I changed was the storage from 30GB to 45GB. Thanks once again for the good post.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.