Installing MacOS to VirtualBox

MrTwister
MrTwister
Feb 1, 2018 · 3 min read

In work you may need to build your application in MacOS environment without Apple Macbook or iMac or other hardware.

I just not found good tutorial in English and make decision make my own. Let’s start!


Dependencies

VirtualBox

Go to https://www.virtualbox.org/wiki/Downloads and download last virtual box package for you OS.

MacOS Sierra ISO

Get it here https://drive.google.com/drive/folders/0Bx7BAMlD-ZOQSTc2NmpDU2g2WDA


Process

Open VirtualBox and start creating new VM for OSX in expert mode(by default).

Name your new machine as “MacOS”.
Choose last version from possible versions. Currently is “Mac OS X 10.11 El Capitan (64-bit)”.
Set memory size to 4096 MB.
Choose “Create a virtual hard disk now”(by default).
Click “Create”

Image for post
Image for post

On next step all options are good for our task. Just click “Create”.

Image for post
Image for post

Virtual machine created! 🎉

In list of VMs open context menu for “MacOS” VM and choose “Settings”.

On “System/Motherboard” set “Boot order” like on screenshot

Image for post
Image for post

On “System/Processor” increase processors count to maximum green value.

Image for post
Image for post

On “Display/Screen” increase “Video Memory” to 128 MB

Image for post
Image for post

On “Storage” delete “Empty” controller and create “Add SATA Controller”. Add optical drive to new controller. Choose ISO file from step dependencies.

Image for post
Image for post
Image for post
Image for post

On “Audio” disable “Enable audio” checkbox

Image for post
Image for post

On “Network” use default options. Click on “Port forwarding” and add new row.

Close VM settings and open console in host machine and run next commands:

VBoxManage modifyvm “MacOS” — cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff

VBoxManage setextradata “MacOS” “VBoxInternal/Devices/efi/0/Config/DmiSystemProduct” “iMac11,3”

VBoxManage setextradata “MacOS” “VBoxInternal/Devices/efi/0/Config/DmiSystemVersion” “1.0”

VBoxManage setextradata “MacOS” “VBoxInternal/Devices/efi/0/Config/DmiBoardProduct” “Iloveapple”

VBoxManage setextradata “MacOS” “VBoxInternal/Devices/smc/0/Config/DeviceKey” “ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc”

VBoxManage setextradata “MacOS” “VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC” 1

VBoxManage setextradata “MacOS” VBoxInternal2/EfiGopMode 4

Start VM and start to install MacOS

When installation request for disk start “Disk Utility”

Image for post
Image for post

Erase “VBOX HARDDISK”

Image for post
Image for post

And choose it

Image for post
Image for post

After installation enable “Remote Login” in MacOS virtual machine.

Open “System Preferences/Sharing” and enable “Remote Login” checkbox. Set “Allow access for” for “All users”. Check address below “Remote Login: On”. It is look like “ssh user@10.0.2.15”. Check this IP with “Guest IP” in “Settings/Network/Port forwarding” for virtual machine. They must be equal.

Image for post
Image for post

Finish!

Now you can to connect via ssh to your local port.

ssh user@127.0.0.1 -p2222

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store