type
Post
status
Published
date
Dec 3, 2023
slug
install-macos
summary
使用 VMware 虚拟机安装运行 macOS
tags
系统
category
吃饱了闲的
icon
password

安装前准备

0x01 虚拟机软件 VMware Workstation Pro

不同的 VMware Workstation 版本所支持运行的 macOS 版本信息如下:
  • VMware Workstation 16
    • macOS Monterey 12.7 (21G816)
    • macOS Big Sur 11.7.10 (20G1427)
  • VMware Workstation 17
    • macOS Sonoma 14.1.2 (23B92) 正式版
    • macOS Ventura 13.6 (22G120)
    • macOS Monterey 12.7 (21G816)
    • macOS Big Sur 11.7.10 (20G1427)

0x02 VMware macOS 支持套件 Unlocker

VMware 在安装 Unlocker 之后才可以在客户机操作系统界面选择 Mac OS 选项

0x03 macOS 系统镜像

需要下载支持虚拟机运行的系统镜像

安装步骤

教程所使用的环境:

0x01 VMware 配置

下载 Unlocker 工具后解压,进入 windows 目录
notion image
然后以管理员方式运行 unlock.exe ,该程序会将补丁自动添加到 VMware 中
💡
如果有虚拟机正在运行需要先关闭再运行 unlock.exe
notion image
完成后可以运行 check.exe 检查 VMware 的补丁安装状态,如下图所示即为解锁成功
notion image

0x02 创建虚拟机

点击新建虚拟机向导,选择【自定义】类型进行配置
notion image
硬件兼容型选择如下
notion image
安装来源选择【稍后安装操作系统】
notion image
客户机操作系统选择【Apple Mac OS X】,版本根据需要安装的 macOS 系统进行选择
如果没有安装 Unlocker ,则不会有该选项
💡
版本对应关系如下,Monterey 选择 macOS 11 或 macOS 12 均可
  • macOS Sonoma → 14
  • macOS Ventura → 13
  • macOS Monterey → 12
  • macOS Big Sur → 11
notion image
选择虚拟机安装位置,点击下一步。虚拟机的处理器和内存的配置根据具体硬件配置即可
notion image
网络类型选择 NAT
notion image
选择I/O控制器和磁盘类型,使用推荐的即可
notion image
notion image
选择【创建新虚拟磁盘】,并选择【将虚拟磁盘存储为单个文件】
notion image
notion image
然后选择【自定义硬件】,在设备中选择【CD/DVD (SATA)】,然后选择【使用ISO映像文件】,选择已下载的 macOS ISO镜像,最后点击确定,即可完成虚拟机的创建
💡
如果是AMD的CPU,创建完成后不要启动虚拟机,先看下面的特殊配置
notion image

AMD CPU 的特殊配置

在新建完虚拟机之后先不要启动虚拟机(切记),如果启动了就需要删掉重新创建虚拟机
如果已经启动了,应该会看到如下的提示:
notion image
创建完虚拟机之后先找到虚拟机的vmx配置文件,vmx文件路径在底部的虚拟机详细信息中可以查看
notion image
notion image
在vmx文件的末尾追加以下内容:
cpuid.0.eax = "0000:0000:0000:0000:0000:0000:0000:1011" cpuid.0.ebx = "0111:0101:0110:1110:0110:0101:0100:0111" cpuid.0.ecx = "0110:1100:0110:0101:0111:0100:0110:1110" cpuid.0.edx = "0100:1001:0110:0101:0110:1110:0110:1001" cpuid.1.eax = "0000:0000:0000:0001:0000:0110:0111:0001" cpuid.1.ebx = "0000:0010:0000:0001:0000:1000:0000:0000" cpuid.1.ecx = "1000:0010:1001:1000:0010:0010:0000:0011" cpuid.1.edx = "0000:0111:1000:1011:1111:1011:1111:1111" smbios.reflectHost = "TRUE" hw.model = "MacBookPro14,3" board-id = "Mac-551B86E5744E2388" keyboard.vusb.enable = "TRUE" mouse.vusb.enable = "TRUE"
notion image
保存vmx文件后即可启动虚拟机

0x03 安装 macOS 系统

首次启动虚拟机,正常情况下会显示白苹果图标以及进度条
notion image
稍等片刻会进入 macOS 配置界面,设置语言为简体中文
notion image

磁盘配置

选择【磁盘工具】并点击继续
notion image
首先在左侧选项栏中选择第一个选项(也就是创建的虚拟磁盘),然后点击【抹掉】
notion image
点击后在弹出栏中填写硬盘名称,其他的保持默认即可,然后点击【抹掉】按钮
notion image
notion image
抹掉完成后左侧会多出一个名为【Disk】的宗卷
notion image
关于硬盘管理的概念可以阅读这篇文章:

系统安装

完成磁盘格式化后,关闭磁盘工具(左上角的红点),然后选择菜单的第二项安装系统
notion image
同意许可协议
notion image
选择刚刚格式化的磁盘,点击继续
notion image
接着就进入自动安装环节
notion image
在安装完成后会自动重启系统,并进入 macOS 系统开机配置,根据实际情况配置即可
notion image
硬盘使用情况
notion image
内存使用情况
notion image

0x04 安装 VMware Tools

在 macOS 中将安装镜像推出后,进入虚拟机设置,在设备中选择【CD/DVD (SATA)】,选择【使用ISO映像文件】,选择 unlocker 工具目录下的 iso 目录中的 darwin.iso 镜像文件
notion image
选择 ISO 文件后勾选已连接,然后点击确定
notion image
在 macOS 中会自动弹出安装引导,选择【安装 VMware Tools】进行安装
notion image
安装过程中会弹出:系统扩展已被阻止的对话框。点击 打开安全性偏好设置
点击左下角 锁图标,在弹出的对话框中:输入系统登录用户密码后,点击【解锁】
然后点击右侧的【允许】按钮
notion image
VMware Tools 安装完成后,点击【重新启动】
notion image
尝试从宿主机拖动一个文件到虚拟机中,会提示需要授权
notion image
点击【打开系统偏好设置】,点击左下角锁图标 ,点击【辅助功能】,勾选【vmware-tools-daemon】
notion image
再次尝试拖动文件可以正常复制
notion image

参考资料

 
Pytorch&CUDA 环境搭建Clash for Windows 使用教程