一、 下载VirtualBox
https://www.virtualbox.org/wiki/Downloads
安装(可选):VM VirtualBox Extension Pack
二、 配置Hyper-V
WIN+R ,输入:optionalfeatures
三、安装
1. 自动安装
https://github.com/myspaghetti/macos-virtualbox
执行脚本前,需要先安装cynwin,安装后打开cynwin,转到脚本目录,执行以下命令
bash -i macos-guest-virtualbox.sh
2.手动安装
1. 创建虚拟机
2. 配置磁盘
3. 去除软驱
4. 配置CPU
5. 调整显存
6. 执行命令
cd "C:\Program Files\Oracle\VirtualBox\"
# vbox版本小于6.* 使用 --cpuidset 00000001 000306a9 04100800 7fbae3ff bfebfbff
./VBoxManage.exe 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/EfiGraphicsResolution 1920x1080
# 开启AMD-V
./VBoxManage modifyvm "macOS" --nested-hw-virt on
7. 下载镜像
苹果OS下载:https://themacgo.com/macos-high-sierra-10-13-6-dmg-mac-free-download-iso/
更多:https://www.mfpud.com/macos/dmg/
8. 选择镜像
8. 安装系统
点击【启动】,进入选择语言界面,选择语言后,选择【磁盘工具】
格式化
关闭后选择【安装mac OS】
四、 报错及解决
- Failed to query SMC value from the host (VERR_INVALID_HANDLE).
关闭vbox,管理员打开CMD,输入以下命令,然后重启:
bcdedit /set hypervisorlaunchtype off
参考(评论中):https://osxdaily.com/2021/07/15/how-install-macos-virtualbox-windows/
- 自动安装时,启动vbox后卡住,无法进入语言选择界面,可能是CPU配置问题,手动闭关vbox,执行以下命令后再启动
./VBoxManage.exe modifyvm "macOS" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
[
](https://themacgo.com/macos-high-sierra-10-13-6-dmg-mac-free-download-iso/)