Install macOS in VirtualBox

Install macOS in VirtualBox

You need a mac machine, mac laptop or pc to download and convert installer.

Download macOS

Visit link
https://support.apple.com/en-sg/HT211683
scroll down to bottom, you will see list of macOS version. select one on them will take you to appStore, click ‘Get’ will start downloading installer.

When downloading finished, you will see ‘Install macOS xxx.app’ under /Applications where xxx is name of macOS you selected just now.

Now open Terminal.app to convert installer to ISO file.

Convert installer to ISO

We take xxx as Mojava here. Replace it with your selection. and make sure

Create a disk image DMG file buy issuing the following command:

$> hdiutil create -o /Users/yourname/tmp/Mojave -size 1400m -volname Mojave -layout SPUD -fs HFS+J

Mount the created DMG disk image as follows:
$> hdiutil attach /Users/yourname/tmp/Mojave.dmg -noverify -mountpoint /Volumes/Mojave
Next we will use createinstallmedia to create the macOS installer application on the mounted volume:

$> sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia –volume /Volumes/Mojave –nointeraction

When createinstallmedia has finished, next you can unmount the volume you just created:
$> hdiutil detach /volumes/Install\ macOS\ Mojave

If above command failed with error:
hdiutil: couldn’t unmount “disk blabal” – Resource busy
Simply restart your mac.

Now we convert the DMG disk image file to an ISO disk image file (technically a CDR file but it’s the same as an iso)
$> hdiutil convert /Users/yourname/tmp/Mojave.dmg -format UDTO -o ~/Desktop/Mojave.cdr
Finally, we rename the CDR file extension to ISO to convert the CDR to ISO:

$> mv ~/Desktop/Mojave.cdr ~/Desktop/Mojave.iso

Install macOS to VirtualBox

Create VirtualMachine

Choose MacOS 64bit when create virtualmachine.
Then change settings:
Enable PAE/NX in System tab.

Then attach ISO file to storage and start virtual machine to install macOS.

There is nothing special for installation. After installtion, there are somes errros.

Error

After installation, got error

AppleKeyStore:10683:268: operation failed,

Power off virtual machine first. From host machine, let say, in Linux, run following command:
VBoxManage modifyvm “Type Your Virtual Machine Name Here” –cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata “Type Your Virtual Machine Name Here” “VBoxInternal/Devices/efi/0/Config/DmiSystemProduct” “iMac11,7”
VBoxManage setextradata “Type Your Virtual Machine Name Here” “VBoxInternal/Devices/efi/0/Config/DmiSystemVersion” “1.0”
VBoxManage setextradata “Type Your Virtual Machine Name Here” “VBoxInternal/Devices/efi/0/Config/DmiBoardProduct” “Iloveapple”
VBoxManage setextradata “Type Your Virtual Machine Name Here” “VBoxInternal/Devices/smc/0/Config/DeviceKey” “ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc”
VBoxManage setextradata “Type Your Virtual Machine Name Here” “VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC” 1

After this, power on the virtual machine. It should boot into system successfully.

    分享到:

留言

你的邮箱是保密的 必填的信息用*表示