Macos On Ubuntu Virtualbox



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:

VirtualBox is available for Windows, Linux, and macOS. Installation will differ depending on your computer's operating system, so check the detailed instructions on the VirtualBox download page. Once installed, VirtualBox is ready for the creation of a new virtual machine. For information on this, have a look here: Lifehacker 'How to Run Mac OS X Inside Windows Using VirtualBox'. Ignore the fact that they are using VirtualBox in Windows, because the same process will work in Ubuntu too. Mac OS and Windows with VirtualBox TL;DR: Get an Ubuntu VM up and running, install alsa and pulseaudio, set up mycroft-core, reboot and enjoy! Installing Ubuntu in VirtualBox.

  1. 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
  2. If the High Sierra Installer starts, quit it.
  3. Open 'Disk Utility'.
  4. Click on 'File' > 'New Image' > 'Blank image...'. Or just press cmd+N.
  5. In the 'Size' field, enter 13 GB and save it wherever you want.
  6. If the image is not mounted automatically, double-click the file you just created to do it.
  7. Open 'Terminal'
  8. 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.
  9. Once the previous command finished, continue with the following steps.
  10. Copy the file to some device which you can get access from Ubuntu (external drive or whatever works for you).
  11. On Ubuntu, open the 'Terminal'.
  12. Run VBoxManage convertfromraw <path_to_input_.dmg_file> <path_to_output_.vdi_file>.
  13. Open 'VirtualBox'.
  14. 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).
  15. Once the machine is created, go to the 'Settings'.
  16. 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.
  17. Click 'OK' and start the machine.
  18. Wait until you get to the screen where you have to choose the language. And choose your language.
  19. 'macOS Utilities' appears. Select 'Disk Utility' and click 'Continue'.
  20. Select the disk where you are going to install macOS (probably the same you created when creating the machine).
  21. Click 'Erase'.
  22. Verify that 'Mac OS Extended (Journaled)' is the format selected and click 'Erase'.
  23. Once it finishes, Quit the 'Disk Utility'.
  24. Select 'Install macOS' and click 'Continue'.
  25. Follow the instructions.
  26. Once it finishes, the machine automatically rebooted. What you have to do is power it off.
  27. Remove the installer hard disk from the machine. The one you added previously, not the one where you are installing macOS.
  28. Start the machine.
  29. You are going to see a screen where the last line is Shell>
  30. Run cd 'macOS Install DataLocked FilesBoot Files'
  31. Run boot.efi
  32. Continue the installation normally.

References:

MacOS VirtualBox VM on Ubuntu

Posted by Shujin Wu on February 23, 2017

Step 1: Download the Sierra installer from Mac App Store.

This should be done in you Mac and the installer will be placed in /Application/ folder.

Macos

Step 2: Prepare Sierra iso

Use geerlingguy’s script to prepare a sierra iso file.

Run Macos On Ubuntu Virtualbox

Step3: Install VirtualBox in Ubuntu

Macos On Ubuntu Virtualbox Download

You should have your VirtualBox and the Extension Pack installed, or use my ansible role

Step 4: Open VirtualBox and create a new VM.

Settings:

  • name: your_sierra_vm_name
  • type: Osx
  • version: Mac OS X 10.11 El Capitan (64-bit)
  • Other
VirtualboxMacos On Ubuntu Virtualbox

Macos Virtualbox Ubuntu Resolution

Step5: Configure VM for MacOS (Very important!)

Run following commands and replace “Sierra” with ‘your_sierra_vm_name’.

Step 6: Install Sierra

Macos Virtualbox Ubuntu 18.04

Insert sierra.iso to the sierra VM’s optical driver, and follow the instruction to install Sierra.

Note: In the installer, Go to Utilities > Disk Utility. Select the VirtualBox disk and choose Erase to format it as a Mac OS Extended (Journaled) drive.

Step 7: Remove sierra.iso and restart VM.

Macos Virtualbox Ubuntu Full Screen

Reference

Install Macos On Ubuntu Virtualbox

See also:





Comments are closed.