2021年10月19日 星期二

install macOS on virtualbox on ubuntu

最近很該死的要在linux上編譯library給iOS使用,看了一些toolchain的說明,也載了一個來用,不是不能滿足程式的需求,就是後續可能會有很多坑,一不做二不休,乾脆用虛擬機器裝個mac OS來編譯,於是開始這段心裡邊罵邊安裝的旅程...

使用版本

macOS Big Sur 11.0.1 (20B29) 

http://www.mediafire.com/file/dbfod9u5q9ii9nd/macOS_Big_Sur_11.0.1_%252820B29%2529.iso/file


Install Step


Step 1: Open the VirtualBox software and click the “New” button. This will launch the ”create a new VM” wizard tool which is designed to walk you through the setup.


Step 2: Give your new VM a name (I named it Mac OSX). Choose “Mac OS X” in the “Operating System” dropdown menu, and then select “Mac OS X Server” from Version dropdown menu, which you will find in the same area.


Step 3: Assign the amount of memory you want to allocate to the new operating system. The maximum in VirtualBox is 1500MB, but you will want to temper this figure based on what you need to do with the system, how much memory you have in total on the system, and the types of programs you intend to install on under the new OS.


Step 4: Make a new hard drive for your VM. If you are not sure how much you need, choose the “Dynamic” option. This will allow the system to expand as your needs do. If you choose the “Static” option, be sure that you know what you need and allot accordingly. Then click on “Next” to finish up with the wizard.


Step 5: Click on “Settings” and then “System”. Uncheck the box next to the words “Enable EFI (special OSes only)”.


Step 6: Choose “Storage” from the menu on the left and choose the word “Empty”, you will see it under the OSX.vdi. You will see a folder with a green arrow. Click on it and a new window will open. Click on the plus sign. You will now be able to find the OSX86 iso that you downloaded earlier in this process. Once you have highlighted it, click on the “Select” button and then click on “OK”. Finally, click on the main start button to begin the process.


Step 7: When all of this is done the VM should start booting. You will be asked to select a language. Do that and click on “Next” then “Continue and Agree”. The next screen will show you the words choose the 50GB VBOX HARDDISK, and click on the “Erase” button.


Step 8: Click on “Install” to begin your installation. When the installation is done click the Right-Ctrl key and unmount the CD/DVD drive for now. Then restart the VM. OSX should begin to boot.


安裝可能會遇到的問題

如果遇到getCPUIDInfo: this is an unknown CPU model 

把下面雙引號內的字換成你在step 2取的VM name,關掉virtualbox(一定要關,否則會報錯),再逐一執行下面指令。

VBoxManage modifyvm "macOS_11.0.1" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff

VBoxManage setextradata "macOS_11.0.1" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"

VBoxManage setextradata "macOS_11.0.1" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"

VBoxManage setextradata "macOS_11.0.1" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"

VBoxManage setextradata "macOS_11.0.1" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"

VBoxManage setextradata "macOS_11.0.1" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1

然後再重新啟動virtualbox裡你的mac OS,按下一步做就行了~


REF

沒有留言:

張貼留言