Apple Mac OS X VM

Revision as of 18:42, 1 July 2017 by WikiFreak (talk | contribs)


This page describes how to install MacOS X as a Virtual Machine on Ubuntu.


Sources

Everything that follow is a copy with more details of this amazing tutorial: http://suzywu2014.github.io/ubuntu/2017/02/23/macos-sierra-virtualbox-vm-on-ubuntu

The following setup also rely on https://github.com/geerlingguy/macos-virtualbox-vm


Requirements

Mac OS X ISO

You must have a valid MAC OS X installer disk.


INSTALLER

To do so you must "create installer" from another MAC


(i) If you don't have a MAC already you can search for "Download MacOS Sierra iso" on Google. The ISO is about 4.8 Go to download ; then 8 Go once extracted.


VirtualBox

First of all, you must setup VirtualBox. Official setup instructions are available on ORACLE web-page: https://www.virtualbox.org/wiki/Linux_Downloads


Add new repository

vim /etc/apt/sources.list

Add:

deb http://download.virtualbox.org/virtualbox/debian zesty contrib

Add the repository keys and update the definitions

# Repo keys
apt-key add oracle_vbox_2016.asc
apt-key add oracle_vbox.asc
### Alternative way to download and register the keys
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -


# Upgrade list of packages
apt-get update


Install VirtualBox

apt-get install virtualbox-5.1


(i) Note: Ubuntu/Debian users might want to install the dkms package to ensure that the VirtualBox host kernel modules (vboxdrv, vboxnetflt and vboxnetadp) are properly updated if the linux kernel version changes during the next apt-get upgrade.

apt-get install dkms


Setup Virtual Machine

  • Launch VirtualBox

Create a NEW machine

Specifications:

  • Name "Sierra"
  • Type Mac OS X 10.11 El Capitan (64-bit)
  • Memory settings
    • if you can, allocate at least 4 Gb (4096 Mb) to the VM
  • Hard disk
    • Create a new hard disk
    • Type VDI as VirtualBox Disk Image (default)
    • Allocation 'dynamic allocation
    • Max size: 45 Gb


Configuration tweaks

You must tweak the machine before starting the installation.

  • Select the VM and click on "Settings"
  • Select System then processor tab
    • Set 2 CPU
  • Select Display
    • Allocated, at least, 64 Mb
  • Select Shared folders
    • Add all the mount points you need


Register OS X factory settings

From a terminal type the following commands (adjust "Sierra" to your own VM name).

Thanks to http://suzywu2014.github.io/ubuntu/2017/02/23/macos-sierra-virtualbox-vm-on-ubuntu for the commands!

VBoxManage modifyvm Sierra  --cpuidset 00000001 000306a9 00020800 80000201 178bfbff
VBoxManage setextradata "Sierra" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata "Sierra" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "Sierra" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "Sierra" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "Sierra" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1

Add the ISO file