Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Install macOS on VirtualBox: Step-by-Step

· 7 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you can install macOS on Oracle VirtualBox, but only on a host machine that already runs macOS or on a PC with an Intel processor and specific hardware support (AMD CPUs are not officially supported by macOS, so the installer may fail). This guide walks you through creating a virtual machine, preparing the installer, and booting macOS in VirtualBox. You’ll need a macOS installer file (downloaded from the App Store or a recovery partition), a USB drive (8 GB or larger), and VirtualBox installed on your host.

What You'll Need

  • Oracle VirtualBox (latest version) installed on your host machine.
  • A macOS installer (e.g., macOS Catalina, Big Sur, or Monterey) downloaded from the App Store or a recovery partition.
  • A USB drive (8 GB or larger) to create a bootable installer, if you’re installing from a real Mac.
  • An Intel-based host PC (AMD is not officially supported; you may need extra kernel flags, but success is not guaranteed).
  • At least 8 GB of RAM and 40 GB of free disk space for the virtual machine.

Step-by-Step

  1. Download the macOS installer. On a real Mac, open the App Store, search for the macOS version you want (e.g., “Catalina”), and click “Get” to download the installer. It will appear in the /Applications folder as “Install macOS Catalina.app”. If you’re on a PC, you can download a recovery image from Apple’s official sources (like the “InstallAssistant.pkg” from Apple’s servers) – but note that Apple’s End User License Agreement only permits running macOS on Apple hardware, so this is technically against the license terms. Proceed at your own discretion.
  2. Create a bootable USB installer (optional but recommended). On a Mac, insert your USB drive, open Disk Utility, format it as “Mac OS Extended (Journaled)” with GUID Partition Map. Then in Terminal, run: sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume (replace the app name and volume name accordingly). This creates a bootable installer. For a PC, you can use a tool like “macOS Unlocker” or “gibMacOS” to download and build a bootable ISO – but again, this is unofficial and may violate Apple’s license.
  3. Prepare VirtualBox. Open VirtualBox and click “New”. Name the VM “macOS”, set Type to “Mac OS X”, Version to “macOS 10.15” (or closest to your installer). Allocate at least 4 GB of RAM (8 GB recommended) and create a virtual hard disk of at least 40 GB (VDI format, dynamically allocated).
  4. Enable EFI and disable audio (for some versions). After creating the VM, select it and click “Settings”. Go to “System” > “Motherboard” and check “Enable EFI (special OSes only)”. Under “Processor”, enable “Enable PAE/NX”. For audio, go to “Audio” and set “Enable Audio” to off – this avoids a common kernel panic in some macOS versions. (Labels may differ slightly by VirtualBox version.)
  5. Run the VirtualBox configuration commands. Open a terminal/command prompt on your host and run the following commands (replace “macOS” with your VM name):
    VBoxManage modifyvm "macOS" --cpuidset 00000001 000306a9 04100800 7fbae3ff bfebfbff
    VBoxManage setextradata "macOS" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "MacBookPro11,3"
    VBoxManage setextradata "macOS" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
    VBoxManage setextradata "macOS" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Mac-2BD1B31983A16602"
    VBoxManage setextradata "macOS" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
    VBoxManage setextradata "macOS" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
    These commands spoof hardware identifiers so macOS thinks it’s running on genuine Apple hardware. (If you’re on Windows, use the same commands without the backslashes before quotes.)
  6. Mount the installer ISO or USB. In the VM settings, go to “Storage”, click the empty optical drive, and choose “Choose a disk file” to select your macOS installer ISO (if you created one). If you have a USB installer, you can attach it via “USB” in the VM settings, but it’s often easier to use an ISO. To create an ISO from the installer app on a Mac, you can use Disk Utility or the command: hdiutil makehybrid -o /tmp/macOS.iso /Applications/Install\ macOS\ Catalina.app -iso -joliet -default-volume-name macOS (this may not be bootable; a more reliable method is to use a tool like “macOS ISO” scripts from GitHub).
  7. Boot the VM. Start the VM. It should boot from the installer. If you see a black screen, try pressing F2 or Esc to enter the EFI shell and type exit to continue. If the screen remains black, you may need to add the kernel flag npvhash=1 – see Troubleshooting.
  8. Install macOS. Follow the on-screen instructions. When you reach the Disk Utility, select the virtual hard disk (usually “VMware Virtual SATA Hard Drive Media” or similar), click “Erase”, format as “APFS” or “Mac OS Extended (Journaled)”, then close Disk Utility and choose “Install macOS”. Follow the prompts; the VM will reboot several times.
  9. Post-install configuration. After installation, you may need to run the same VBoxManage commands again if the VM doesn’t boot. Also, install VirtualBox Guest Additions for better performance – but note that macOS guest additions are not officially provided by Oracle; you can use a third-party tool like “VirtualBox Guest Additions for macOS” from GitHub, but it’s not guaranteed to work. For basic use, the VM works without them.

