Important: I'm writing this when the last version of macOS (and the one I have installed) is Mojave.There is already a script which installs Mojave in a virtual machine here https://github.com/img2tab/okiomov. But if you are curios how to do everything manually to install High Sierra, then this guide may be useful.
After reading a few articles I ended up with these steps:
Mac Os Virtualbox Github Download
- On macOS, download the High Sierra installer (even if you have Mojave installed):https://itunes.apple.com/us/app/macos-high-sierra/id1246284741?ls=1&mt=12
- If the High Sierra Installer starts, quit it.
- Open 'Disk Utility'.
- Click on 'File' > 'New Image' > 'Blank image...'. Or just press cmd+N.
- In the 'Size' field, enter
13 GB
and save it wherever you want. - If the image is not mounted automatically, double-click the file you just created to do it.
- Open 'Terminal'
- Run
sudo /Applications/Install macOS High Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled
. If you changed the value of the 'Name' field in the step where you changed the 'Size', then instead of 'Untitled' the image probably appears with that name you entered. - Once the previous command finished, continue with the following steps.
- Copy the file to some device which you can get access from Ubuntu (external drive or whatever works for you).
- On Ubuntu, open the 'Terminal'.
- Run
VBoxManage convertfromraw <path_to_input_.dmg_file> <path_to_output_.vdi_file>
. - Open 'VirtualBox'.
- Create a new machine of Type 'Mac OS X' and Version 'macOS 10.13 High Sierra (64-bit)' (probably others work, but I just tried with that one).
- Once the machine is created, go to the 'Settings'.
- Select 'Storage' and click to add a hard disk. When asked click on 'Choose existing disk' and select the .vdi file you created using
VBoxManage convertfromraw
. - Click 'OK' and start the machine.
- Wait until you get to the screen where you have to choose the language. And choose your language.
- 'macOS Utilities' appears. Select 'Disk Utility' and click 'Continue'.
- Select the disk where you are going to install macOS (probably the same you created when creating the machine).
- Click 'Erase'.
- Verify that 'Mac OS Extended (Journaled)' is the format selected and click 'Erase'.
- Once it finishes, Quit the 'Disk Utility'.
- Select 'Install macOS' and click 'Continue'.
- Follow the instructions.
- Once it finishes, the machine automatically rebooted. What you have to do is power it off.
- Remove the installer hard disk from the machine. The one you added previously, not the one where you are installing macOS.
- Start the machine.
- You are going to see a screen where the last line is
Shell>
- Run
cd 'macOS Install DataLocked FilesBoot Files'
- Run
boot.efi
- Continue the installation normally.
Today I'm showing you how to Install Mac OS X 10.4.8 Tiger in a Virtual Machine, you can use VirtualBox or VMWare. With this tutorial, you can install macOS.
Macos Guest Virtualbox Github
- MacOS VirtualBox VM Instructions. Current macOS version: High Sierra (10.13), tested with VirtualBox 5.2.16 r123759. To build a VM running macOS, follow the directions below: Download the installer from Mac App Store (it should be available in the 'Purchases' section if you've acquired it previously).
- Multipass is a lightweight VM manager for Linux, Windows and macOS. It's designed for developers who want a fresh Ubuntu environment with a single command. It uses KVM on Linux, Hyper-V on Windows and HyperKit on macOS to run the VM with minimal overhead. It can also use VirtualBox on Windows and macOS.
Macos Virtualbox Audio
Run Macos On Virtualbox Github
References: