因为搞了PVE所以黑苹果肯定少不了,又因为上次测试完忘记做笔记,还得重新做个黑苹果部署手册。
本次用到的环境:PVE8.3、Debian12
1、安装准备
# 解决编辑器BUGroot@debian:~# echo "set nocompatible" >> /etc/vim/vimrc.tinyroot@debian:~# echo "set backspace=2" >> /etc/vim/vimrc.tinyroot@debian:~# systemctl stop iptable firewalldroot@debian:~# cat > /etc/apt/sources.list << EOFdeb https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contribdeb-src https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contribdeb https://mirrors.aliyun.com/debian-security/ bookworm-security maindeb-src https://mirrors.aliyun.com/debian-security/ bookworm-security maindeb https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contribdeb-src https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contribdeb https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contribdeb-src https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contribEOFroot@debian:~# apt-get updateroot@debian:~# apt-get install -y qemu-system uml-utilities virt-manager git \ wget libguestfs-tools p7zip-full make dmg2img tesseract-ocr \ tesseract-ocr-eng genisoimage vim net-tools screenroot@debian:~# git clone --depth 1 --recursive https://github.com/kholia/OSX-KVM.git2、用工具转换镜像
root@debian:~# cd OSX-KVM/root@debian:~/OSX-KVM# dmg2img -i BaseSystem.dmg BaseSystem.img# 这里的104是指我debian的ID号,下面这个命令是把我们转换后的镜像传到pve的ISO的镜像中root@debian:~/OSX-KVM# pct pull 104 /root/OSX-KVM/BaseSystem.img /var/lib/vz/template/iso/MacOS13.img
3、创建虚拟机
ID默认

镜像选择引导镜像OpenCore,类别Other

根据图上修改,EFI存储和存储根据自己环境进行调整


核心这里看自己资源分配,类别选择host

内存这边就16G起步

网卡模型要修改vmxnet3

查看无误完成

进入虚拟机新建CD驱动盘


然后进去PVE的shell中,修改110虚拟机的配置文件

因为我是英特尔处理器,在配置文件开头增加这行命令:args: -device isa-applesmc,osk=“ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc” -smbios type=2 -device usb-kbd,bus=ehci.0,port=2 -global nec-usb-xhci.msi=off -global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off -cpu host,vendor=GenuineIntel,+invtsc,+hypervisor,kvm=on,vmware-cpuid-freq=on
AMD处理器增加这个:args: -device isa-applesmc,osk=“ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc” -smbios type=2 -device usb-kbd,bus=ehci.0,port=2 -global nec-usb-xhci.msi=off -global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off -cpu Haswell-noTSX,vendor=GenuineIntel,+invtsc,+hypervisor,kvm=on,vmware-cpuid-freq=on
增加完后把ide0和ide2的media=cdrom替换成cache=unsafe,修改完成后保存退出即可

回到110虚拟机上进入控制台并启动虚拟机

选中第一个回车,等待进度条跑完

然后进入第四个Disk Utility

选择左边的虚硬盘然后点击右上角的分区按钮,并自己命名名称

成功分区

点击左上红色按钮关闭窗口

选择第二行安装系统

继续

同意协议


选择安装位置

安装时间会比较旧,安装期间会重启几次系统
第一次重启选择第二个macOS installer


第二次重启还是选择第二个macOS installer

第三次重启选择Mac13

第四次重启选择Mac13

进来之后选择语言

之后就一直继续就行
这一步要选择不迁移数据

选择不登陆然后跳过skip


同意许可

点击agree

创建用户名和密码

继续


位置自己选一下

数据分析不发送

稍后测试

自己选就行了

设置键盘

根据提示分别按对应的键盘



到此pve搭建的虚拟机就结束了