Common Mistakes

  • Forgetting to enable EFI – without it, the installer won’t boot.
  • Using an AMD CPU – macOS does not support AMD natively, and even with kernel patches, the VM may crash.
  • Not running the VBoxManage commands – the VM will panic with “CPU halted” or similar.
  • Allocating too little RAM (less than 4 GB) – the installer may be very slow or fail.
  • Using a macOS version newer than what your host CPU supports – e.g., Monterey requires certain CPU features.

Tips

  • Use a solid-state drive (SSD) on your host for better VM performance.
  • Take a snapshot of the VM before installation so you can revert if something goes wrong.
  • If the installer hangs at “Apple logo”, try adding -v to the boot flags to see verbose output – this helps diagnose issues.
  • Set the VM’s video memory to at least 128 MB in Display settings to avoid graphical glitches.
  • For macOS Big Sur and later, you may need to increase the VM’s base memory to 8 GB and enable “I/O APIC” in System settings.

Troubleshooting

Black screen after boot: This is common. Try adding the kernel flag npvhash=1 by editing the VM’s boot parameters. In VirtualBox, go to Settings > System > Processor, and under “Extended Features”, check “Enable PAE/NX”. Also, try disabling audio (as mentioned). If the screen is still black, try pressing F2 to enter the EFI shell, then type exit to continue booting.

Kernel panic “CPU halted”: This usually means the VBoxManage commands were not run correctly. Re-run them, ensuring the VM name is exactly as shown in VirtualBox (case-sensitive). Also, verify that you’re using an Intel CPU.

Installer says “This version of macOS is not supported on this computer”: This is a hardware check failure. Re-run the VBoxManage commands, especially the DmiSystemProduct and DmiBoardProduct ones. Make sure the values are correct for the macOS version you’re installing (e.g., MacBookPro11,3 for Catalina, MacPro6,1 for Big Sur).

VM boots to a prohibition sign (circle with a slash): This indicates a boot failure. Check that the installer ISO is bootable and that you’ve attached it correctly. Also, ensure the VM’s storage controller type is SATA (not IDE) – macOS requires SATA.

Slow performance: Allocate more RAM and CPU cores (enable “Enable VT-x/AMD-V” in System > Acceleration). Also, close other applications on the host.

Frequently Asked Questions

Can I install macOS on VirtualBox if I don’t own a Mac?

Technically yes, but Apple’s End User License Agreement prohibits running macOS on non-Apple hardware. The steps above work on Intel PCs, but you’re violating the license. Also, AMD CPUs are not supported.

Will macOS run smoothly in VirtualBox?

Expect moderate performance. Basic tasks like web browsing and word processing work, but graphics acceleration is limited because VirtualBox does not provide full GPU support for macOS guests.

Do I need a separate macOS installer for each version?

Yes. Each macOS version has its own installer. You can download older versions from the App Store only if you have previously purchased them; otherwise, you may need to find them from unofficial sources.

Why does my VM show “macOS is not supported on this platform”?

This is due to the hardware spoofing not being applied correctly. Re-run the VBoxManage commands and double-check the VM name and the exact strings.

Can I use an AMD CPU for this?

Officially, no. macOS does not support AMD CPUs. Some users have succeeded with kernel patches, but it’s complex and unstable. It’s not recommended.

Is it legal to install macOS on a virtual machine?

Apple’s EULA only allows macOS on Apple hardware. Running it in a VM on a Mac is allowed, but on non-Apple hardware it’s a violation. This guide is for educational purposes only.