VirtualBox/Setting up a Virtual Machine/Mac OS X
According to the macOS and OS X software license agreement, macOS should only be installed on Apple Mac devices. Neither the editors of this book nor Wikibooks have any liability over the installation of macOS or OS X guests on VirtualBox or any other violations of the software license.
The following installation script:
- Doesn't require a ready-made bootable installation ISO
- Downloads macOS Mojave directly from the Apple Store servers
- Runs on Windows and Linux
- Uses only open-source software, no custom bootloader, and original Apple files directly from Apple
- Has easily-installed dependencies: VirtualBox>5.2 with Extension Pack, bash>4 (cygwin bash on Windows), unzip, wget, dmg2img
- Can use a genuine Mac serial number to allow iCloud and iMessage functionality.
The manual installation requires access to the Mac App Store through an existing installation of macOS.
Create ISO Installation Media
- Download the macOS Installer file from the App Store.
- When download finishes, find the app, right-click and select "Show Package Contents".
- Inside Contents/SharedSupport you will find a InstallESD.dmg file.
- Open "Disk Utility"
- Choose Images > Convert
- In the window, choose the InstallESD.dmg to convert and the disk type to be "DVD/CD-R master for export". Also choose the name for installer disk and the final destination. Then click "Convert".
- After conversion completes, you will see a .cdr file in your destination folder.
- Open "Terminal"
- Type hdiutil convert /(source path)/OSXInstaller.cdr -format UDTO -o /(destination path)/OSXInstaller.iso in "Terminal"
- Check destination folder. This is your file for installation in VirtualBox. There should be a .iso file extension.
Installation in VirtualBox
- Open VirtualBox. Click "New"
- Type the name for virtual machine and OS X for type. Choose your version.
- Select memory size.
- Select "Create Virtual Disk Now"
- Choose VDI for format.
- Select storage name and size. The size should be at least 32 GB.
- Go to "Settings"
- Go to "Storage" Tab
- In the SATA controller, click "Add Optical Disk".
- Insert the .iso file.
- Go to "Display" tab.
- Set video memory to maximum value.
- Quit "Settings"
- Boot by clicking "Start".
- When it boots, you will see some data being displayed.
- After a while, you will need to choose the language for installation. Choose your own language.
- Then you will be asked where to install the OS X.
- On the upper-left corner, you will see a "Utilities" button. Click it and select "Disk Utility".
- You will see a window with different storages on the left. Choose "VBOX HARDDISK Media". Note: You may have to select View/View All Devices
- Erase the Storage by clicking the "Erase" button on the top.
- You will be prompted to enter the name for the storage. Enter your desired name and continue.
- Wait for the process to complete. Then quit Disk Utility.
- You will find a new storage media, which is like a hard disk. Choose that storage for the installation of OS X to install.
- After installation completes, the virtual machine will automatically shut down. Go to "Settings".
- Go to "Storage" section to eject the .iso file.
- Boot virtual machine again.
- Choose system language.
- Choose allow location or not.
- You will be asked to enter your Apple ID. Even if you have an Apple ID, do not enter now.
- Accept EULA of OS X
- Restore Time Machine Backups (if you have)
- You will see the main page of OS X, open App Store.
- Enter your Apple ID and sign in...
There should be 2 scenarios...
- Scenario 1: You will sign in within a short time. Congratulations! You have done it!
- Scenario 2: It took ages. Stop signing in and check the FAQ below.