PVE Guest MacOS 13 Venture Setup: Difference between revisions

From WikiMLT
 
(43 intermediate revisions by the same user not shown)
Line 2: Line 2:


== Proxmox Setup and MacOS Installation ==
== Proxmox Setup and MacOS Installation ==
'''Great manual provided by i12bretro which I've used to install MacOS 13 Venture:'''
'''I've followed the guide provided by i12bretro and have installed <u>MacOS 13 Venture</u> on my PVE:'''


* YouTube: [https://www.youtube.com/watch?v=KLNLRhcQPYU '''Running a MacOS Monterey VM in ProxMox VE'''] (also much comments about GPU PT are provided there)
* YouTube: [https://www.youtube.com/watch?v=KLNLRhcQPYU '''Running a MacOS Monterey VM in Proxmox VE'''] (also much comments about GPU PT are provided there)
* Guide: [https://i12bretro.github.io/tutorials/0628.html '''Running a MacOS Monterey VM in ProxMox VE'''] ([[:File:Running a MacOS Monterey VM in ProxMox VE.pdf|local copy of the guide]])
* Guide: [https://i12bretro.github.io/tutorials/0628.html '''Running a MacOS Monterey VM in Proxmox VE'''] ([[:File:Running a MacOS Monterey VM in ProxMox VE.pdf|local copy of the guide]])


Below is shown my final configuration file.<syntaxhighlight lang="shell" line="1">
During the installation I've used the resources provided within the [[{{FULLPAGENAME}}#Resources|resources section]]. Here is shown my final configuration file.
<syntaxhighlight lang="shell" line="1">
cat /etc/pve/qemu-server/207.conf
cat /etc/pve/qemu-server/207.conf
</syntaxhighlight>
</syntaxhighlight>
<syntaxhighlight lang="yaml" line="1" class="mlw-pre-wrap">
<syntaxhighlight lang="yaml" line="1" class="mlw-pre-wrap mlw-pre-max-height-320 code-continue">
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 -cpu host,kvm=on,vendor=GenuineIntel,+kvm_pv_unhalt,+kvm_pv_eoi,+hypervisor,+invtsc
agent: 0
audio0: device=ich9-intel-hda,driver=spice
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 -cpu host,kvm=on,vendor=GenuineIntel,+kvm_pv_unhalt,+kvm_pv_eoi,+hypervisor,+invtsc,+pcid,+xsave,+xsaveopt,check
audio0: device=intel-hda,driver=spice
bios: ovmf
bios: ovmf
boot: order=virtio0
boot: order=virtio0
cores: 4
cores: 4
cpu: Penryn
cpu: host
efidisk0: ssd-1TB:207/vm-207-disk-0.qcow2,efitype=4m,size=528K
efidisk0: ssd-1TB:207/vm-207-disk-0.qcow2,efitype=4m,size=528K
machine: q35
machine: q35
memory: 16384
memory: 16384
meta: creation-qemu=7.0.0,ctime=1666276060
meta: creation-qemu=7.0.0,ctime=1666276060
name: MacOS13
name: MacOS.13
net0: vmxnet3=C2:63:A3:4E:7E:E7,bridge=vmbr0,firewall=1
net0: vmxnet3=C2:63:A3:4E:7E:E7,bridge=vmbr0,firewall=1
numa: 0
numa: 1
ostype: other
ostype: other
scsihw: virtio-scsi-pci
scsihw: virtio-scsi-pci
smbios1: uuid=ac933204-a2a1-4915-aeee-60259bfb3fc1
smbios1: uuid=ac933204-a2a1-4915-aeee-60259bfb3fc1
sockets: 4
sockets: 4
spice_enhancements: foldersharing=1,videostreaming=all
spice_enhancements: videostreaming=all
tablet: 1
tablet: 1
tpmstate0: ssd-1TB:207/vm-207-disk-1.raw,size=4M,version=v2.0
tpmstate0: ssd-1TB:207/vm-207-disk-1.raw,size=4M,version=v2.0
usb0: spice,usb3=1
usb0: spice,usb3=1
usb1: spice,usb3=1
usb1: spice,usb3=1
usb2: host=0bda:8179,usb3=1
usb2: spice,usb3=1
vga: qxl,memory=128
vga: qxl,memory=128
virtio0: local-lvm:vm-207-disk-0,discard=on,size=80G
virtio0: local-lvm:vm-207-disk-0,discard=on,size=80G
vmgenid: 64c40db4-c6f3-4c42-b9ed-95a02e08fa15
</syntaxhighlight><syntaxhighlight lang="yaml" line="1" class="mlw-pre-wrap mlw-pre-max-height-320">
# Tested args which provide worse performance
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 -cpu Penryn,kvm=on,vendor=GenuineIntel,+kvm_pv_unhalt,+kvm_pv_eoi,+hypervisor,+invtsc,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+avx2,+aes,+fma,+fma4,+bmi1,+bmi2,+xsave,+xsaveopt,check -device intel-hda,id=sound5,bus=pci.0,addr=0x18 -device hda-micro,id=sound5-codec0,bus=sound5.0,cad=0 -device hda-duplex,id=sound5-codec1,bus=sound5.0,cad=1 -device hda-output
</syntaxhighlight>


* Note my Proxmox VE host is installed on [[Lenovo ThinkServer TD350 Maintenance|Think Server TD350]] with [https://www.techpowerup.com/cpu-specs/xeon-e5-2673-v3.c2884 Intel Xeon E5-2673 v.3] and I do not need to pass much additional CPU args.
* I've tried with different Intel processor types and found that the [https://wiki.metalevel.tech/index.php?oldid=32133 Penryn] type (used in the most internet guides) causes much greater CPU usage at the host level. IMO IvyBridge is better choice. Currently I'm using Hos type - in my case it is Haswell-EP architecture.
* In additional I've found that the number of the cores can't be greater than 4 (but you can increase the sockets if you want to pass more cores), otherwise the VM hangs at boot.
After moving the ProxmoxVE host to a machine based on '''AMD Ryzen 9 5900X 12-Core Processor''', I was need to change some options. The correct args configuration I found within the section [https://www.nicksherlock.com/2022/10/installing-macos-13-ventura-on-proxmox/ "Upgrading from macOS Monterey" of the article "Installing macOS 13 Ventura on Proxmox 7.2"] in Nicholas Sherlock's blog. Below is my current configuration file.<syntaxhighlight lang="shell" line="1">
cat /etc/pve/qemu-server/1050.conf
</syntaxhighlight>
<syntaxhighlight lang="yaml" line="1" class="mlw-pre-wrap mlw-pre-max-height-320 code-continue">
agent: 1
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
audio0: device=intel-hda,driver=spice
bios: ovmf
boot: order=virtio0
cores: 8
cpu: Haswell
cpuunits: 1024
efidisk0: local-lvm:vm-1050-disk-0,efitype=4m,size=4M
machine: q35
memory: 8196
meta: creation-qemu=7.0.0,ctime=1666276060
name: MacOS.13
net0: vmxnet3=26:B2:9C:37:29:26,bridge=vmbr0,firewall=1
numa: 0
onboot: 1
ostype: other
scsihw: virtio-scsi-pci
smbios1: uuid=de4a7e04-a553-413d-a136-a7218bdf95ae
sockets: 1
spice_enhancements: videostreaming=all
tablet: 1
tpmstate0: local-lvm:vm-1050-disk-1,size=4M,version=v2.0
usb0: spice,usb3=1
usb1: spice,usb3=1
usb2: spice,usb3=1
vga: qxl,memory=128
virtio0: local-lvm:vm-1050-disk-2,discard=on,size=80G
vmgenid: 1a90942a-6107-4ce6-ba04-50db6f01c986
</syntaxhighlight>
</syntaxhighlight>


== Pot Installation Setup ==
== Post Installation Setup ==
Currently I'm using Spice/QXL for display driver. Note there is not MacOS guest tool available and this is the reason we can't change the resolution within the guest.
Currently I'm using Spice/QXL for display driver. Note there is not MacOS guest tool available and this is the reason we can't change the resolution within the guest.


=== Switch the Resolution while using SPICE/QXL ===
=== Switch the Resolution while using SPICE/QXL ===
Line 47: Line 90:
* Use [https://github.com/corpnewt/MountEFI MountEFI] and mount the EFI.
* Use [https://github.com/corpnewt/MountEFI MountEFI] and mount the EFI.
* Use the MacOS's file manager and navigate to the mounted EFI partition.
* Use the MacOS's file manager and navigate to the mounted EFI partition.
* Edit the file <code>EFI/OC/'''config.plist'''</code> - find and modify the following <code><string></code> directive, note only one resolution will be accepted and the fallback resolution is that defined in the OVMF UEFI settings:<syntaxhighlight lang="xml" class="code-continue">
* Edit the file <code>EFI/OC/'''config.plist'''</code> - find and modify the following <code><string></code> directive, note only one resolution will be accepted and the fallback resolution is that defined in the OVMF EFI settings.<syntaxhighlight lang="xml" class="code-continue">
<key>Resolution</key>
<key>Resolution</key>
<string>1920x1080@32</string>
<string>1920x1080@32</string>
Line 55: Line 98:
<string>1280x960@16</string>
<string>1280x960@16</string>
</syntaxhighlight>
</syntaxhighlight>
Here is a helper script that rotates two templates of <code>EFI/OC/'''config-{1920x1080,1280x960}.plist'''</code> - note you need to prepare the two templates.
Here is a helper script that rotates two templates of <code>EFI/OC/'''config-{1920x1080,1280x960}.plist'''</code> - note you need to prepare the templates that will be manipulated by the script.
<syntaxhighlight lang="shell" line="1">
<syntaxhighlight lang="shell" line="1">
nano ~/bin/change-resolution.sh
nano ~/bin/change-resolution.sh
</syntaxhighlight>
</syntaxhighlight>
<syntaxhighlight lang="bash" line="1" class="code-continue">
<syntaxhighlight lang="bash" line="1" class="code-continue mlw-pre-max-height-320">
#!/bin/bash
#!/bin/bash


Line 95: Line 138:
# https://unix.stackexchange.com/a/269080
# https://unix.stackexchange.com/a/269080
FUNC=$(declare -f main)
FUNC=$(declare -f main)
sudo bash -c "$FUNC; main"
sudo bash -c "$FUNC; main $@"
</syntaxhighlight>
</syntaxhighlight>
<syntaxhighlight lang="shell" line="1" class="mlw-shell-gray">
<syntaxhighlight lang="shell" line="1" class="mlw-shell-gray">
Line 101: Line 144:
</syntaxhighlight>
</syntaxhighlight>


Using other Display adapter types as "Standard VGA" and "VirGL GPU" will allow you to change the resolution from the MacOS guest itself, but the Spice connection is much better than the VNC connection that you can use with these devices. Using these devices could be helpful if you using [https://www.teamviewer.com/en/download/mac-os/ Team Viewer] as client.
Using other Display adapter types as "Standard VGA", "VMWare compatible" and "VirtIO-GPU" will allow you to change the resolution from the MacOS guest itself, but the Spice connection is much better than the VNC connection that you can use with these devices. Using these devices could be helpful if you using [https://www.teamviewer.com/en/download/mac-os/ Team Viewer] as client.
 
=== Change the OpenCore's Picker Settings ===
You can change the OpenCore's boot menu Picker options, via <code>'''config.plist'''</code> file in the following way:
*Use [https://github.com/corpnewt/MountEFI MountEFI] and mount the EFI.
*Use the MacOS's file manager and navigate to the mounted EFI partition.
*Edit the file <code>EFI/OC/'''config.plist'''</code> and modify the following directives:<syntaxhighlight lang="xml">
<key>ShowPicker</key>
<true/>                <!-- Set this to 'false' if you want to disable the picker -->
<key>Timeout</key>
<integer>5</integer>  <!-- 0 will disable the timeout, currently it is 5 seconds -->
</syntaxhighlight>
All available options are described within the [https://github.com/thenickdude/KVM-Opencore/releases OpenCore's Configuration manual (PDF file)]. Here is a video guide: [https://youtu.be/tcsGopQLIUU How to skip OpenCore boot picker]. Also for a convenience you can use the [https://mackie100projects.altervista.org/opencore-configurator/ OpenCore Configurator] tool.


== Switch the Resolution while using SPICE/QXL ==
=== Enable the Audio while using SPICE/QXL ===
In my case getting the audio operational is critical, because I'm actually doing this setup for browser compatibility tests of web pages and other applications. Otherwise the flash videos and HTML5 videos fails in Safari.
In my case getting the audio operational is critical, because I'm actually doing this setup for browser compatibility tests of web pages and other applications. Otherwise the flash videos and HTML 5 videos fails in Safari.


So I've tested the following successful solutions:
So I've tested the following successful solutions:


* Setup dummy output by the help of [https://discuss.bitrise.io/t/how-to-create-a-virtual-audio-output-device-on-mac-os-stacks/1119?u=viktorbenei Soundflower] ([https://www.youtube.com/watch?v=8IQNhXWaaO0 YouTube]).
* Setup dummy output by the help of [https://discuss.bitrise.io/t/how-to-create-a-virtual-audio-output-device-on-mac-os-stacks/1119?u=viktorbenei Soundflower] ([https://www.youtube.com/watch?v=8IQNhXWaaO0 YouTube]):<syntaxhighlight lang="shell" line="1">
* Use Team Viewer: Install team [https://www.teamviewer.com/en/download/mac-os/ Team Viewer Host] application (or the full application) it will set an Aggregate audio device. Setup the application to accept direct LAN connections and use Team Viewer as client to connect to the guest via its IP. I think having dummy output setup by Soundflower increases the audio quality via Team Viewer.
brew install Caskroom/cask/soundflower
</syntaxhighlight>After that open <u>System Settings</u> and at the bottom of the <u>Privacy & Security</u> menu allow the usage of <u>Soundflower</u> and ''restart''.
* Use Team Viewer: Install team [https://www.teamviewer.com/en/download/mac-os/ Team Viewer Host] application (or the full application) it will set an Aggregate audio device. Setup the application to accept direct LAN connections and use Team Viewer as client to connect to the guest via its IP. I think having dummy output setup by Soundflower increases the audio quality and availability via Team Viewer.


* Use Spice client:  
* Use Spice client:  
Line 115: Line 172:
** Setup VoodooHDA as it is shown in the following section.
** Setup VoodooHDA as it is shown in the following section.


== Change the OpenCore's Picker Settings ==
=== Setup VoodooHDA and Make the Audio Available within Spice ===
You can change the OpenCore's boot menu Picker options, via <code>'''config.plist'''</code> file in the following way:
A good clue how to install VoodooHDA on MacOS 13 Venture is provide by Yahgoo at GitHub: [https://github.com/yahgoo/installVoodooHDA4BSnMont/blob/main/README.md Install VoodooHDA for Big Sur and Monterey]. Here are the exact steps that I've performed.
 
'''1.''' First we will install the latest built version (currently 2.9.2) provided within the Chris1111's repository: [https://github.com/chris1111/VoodooHDA-OC/releases/tag/V1 VoodooHDA OC]. This is the easiest way to get VoodooHDA's <u>preferences pane</u> operational. The repository is little bit outdated but the PrefPane is not changed since 2018. At all this step is '''optional'''.
 
Download the file [https://github.com/chris1111/VoodooHDA-OC/files/5752212/VoodooHDA.OC.dmg.zip VoodooHDA OC.dmg.zip]. Then run the contained package. You will need to open  <u>System Settings</u> and at the bottom of the <u>Privacy & Security</u> menu allow the usage of <u>VoodooHDA OC.dmg</u>. After that go back to the file and run the package again. Follow the [https://www.youtube.com/watch?v=GBDCQBqf4_k video guide] provided by the author. Note you may need interact again with <u>System Settings</u> > <u>Privacy & Security</u>.
 
'''1.''' Reboot the system and within OpenCore's Picker choice Recovery mode. Then disable [https://developer.apple.com/documentation/security/disabling_and_enabling_system_integrity_protection/ Disable System Integrity Protection Temporarily] otherwise later when we need to use <code>kmutil</code> you will expire the error [https://developer.apple.com/forums/thread/711765 "Bad code signature"]. Once you are in the recovery mode, launch <u>Terminal</u> from the <u>Utilities</u> menu (from the top bar). and execute the following commands.<syntaxhighlight lang="shell" line="1" class="root-prompt">
csrutil clear
csrutil disable
csrutil authenticated-root disable
reboot
</syntaxhighlight>'''3.''' After the reboot use [https://github.com/corpnewt/MountEFI MountEFI] or mount EFI manually as it is shown below. Use <code>diskutil list</code> to find which is your EFI device - in my case it is <code>disk0s1</code>.<syntaxhighlight lang="shell" line="1">
sudo mkdir -p /Volumes/efi
sudo mount -t msdos /dev/disk0s1 /Volumes/efi
</syntaxhighlight>'''4.''' Then use the file explorer and navigate to the <code>EFI/OC</code> directory.
 
'''5.''' Use the [https://mackie100projects.altervista.org/opencore-configurator/ OpenCore Configurator] app and open the file <code>EFI/OC/'''config.plist'''</code>. You will need to open <u>System Settings</u> and at the bottom of the <u>Privacy & Security</u> menu allow the usage of <u>OpenCore Configurator</u>.
 
'''6.''' Within the OpenCore Configurator navigate to the <u>NVRAM</u> section and find the entry <code>csr-active-config</code>. Make sure  its value is  <code>0x0285</code> or <code>000285</code>. (My original value was 260F and to be honest haven't tried the following steps without changing it.) Save the file and close the configurator application.
 
'''7.''' Download [https://sourceforge.net/projects/voodoohda/ '''VoodooHDA''']. At the time I'm writing the article the latest version is '''3.0.1'''.


*Use [https://github.com/corpnewt/MountEFI MountEFI] and mount the EFI.
'''8.''' Open a terminal window and execute the following commands.<syntaxhighlight lang="shell" line="1">
* Use the MacOS's file manager and navigate to the mounted EFI partition.
sudo cp -R ~/Downloads/VoodooHDA.kext /Volumes/efi/EFI/OC/Kexts
* Edit the file <code>EFI/OC/'''config.plist'''</code> and modify the following directives:<syntaxhighlight lang="xml">
sudo cp -R ~/Downloads/VoodooHDA.kext /Library/Extensions
<key>ShowPicker</key>
</syntaxhighlight>
<true/>                <!-- Set this to 'false' if you want to disable the picker -->
'''9.''' Run the following command.<syntaxhighlight lang="shell" line="1">
<key>Timeout</key>
sudo kmutil load -p /Library/Extensions/voodooHDA.kext
<integer>5</integer>  <!-- 0 will disable the timeout, currently it is 5 seconds -->
</syntaxhighlight>
</syntaxhighlight>
All available options are described within the [https://github.com/thenickdude/KVM-Opencore/releases OpenCore's Configuration manual (PDF file)].
Then: 1) Go to <u>System Settings</u> and at the bottom of the <u>Privacy & Security</u> menu allow the usage of <u>VoodooHDA</u>. 2) Restart the MacOS.  


== Download Links ==
'''10.''' '''That's it.''' After the reboot the sound controller should be available:
* RuTracker.org: [https://rutracker.org/forum/viewtopic.php?t=6260750 <nowiki>macOS Ventura 13.0 Beta 8 (22A5352e) [ISO] [Intel/Apple]</nowiki>]
 
* Corpnewt at GitHub: [https://github.com/corpnewt/MountEFI MountEFI]
* Check  <u>System Settings</u> > <u>Sound</u>, and <u>System Information</u> > <u>Audio</u>.
* Thenickdude at GitHub: [https://github.com/thenickdude/KVM-Opencore/releases KVM-Opencore]
* Check the sound via a Spice connection.


== MacOS usage references: ==
== References ==


* Ask Different: [https://apple.stackexchange.com/questions/234410/does-macos-have-equivalent-command-line-tools-like-lshw-or-lspci-for-enumera Does macOS have equivalent command line tools like <code>lshw</code> or <code>lspci</code>?]
=== Resouces ===
* Sickcodes at GitHub: [https://github.com/sickcodes/osx-optimizer OSX-optimizer] (i.e. Skip the GUI login screen..)
* RuTracker.org: [https://rutracker.org/forum/viewtopic.php?t=6260750 <nowiki>MacOS Ventura 13.0 Beta 8 [ISO] [Intel/Apple]</nowiki>]
*
* Corpnewt at GitHub: [https://github.com/corpnewt/MountEFI MountEFI]
* Thenickdude at GitHub: [https://github.com/thenickdude/KVM-Opencore/releases KVM OpenCore]
* Softpedia: [https://mac.softpedia.com/get/System-Utilities/Hackintool.shtml Hackintool (mac) download]
* Mackie 100 projects: [https://mackie100projects.altervista.org/opencore-configurator/ OpenCore Configurator]
* Source Forge: [https://sourceforge.net/projects/voodoohda/ VoodooHDA]
* Chris1111 at GitHub: [https://github.com/chris1111/VoodooHDA-2.9.2-Clover VoodooHDA-2.9.2-Clover] | [https://github.com/chris1111/VoodooHDA-OC '''VoodooHDA-OpenCore'''] > [https://github.com/chris1111/VoodooHDA-OC/releases/tag/V1 Download]
** InstanelyMac: [https://www.insanelymac.com/forum/topic/314406-voodoohda-301/page/21/ VoodooHDA 3.0.1 Discussion]


== Misc References ==
=== MacOS usage ===
* Digital Ocean: [https://www.digitalocean.com/community/tutorials/how-to-install-and-use-homebrew-on-macos How To Install and Use Homebrew on macOS]
* Ask Different: [https://apple.stackexchange.com/questions/234410/does-macos-have-equivalent-command-line-tools-like-lshw-or-lspci-for-enumera Does MacOS have equivalent command line tools like <code>lshw</code> or <code>lspci</code>?]
* Sickcodes at GitHub: [https://github.com/sickcodes/osx-optimizer OSX-optimizer] (i.e. Skip the GUI login screen...)
*The Mac Admin: [https://themacadmin.com/2012/02/15/mounting-the-efi-boot-partition-on-mac-os-x/ Mounting the EFI Boot Partition on MacOS X]
*Rocket Yard: [https://eshop.macsales.com/blog/52138-how-to-make-your-drive-icons-show-up-in-macos/ How to make your drive icons show up in MacOS]


=== Miscellaneous ===
* Another useful guide provided by Austin's Nerdy Things:
* Another useful guide provided by Austin's Nerdy Things:
** YouTube: [https://www.youtube.com/watch?v=HBAPscDD30M How-to: Install MacOS Monterey in Proxmox 7 (Hackintosh)]
** YouTube: [https://www.youtube.com/watch?v=HBAPscDD30M How-to: Install MacOS Monterey in Proxmox 7 (Hackintosh)]
** Guide: [https://www.nicksherlock.com/2021/10/installing-macos-12-monterey-on-proxmox-7/ Installing macOS 12 “Monterey” on Proxmox 7]
** Guide: [https://www.nicksherlock.com/2021/10/installing-macos-12-monterey-on-proxmox-7/ Installing MacOS 12 Monterey on Proxmox 7]
* Nicholas Sherlock: [https://www.nicksherlock.com/2018/11/my-macos-vm-proxmox-setup/ My MacOS Monterey / Proxmox setup]
* Mac Ports: [https://www.macports.org/install.php Quick start] | [https://ports.macports.org/port/spice-server/ spice-server]
* Mac Ports: [https://www.macports.org/install.php Quick start] | [https://ports.macports.org/port/spice-server/ spice-server]
*
*Unix and Linux: [https://unix.stackexchange.com/a/217947 Long line wrapping in Nano]
*ProxmoxVE Wiki: [[pve:Manual:_qm.conf|Manual: qm.conf]]
*ProxmoxVE Wiki: [[pve:SPICE|SPICE]]


<noinclude>
<noinclude>
Line 151: Line 242:
{{devStage  
{{devStage  
  | Прндл  = Proxmox
  | Прндл  = Proxmox
  | Стадий = 3
  | Стадий = 6
  | Фаза  = Разработване
  | Фаза  = Утвърждаване
  | Статус = Разработван
  | Статус = Утвърден
  | ИдтПт  = Spas
  | ИдтПт  = Spas
  | РзбПт  = {{REVISIONUSER}}
  | РзбПт = Spas
| АвтПт  = Spas
| УтвПт = {{REVISIONUSER}}
  | ИдтДт  = 22.10.2022
  | ИдтДт  = 22.10.2022
  | РзбДт  = {{Today}}
  | РзбДт = 28.10.2022
| АвтДт  = 28.10.2022
| УтвДт = {{Today}}
  | ИдтРв  = [[Special:Permalink/32100|32100]]
  | ИдтРв  = [[Special:Permalink/32100|32100]]
  | РзбРв  = {{REVISIONID}}
  | РзбРв = [[Special:Permalink/32155|32155]]
| АвтРв  = [[Special:Permalink/32158|32158]]
| РзАРв  = [[Special:Permalink/32145|32145]]
| УтвРв = {{REVISIONID}}
| РзУРв  = [[Special:Permalink/32147|32147]]
}}
}}
</div>
</div>
</noinclude>
</noinclude>

Latest revision as of 21:36, 15 April 2023

Prox­mox Set­up and Ma­cOS In­stal­la­tion

I've fol­lowed the guide pro­vid­ed by i12bretro and have in­stalled Ma­cOS 13 Ven­ture on my PVE:

Dur­ing the in­stal­la­tion I've used the re­sources pro­vid­ed with­in the re­sources sec­tion. Here is shown my fi­nal con­fig­u­ra­tion file.

cat /etc/pve/qemu-server/207.conf
agent: 0
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 -cpu host,kvm=on,vendor=GenuineIntel,+kvm_pv_unhalt,+kvm_pv_eoi,+hypervisor,+invtsc,+pcid,+xsave,+xsaveopt,check
audio0: device=intel-hda,driver=spice
bios: ovmf
boot: order=virtio0
cores: 4
cpu: host
efidisk0: ssd-1TB:207/vm-207-disk-0.qcow2,efitype=4m,size=528K
machine: q35
memory: 16384
meta: creation-qemu=7.0.0,ctime=1666276060
name: MacOS.13
net0: vmxnet3=C2:63:A3:4E:7E:E7,bridge=vmbr0,firewall=1
numa: 1
ostype: other
scsihw: virtio-scsi-pci
smbios1: uuid=ac933204-a2a1-4915-aeee-60259bfb3fc1
sockets: 4
spice_enhancements: videostreaming=all
tablet: 1
tpmstate0: ssd-1TB:207/vm-207-disk-1.raw,size=4M,version=v2.0
usb0: spice,usb3=1
usb1: spice,usb3=1
usb2: spice,usb3=1
vga: qxl,memory=128
virtio0: local-lvm:vm-207-disk-0,discard=on,size=80G
vmgenid: 64c40db4-c6f3-4c42-b9ed-95a02e08fa15
# Tested args which provide worse performance
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 -cpu Penryn,kvm=on,vendor=GenuineIntel,+kvm_pv_unhalt,+kvm_pv_eoi,+hypervisor,+invtsc,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+avx2,+aes,+fma,+fma4,+bmi1,+bmi2,+xsave,+xsaveopt,check -device intel-hda,id=sound5,bus=pci.0,addr=0x18 -device hda-micro,id=sound5-codec0,bus=sound5.0,cad=0 -device hda-duplex,id=sound5-codec1,bus=sound5.0,cad=1 -device hda-output
  • Note my Prox­mox VE host is in­stalled on Think Serv­er TD350 with In­tel Xeon E5-2673 v.3 and I do not need to pass much ad­di­tion­al CPU args.
  • I've tried with dif­fer­ent In­tel proces­sor types and found that the Pen­ryn type (used in the most in­ter­net guides) caus­es much greater CPU us­age at the host lev­el. IMO Ivy­Bridge is bet­ter choice. Cur­rent­ly I'm us­ing Hos type – in my case it is Haswell-EP ar­chi­tec­ture.
  • In ad­di­tion­al I've found that the num­ber of the cores can't be greater than 4 (but you can in­crease the sock­ets if you want to pass more cores), oth­er­wise the VM hangs at boot.

Af­ter mov­ing the Prox­moxVE host to a ma­chine based on AMD Ryzen 9 5900X 12-Core Proces­sor, I was need to change some op­tions. The cor­rect args con­fig­u­ra­tion I found with­in the sec­tion "Up­grad­ing from ma­cOS Mon­terey" of the ar­ti­cle "In­stalling ma­cOS 13 Ven­tu­ra on Prox­mox 7.2" in Nicholas Sherlock's blog. Be­low is my cur­rent con­fig­u­ra­tion file.

cat /etc/pve/qemu-server/1050.conf
agent: 1
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
audio0: device=intel-hda,driver=spice
bios: ovmf
boot: order=virtio0
cores: 8
cpu: Haswell
cpuunits: 1024
efidisk0: local-lvm:vm-1050-disk-0,efitype=4m,size=4M
machine: q35
memory: 8196
meta: creation-qemu=7.0.0,ctime=1666276060
name: MacOS.13
net0: vmxnet3=26:B2:9C:37:29:26,bridge=vmbr0,firewall=1
numa: 0
onboot: 1
ostype: other
scsihw: virtio-scsi-pci
smbios1: uuid=de4a7e04-a553-413d-a136-a7218bdf95ae
sockets: 1
spice_enhancements: videostreaming=all
tablet: 1
tpmstate0: local-lvm:vm-1050-disk-1,size=4M,version=v2.0
usb0: spice,usb3=1
usb1: spice,usb3=1
usb2: spice,usb3=1
vga: qxl,memory=128
virtio0: local-lvm:vm-1050-disk-2,discard=on,size=80G
vmgenid: 1a90942a-6107-4ce6-ba04-50db6f01c986

Post In­stal­la­tion Set­up

Cur­rent­ly I'm us­ing Spice/​​​QXL for dis­play dri­ver. Note there is not Ma­cOS guest tool avail­able and this is the rea­son we can't change the res­o­lu­tion with­in the guest.

Switch the Res­o­lu­tion while us­ing SPICE/QXL

We can set dif­fer­ent res­o­lu­tions with­in the Open­Core EFI set­tings by the fol­low­ing steps (as ref­er­ence see the sec­tion Con­fig­ur­ing Boot­ing With­out Open­Core Mount­ed from the man­u­al cit­ed above).

  • Use Moun­tE­FI and mount the EFI.
  • Use the MacOS's file man­ag­er and nav­i­gate to the mount­ed EFI par­ti­tion.
  • Ed­it the file EFI/OC/config.plist – find and mod­i­fy the fol­low­ing <string> di­rec­tive, note on­ly one res­o­lu­tion will be ac­cept­ed and the fall­back res­o­lu­tion is that de­fined in the OVMF EFI set­tings.
    <key>Resolution</key>
    <string>1920x1080@32</string>
    
    <string>1280x960@32</string>
    
    <string>1280x960@16</string>
    

Here is a helper script that ro­tates two tem­plates of EFI/OC/config-{1920x1080,1280x960}.plist – note you need to pre­pare the tem­plates that will be ma­nip­u­lat­ed by the script.

nano ~/bin/change-resolution.sh
#!/bin/bash

# List the available devices
# diskutil list

function main() {
    if [[ ! -z ${1+x} ]]
    then
        diskutil unmount /Volumes/efi 2>/dev/null
        mkdir -p /Volumes/efi
        mount -t msdos /dev/disk0s1 /Volumes/efi
        sleep 1
    
        if [[ -f /Volumes/efi/EFI/OC/config-${1}.plist ]]
        then
    	echo "Template in use: /Volumes/efi/EFI/OC/config-${1}.plist"
            sleep 1
    
            cp /Volumes/efi/EFI/OC/{config-$1,config}.plist
    
            sleep 1
            diskutil unmount /Volumes/efi
            reboot
            exit
        fi
        
        diskutil unmount /Volumes/efi
    fi
    
    sleep 1
    echo "Usage: $0 '1920x1080|1280x960'"
}

# https://unix.stackexchange.com/a/269080
FUNC=$(declare -f main)
sudo bash -c "$FUNC; main $@"
change-resolution.sh "1280x960"

Us­ing oth­er Dis­play adapter types as "Stan­dard VGA", "VMWare com­pat­i­ble" and "Vir­tIO-GPU" will al­low you to change the res­o­lu­tion from the Ma­cOS guest it­self, but the Spice con­nec­tion is much bet­ter than the VNC con­nec­tion that you can use with these de­vices. Us­ing these de­vices could be help­ful if you us­ing Team View­er as client.

Change the OpenCore's Pick­er Set­tings

You can change the OpenCore's boot menu Pick­er op­tions, via config.plist file in the fol­low­ing way:

  • Use Moun­tE­FI and mount the EFI.
  • Use the MacOS's file man­ag­er and nav­i­gate to the mount­ed EFI par­ti­tion.
  • Ed­it the file EFI/OC/config.plist and mod­i­fy the fol­low­ing di­rec­tives:
    <key>ShowPicker</key>
    <true/>                <!-- Set this to 'false' if you want to disable the picker -->
    <key>Timeout</key>
    <integer>5</integer>   <!-- 0 will disable the timeout, currently it is 5 seconds -->
    

All avail­able op­tions are de­scribed with­in the OpenCore's Con­fig­u­ra­tion man­u­al (PDF file). Here is a video guide: How to skip Open­Core boot pick­er. Al­so for a con­ve­nience you can use the Open­Core Con­fig­u­ra­tor tool.

En­able the Au­dio while us­ing SPICE/QXL

In my case get­ting the au­dio op­er­a­tional is crit­i­cal, be­cause I'm ac­tu­al­ly do­ing this set­up for brows­er com­pat­i­bil­i­ty tests of web pages and oth­er ap­pli­ca­tions. Oth­er­wise the flash videos and HTML 5 videos fails in Sa­fari.

So I've test­ed the fol­low­ing suc­cess­ful so­lu­tions:

  • Set­up dum­my out­put by the help of Sound­flower (YouTube):
    brew install Caskroom/cask/soundflower
    
    Af­ter that open Sys­tem Set­tings and at the bot­tom of the Pri­va­cy & Se­cu­ri­ty menu al­low the us­age of Sound­flower and restart.
  • Use Team View­er: In­stall team Team View­er Host ap­pli­ca­tion (or the full ap­pli­ca­tion) it will set an Ag­gre­gate au­dio de­vice. Set­up the ap­pli­ca­tion to ac­cept di­rect LAN con­nec­tions and use Team View­er as client to con­nect to the guest via its IP. I think hav­ing dum­my out­put set­up by Sound­flower in­creas­es the au­dio qual­i­ty and avail­abil­i­ty via Team View­er.
  • Use Spice client:
    • Pass an au­dio de­vice from the re­mote in­stance: With­in the Spice client at­tach some USB au­dio de­vice – i.e. Blue­tooth adapter and con­nect Head­phones to that de­vice from the guest Ma­cOS. In this case you should cre­ate enough num­ber of USB de­vices which use Spice dri­ver with­in the Proxmox's VM con­fig­u­ra­tion.
    • Set­up VoodooH­DA as it is shown in the fol­low­ing sec­tion.

Set­up VoodooH­DA and Make the Au­dio Avail­able with­in Spice

A good clue how to in­stall VoodooH­DA on Ma­cOS 13 Ven­ture is pro­vide by Yah­goo at GitHub: In­stall VoodooH­DA for Big Sur and Mon­terey. Here are the ex­act steps that I've per­formed.

1. First we will in­stall the lat­est built ver­sion (cur­rent­ly 2.9.2) pro­vid­ed with­in the Chris1111's repos­i­to­ry: VoodooH­DA OC. This is the eas­i­est way to get VoodooHDA's pref­er­ences pane op­er­a­tional. The repos­i­to­ry is lit­tle bit out­dat­ed but the Pref­Pane is not changed since 2018. At all this step is op­tion­al.

Down­load the file VoodooH­DA OC​.dmg​.zip. Then run the con­tained pack­age. You will need to open Sys­tem Set­tings and at the bot­tom of the Pri­va­cy & Se­cu­ri­ty menu al­low the us­age of VoodooH­DA OC.dmg. Af­ter that go back to the file and run the pack­age again. Fol­low the video guide pro­vid­ed by the au­thor. Note you may need in­ter­act again with Sys­tem Set­tings > Pri­va­cy & Se­cu­ri­ty.

1. Re­boot the sys­tem and with­in OpenCore's Pick­er choice Re­cov­ery mode. Then dis­able Dis­able Sys­tem In­tegri­ty Pro­tec­tion Tem­porar­i­ly oth­er­wise lat­er when we need to use kmu­til you will ex­pire the er­ror "Bad code sig­na­ture". Once you are in the re­cov­ery mode, launch Ter­mi­nal from the Util­i­ties menu (from the top bar). and ex­e­cute the fol­low­ing com­mands.

csrutil clear
csrutil disable
csrutil authenticated-root disable
reboot

3. Af­ter the re­boot use Moun­tE­FI or mount EFI man­u­al­ly as it is shown be­low. Use disku­til list to find which is your EFI de­vice – in my case it is disk0s1.

sudo mkdir -p /Volumes/efi
sudo mount -t msdos /dev/disk0s1 /Volumes/efi

4. Then use the file ex­plor­er and nav­i­gate to the EFI/OC di­rec­to­ry.

5. Use the Open­Core Con­fig­u­ra­tor app and open the file EFI/OC/config.plist. You will need to open Sys­tem Set­tings and at the bot­tom of the Pri­va­cy & Se­cu­ri­ty menu al­low the us­age of Open­Core Con­fig­u­ra­tor.

6. With­in the Open­Core Con­fig­u­ra­tor nav­i­gate to the NVRAM sec­tion and find the en­try csr-ac­tive-con­fig. Make sure its val­ue is 0x0285 or 000285. (My orig­i­nal val­ue was 260F and to be hon­est haven't tried the fol­low­ing steps with­out chang­ing it.) Save the file and close the con­fig­u­ra­tor ap­pli­ca­tion.

7. Down­load VoodooH­DA. At the time I'm writ­ing the ar­ti­cle the lat­est ver­sion is 3.0.1.

8. Open a ter­mi­nal win­dow and ex­e­cute the fol­low­ing com­mands.

sudo cp -R ~/Downloads/VoodooHDA.kext /Volumes/efi/EFI/OC/Kexts
sudo cp -R ~/Downloads/VoodooHDA.kext /Library/Extensions

9. Run the fol­low­ing com­mand.

sudo kmutil load -p /Library/Extensions/voodooHDA.kext

Then: 1) Go to Sys­tem Set­tings and at the bot­tom of the Pri­va­cy & Se­cu­ri­ty menu al­low the us­age of VoodooH­DA. 2) Restart the Ma­cOS.

10. That's it. Af­ter the re­boot the sound con­troller should be avail­able:

  • Check Sys­tem Set­tings > Sound, and Sys­tem In­for­ma­tion > Au­dio.
  • Check the sound via a Spice con­nec­tion.

Ref­er­ences

Re­souces

Ma­cOS us­age

Mis­cel­la­neous