Install macOS guest on Virtualbox on macOS host

When you download and run untrusted applications (or any application you do not know well) from the internet you will never know what they will do to your computer and private information you have in your computer. You can setup a virtual machine and run untrusted applications in it to eliminate this security risk. The applications you run in the virtual machine will not have access to anything in your host machine. You can maintain a separate virtual machine with similar configuration to your host machine to run all your not so trusted applications. Make sure not to store any sensitive information in this virtual machine. Use your host machine as usual to keep them safe.

This post will show you how to install macOS Catalina virtual machine on Virtualbox on macOS Catalina host.

What You Will Need?

This guide has been tested on the following setup.

Steps to Install the macOS VM

Download the latest macOS installer from the Mac App Store. At the time of writing it is macOS Catalina 10.15.4. You should have the installer app in your “/Applications” directory.

Installer app in /Applications directory

Next, you have create a macOS installer image. You can create the installer disk ISO automatically using this script. To use the script, download it. Open the terminal and navigate to the directory where you downloaded the script.

Tip: If you want to add terminal and many other things to your macOS right click menu check this tool.

cd "path/to/the/dir/of/the/script"

Then enter the following command in the terminal. Make sure to change the macOS installer app’s name (Install macOS to the name of the macOS installer app you have in your “/Applications” directory.

./ "/Applications/Install macOS"

The script will create a macOS installer disk in iso format in the current directory of the terminal.

Installer disk ISO

Download Virtualbox and install it if you do not have it already in your host machine.

Now open Virtualbox and create a new virtual machine with the following configurations. When creating a disk for the virtual machine make sure to allocate at least 30GB. Otherwise the macOS installer will not allow you to proceed with the installation halfway through. You can adjust the amount of memory etc. according to the resources you can allocate.

To create the VM,

Follow the instructions to create the VM. Create the disk with a size around 30GB while following the on screen instructions.

To configure the VM, go to VM Settings:

Virtualbox config

You should mount the macOS installer ISO that we created above in the virtual machine that you just created. Select the virtual machine > click on settings > select storage > select the optical drive > browse the installer iso.

Virtualbox config

After doing this, you can start the virtual machine. It will take some time to start. The initial loading screen will look like following.

Virtualbox config

Then the loading screen will become an apple splash screen.

Virtualbox config

After the loading is completed the installer will ask for the language.

Virtualbox config

Next the macOS installer screen will be shown.

Virtualbox config

The first step in the installer is to open the disk utilities to format the disk.

Virtualbox config

In disk utilities select the disk and format it with the default settings.

Virtualbox config

Then you can start the installer.

Virtualbox config

At the installer select the disk that you formatted in the previous step.

Virtualbox config

Then follow the instructions to proceed with the installation.

Virtualbox config