Skip to content

Commit

Permalink
MacPro5,1 Snow Leopard -> Mojave Instructions OC/DUDK
Browse files Browse the repository at this point in the history
  • Loading branch information
royalgraphx committed Jun 14, 2024
1 parent ab9555c commit fcd25fd
Show file tree
Hide file tree
Showing 210 changed files with 5,079 additions and 142 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "DarwinFetch"]
path = DarwinFetch
url = https://github.com/royalgraphx/DarwinFetch
[submodule "DarwinUDK"]
path = DarwinUDK
url = https://github.com/royalgraphx/DUDK-Firmware.git
57 changes: 57 additions & 0 deletions DarwinKVM-Debian.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<!--
Copyright (c) 2024 RoyalGraphX, BSD 3-Clause License
Provided to hopefully help those on debian not have to manually
find the OVMF path, as its different on various installs...
-->

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>DarwinKVM</name>
<uuid>c44e7384-bc74-4d3e-b6ce-5a6148296fe8</uuid>
<memory unit='KiB'>8388608</memory>
<currentMemory unit='KiB'>8388608</currentMemory>
<memoryBacking>
<nosharepages/>
</memoryBacking>
<vcpu placement='static'>8</vcpu>
<os>
<type arch='x86_64' machine='q35'>hvm</type>
<loader readonly='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
<nvram>/var/lib/libvirt/qemu/nvram/DarwinKVM_VARS.fd</nvram>
<boot dev="hd"/>
<bootmenu enable='yes'/>
</os>
<features>
<acpi/>
<apic/>
</features>
<cpu mode='host-passthrough' check='none' migratable='on'>
<topology sockets='1' dies='1' cores='4' threads='2'/>
<cache mode='passthrough'/>
</cpu>
<clock offset='utc'>
<timer name='rtc' tickpolicy='catchup'/>
<timer name='pit' tickpolicy='delay'/>
<timer name='hpet' present='yes'/>
<timer name='tsc' present='yes' mode='native'/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<memballoon model='none'/>
</devices>
<qemu:commandline>
<qemu:arg value='-global'/>
<qemu:arg value='ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off'/>
<qemu:arg value='-device'/>
<qemu:arg value='isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc'/>
<qemu:arg value='-usb'/>
<qemu:arg value='-device'/>
<qemu:arg value='usb-tablet'/>
<qemu:arg value='-device'/>
<qemu:arg value='usb-kbd'/>
<qemu:arg value='-cpu'/>
<qemu:arg value='Cascadelake-Server,vendor=GenuineIntel'/>
</qemu:commandline>
</domain>
7 changes: 1 addition & 6 deletions DarwinLegacyKVM.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,8 @@
<nosharepages/>
</memoryBacking>
<vcpu placement='static'>8</vcpu>
<os firmware='efi'>
<os>
<type arch='x86_64' machine='q35'>hvm</type>
<firmware>
<feature enabled='no' name='enrolled-keys'/>
<feature enabled='no' name='secure-boot'/>
</firmware>
<loader readonly='yes' type='pflash'>/usr/share/DarwinUDK/x64/DUDK_CODE.fd</loader>
<nvram template='/usr/share/DarwinUDK/x64/DUDK_VARS.fd'>/var/lib/libvirt/qemu/nvram/DarwinLegacyKVM_VARS.fd</nvram>
<boot dev="hd"/>
Expand All @@ -42,7 +38,6 @@
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<watchdog model='itco' action='none'/>
<memballoon model='none'/>
</devices>
<qemu:commandline>
Expand Down
1 change: 1 addition & 0 deletions DarwinUDK
Submodule DarwinUDK added at 6f01fe
3 changes: 2 additions & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ description: An advanced guide for running Mac OS / Mac OS X / macOS on QEMU/KVM
theme: just-the-docs
color_scheme: custom
favicon_ico: "/assets/favicon.ico"
nav_sort: case_sensitive

url: https://royalgraphx.github.io/DarwinKVM/docs

Expand Down Expand Up @@ -77,4 +78,4 @@ aux_links:
- "//github.com/royalgraphx/DarwinKVM/tree/main"

# Makes Aux links open in a new tab. Default is false
aux_links_new_tab: false
aux_links_new_tab: false
2 changes: 1 addition & 1 deletion docs/_includes/footer_custom.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
DarwinKVM Docs Version 2.0.0~prerelease</br>
Copyright &copy; 2024 RoyalGraphX. Distributed by a <a href="https://github.com/royalgraphx/DarwinKVM/blob/main/LICENSE">BSD 3-Clause License</a>.</br>
Last Modified: Tues, 11 Jun 2024 4:38:40 CDT
Last Modified: Thu, 13 Jun 2024 11:38:40 CDT
37 changes: 25 additions & 12 deletions docs/_infocenter/01-FileOverview/01-ACPITables.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,44 @@ nav_order: 2
# ACPI Tables
#### This section has been derived from the <a href="https://dortania.github.io/Getting-Started-With-ACPI/">Getting Started with ACPI</a> guide. It may be out of date. Please refer to latest documentation when possible.

{: .note }
<br>

{: .important }
So what are DSDTs and SSDTs? Well, these are tables present in your firmware that outline hardware devices like USB controllers, CPU threads, embedded controllers, system clocks and such. A DSDT (Differentiated System Description Table) can be seen as the body holding most of the info with smaller bits of info being passed by the SSDT (Secondary System Description Table). You can think of the DSDT as the building blueprints with SSDTs being sticky notes outlining extra details to the project.

#### You can read more about ACPI and it's specs [here](https://uefi.org/sites/default/files/resources/ACPI_Spec_6_4_Jan22.pdf).
## So What would we need for a virtual machine?

# What would we need?
Mac OS X / macOS can be very picky about the devices present in the DSDT and so our job is to correct it. The main devices that need to be corrected for Darwin to work properly depends on your installation target:

macOS can be very picky about the devices present in the DSDT and so our job is to correct it. The main devices that need to be corrected for macOS to work properly:
## For Catalina (10.15.7) and above, we'll need:

- Embedded controller (EC)
- macOS Catalina+ requires a device named EC to be present, so we create a dummy EC. The USBX devices (See next) also requires an EC device to work.
- Mac OS X / macOS requires a device named EC to be present, so we create a dummy EC. The USBX devices (See next) also require an EC device to work.
- USBX
- This sets the correct USB power properties for charging devices like phones.
- This sets the correct USB power properties for charging devices like iPhones.
- Plugin type
- This generally allows the use of XCPM providing native CPU power management on Intel CPUs. Our version will enable VMPlatformPlugin XCPM, exactly like a Parallels VM.

For our Virtual Machine use case, we will be emulating an Intel Cascade Lake CPU <span style="color: #ffab52;">so regardless of the host architecture, the only ACPI's we require to boot macOS will be SSDT-EC-USBX and SSDT-PLUG.</span>
For our use case on MacPro7,1 we will be emulating an Intel Cascade Lake CPU <span style="color: #ffab52;">so regardless of the host architecture, the only ACPI's we require to boot will be SSDT-EC-USBX and SSDT-PLUG.</span>

## For Mojave (10.14.4) and older, we'll need:

- Embedded controller (EC)
- Mac OS X requires a device named EC to be present, so we create a dummy EC.

Thanks to [ExtremeXT](https://github.com/ExtremeXT) for allowing me to include his manually created SSDT-EC-USBX which combines them into a single file, as well as the included SSDT-PLUG file. We've both tested it and it works as expected, and I use it for my daily machine so I'm confident including it, feel free to manually make your own or possibly try the ones from Acidanthera! As long as you complete this ACPI section, you can go ahead to the next step.
For our use case on MacPro5,1 we will be emulating an Intel Westmere E56XX CPU <span style="color: #ffab52;">so regardless of the host architecture, the only ACPI file we require to boot will be SSDT-EC.</span>

You can view the baremetal CPU ACPI requirements by generation [here](https://dortania.github.io/Getting-Started-With-ACPI/ssdt-platform.html#desktop).
<hr>

{: .note }
Cascade Lake supersedes Skylake although not shown on the chart.
Thanks to [ExtremeXT](https://github.com/ExtremeXT) for allowing me to include his manually created SSDT-EC-USBX which combines them into a single file, as well as the included SSDT-PLUG file.

<h3><span style="color: #ffab52;">The required files can be found in the DarwinOCPkg/X64/EFI/OC/ACPI folder.</span></h3>
Thanks to [CorpNewt](https://github.com/CorpNewt) for [SSDTTime](https://github.com/corpnewt/SSDTTime), which was used on a DarwinKVM VM booted in to Arch Linux, to dump and create SSDT-EC.

I've tested all files and it works as expected, and I use it for my daily machine so I'm confident including it, feel free to manually make your own or possibly try the ones from Acidanthera! As long as you complete this ACPI section for your target installation, you can go ahead to the next step.

<h3><span style="color: #ffab52;">The required files can be found in the DarwinOCPkg/Docs folder.</span></h3>

## You can now continue to the next <a href="../02-Drivers">page</a>.

#### If you're interested, you can read more about ACPI and it's specs [here](https://uefi.org/sites/default/files/resources/ACPI_Spec_6_4_Jan22.pdf).
#### You can also view the baremetal CPU ACPI requirements by generation [here](https://dortania.github.io/Getting-Started-With-ACPI/ssdt-platform.html#desktop).
20 changes: 17 additions & 3 deletions docs/_infocenter/01-FileOverview/02-Drivers.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,30 @@ nav_order: 3
# Drivers
#### This section has been derived from the <a href="https://dortania.github.io/OpenCore-Install-Guide/installer-guide/opencore-efi.html">Adding The Base OpenCore Files</a> guide. It may be out of date. Please refer to latest documentation when possible.

<br>

Now something you'll notice is that it comes with a bunch of files in Drivers and Tools folder, we don't want most of these:

- Keep the following from Drivers (if applicable):
Keep the following from Drivers (if applicable):

| Driver | Status | Description |
| ----- | ----- | ----- |
| OpenRuntime.efi | Required | Required for fixing NVRAM, power management, RTC, memory mapping etc. |
| OpenPartitionDxe.efi | Required | Only required if you want Mojave or earlier, required for MacPro5,1 |
| ResetNvramEntry.efi | Required | Required to reset the system's NVRAM |
| OpenHfsPlus.efi | Optional | Open sourced HFS+ driver, but slower than Apple's proprietary driver |
| OpenHfsPlus.efi | Optional | Open sourced HFS+ driver, but slower than Apple's proprietary driver. Do not use on Mojave or older. |

Those are already base files included in the repository. You'll have to check with your hardware to see if you need anything additional.

As outlined in [Gathering files -> Firmware Drivers](https://dortania.github.io/OpenCore-Install-Guide/ktext.html#firmware-drivers) you will see a table that states [HfsPlus.efi](https://github.com/acidanthera/OcBinaryData/blob/master/Drivers/HfsPlus.efi) is a required Driver.

Personally from my experience, I've been fine using OpenHfsPlus.efi on Catalina+ MacPro7,1 but you should first try with [HfsPlus.efi](https://github.com/acidanthera/OcBinaryData/blob/master/Drivers/HfsPlus.efi), please download and add that to your OpenCore EFI, per Dortania guidelines.

There are already base files included in the repository. You'll have to check with your hardware to see if you need anything additional. As outlined in [Gathering files -> Firmware Drivers](https://dortania.github.io/OpenCore-Install-Guide/ktext.html#firmware-drivers) you will see a table that states [HfsPlus.efi](https://github.com/acidanthera/OcBinaryData/blob/master/Drivers/HfsPlus.efi) is a required Driver. Personally from my experience, I've been fine using OpenHfsPlus.efi but you should first try with [HfsPlus.efi](https://github.com/acidanthera/OcBinaryData/blob/master/Drivers/HfsPlus.efi), please download and add that to your OpenCore EFI.
Other applicable drivers that are not included but may be required:

| Driver | Status | Description |
| ----- | ----- | ----- |
| [HfsPlusLegacy.efi](https://github.com/acidanthera/OcBinaryData/blob/master/Drivers/HfsPlusLegacy.efi) | Required | Only required if you are Mojave or earlier, required for MacPro5,1 |
| [HfsPlus.efi](https://github.com/acidanthera/OcBinaryData/blob/master/Drivers/HfsPlus.efi) | Required | Apple's proprietary driver for HFS volumes, is preferred but not included OOB. Use only on MacPro7,1 Catalina+ Targets. |

## You can now continue to the next <a href="../03-Kexts">page</a>.
13 changes: 12 additions & 1 deletion docs/_infocenter/01-FileOverview/03-Kexts.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,18 @@ nav_order: 4
# Kexts
#### This section has been derived from the <a href="https://dortania.github.io/OpenCore-Install-Guide/ktext.html#kexts">Kexts</a> section via <a href="https://dortania.github.io/OpenCore-Install-Guide/ktext.html">Gathering files</a>. It may be out of date. Please refer to latest documentation when possible.

Here is a basic chart of a Kext, its use, and the status of the requirement. Check with the hardware you'll be passing through if you need any Kexts. For example, Samsung NVMe should be using NVMeFix.kext for better voltage and temperature management by macOS.
Here is a basic chart of a Kext, its use, and the status of the requirement.

For those starting off, it's highly recommended to only use the following kexts to simply boot and install Mac OS X / macOS.

| Kext | Target | Description |
| ----- | ----- | ----- |
| [AppleMCEReporterDisabler](https://github.com/acidanthera/bugtracker/files/3703498/AppleMCEReporterDisabler.kext.zip) | MacPro7,1 | Required on macOS 12.3 and later on AMD systems and dual-socket Intel systems, and on KVM VMs. |
| [Lilu](https://github.com/acidanthera/Lilu) | MacPro7,1 / MacPro5,1 | A "patch engine", a lot of kexts depend on it for patching frameworks at kernel runtime. Required for AppleALC, WhateverGreen, VirtualSMC and many other kexts. Without Lilu, they will fail to inject. |

Once you've reached the desktop and are preparing for GPU Passthrough, come back and check with the hardware you'll be passing through if you need any Kexts.

For example, Samsung NVMe should be using NVMeFix.kext for better voltage and temperature management by macOS.

| Kext | Status | Description |
| ----- | ----- | ----- |
Expand Down
2 changes: 1 addition & 1 deletion docs/_infocenter/01-FileOverview/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ has_toc: true
<img width="650" height="200" src="../../../assets/HeaderOCOverview.png">
</p>

<h3 align="center">A quick overview of all the folders in OpenCore!</h3>
<h3 align="center">A quick overview of all the folders in OpenCore!</h3>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ nav_order: 4
OpenCore Menu, shows recoveryOS detected.

{: .headsup }
Booting from the RecoveryOS image on the OpenCore Disk Image, is known to take anywhere from a few seconds, to a minute to load! You are not frozen. Simply wait for macOS to finish loading.
Booting from the RecoveryOS image on the OpenCore Disk Image, is known to take anywhere from a few seconds, to 2 minutes to load! You are not frozen. Simply wait for macOS to finish loading. OpenCore is copying the DMG to RAM, and this process can take a while.

<a href="https://raw.githubusercontent.com/royalgraphx/DarwinKVM/main/docs/assets/OpenCoreVMBootRecovery.png"><img src="../../../../assets/OpenCoreVMBootRecovery.png" alt=""></a>

Expand Down
28 changes: 28 additions & 0 deletions docs/_infocenter/07-XML/LEGACY/00-ImportingXML.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
layout: default
title: Importing XML
parent: DarwinLegacyKVM.xml
grand_parent: XML Import/Usage
nav_order: 1
---

# Importing XML
#### This imports a blank Virtual Machine titled "DarwinLegacyKVM" ready to be used for macOS Guests.

Run the following command in the root directory of DarwinKVM:

``virsh --connect qemu:///system define DarwinLegacyKVM.xml``

Which will now allow you to view it in Virt-Manager.

<a href="https://raw.githubusercontent.com/royalgraphx/DarwinKVM/main/docs/assets/VManTemplateImportLegacyAlt.png"><img src="../../../../assets/VManTemplateImportLegacyAlt.png" alt=""></a>

Notice this template is missing a few things you must set up.

- Has no default Display
- Has no drives configured
- Has no NIC configured

Let's go through these steps quickly.

## You can now continue to the next <a href="../01-ConfigDisplay">page</a>.
20 changes: 20 additions & 0 deletions docs/_infocenter/07-XML/LEGACY/01-ConfigDisplay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
layout: default
title: Configure Virtio Display
parent: DarwinLegacyKVM.xml
grand_parent: XML Import/Usage
nav_order: 2
---

# Configuring Virtio Display
#### This is required to have a display.

Select the "Add Hardware" button and navigate to Graphics. Select the ``Listen Type:`` to ``None``. then select the ``Finish`` button.

<a href="https://raw.githubusercontent.com/royalgraphx/DarwinKVM/main/docs/assets/VManLegacyKVMAddDisplay1.png"><img src="../../../../assets/VManLegacyKVMAddDisplay1.png" alt=""></a>

Select the Video tab on the left-hand side, and choose the ``VGA`` model.

<a href="https://raw.githubusercontent.com/royalgraphx/DarwinKVM/main/docs/assets/VManLegacyKVMAddDisplay2.png"><img src="../../../../assets/VManLegacyKVMAddDisplay2.png" alt=""></a>

## You can now continue to the next <a href="../02-ConfigDrives">page</a>.
33 changes: 33 additions & 0 deletions docs/_infocenter/07-XML/LEGACY/02-ConfigDrives.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
layout: default
title: Configure Storage Drives
parent: DarwinLegacyKVM.xml
grand_parent: XML Import/Usage
nav_order: 3
---

# Configure VirtIO Drives
#### This is required to boot OpenCore and recoveryOS.

## Adding OpenCore Disk

Select the "Add Hardware" button to bring up the Storage prompt. Select the OpenCore image via the "Manage..." button. The ``Bus type:`` should be set to SATA. Cache mode set to None, and Discard mode is set to Unmap.

<a href="https://raw.githubusercontent.com/royalgraphx/DarwinKVM/main/docs/assets/VManLegacyKVMAddSATA.png"><img src="../../../../assets/VManLegacyKVMAddSATA.png" alt=""></a>

Don't forget to set it as your boot drive.

<a href="https://raw.githubusercontent.com/royalgraphx/DarwinKVM/main/docs/assets/VManLegacyKVMSetBootDisk.png"><img src="../../../../assets/VManLegacyKVMSetBootDisk.png" alt=""></a>

## Creating a Virtual SSD for installation

{: .headsup }
If you're looking to passthrough a physical drive on your system to act as the main storage for the Virtual Machine, substitute this section. Requires macOS compatible SSD/NVMe Hardware.

To create a virtual SSD, when selecting the "Add Hardware" button to bring up the Storage prompt, there is a + button in the current libvirt images directory. You can choose any size you'd like but I suggest the standard 128G, 256GB, 512GB, 1024GB.

Here you can see me creating the disk image I'll be installing macOS on.

<a href="https://raw.githubusercontent.com/royalgraphx/DarwinKVM/main/docs/assets/VManAddVirtIOInstallation.png"><img src="../../../../assets/VManAddVirtIOInstallation.png" alt=""></a>

## You can now continue to the next <a href="../03-ConfigNIC">page</a>.
26 changes: 26 additions & 0 deletions docs/_infocenter/07-XML/LEGACY/03-ConfigNIC.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
layout: default
title: Configure NIC for Virtual Machine
parent: DarwinLegacyKVM.xml
grand_parent: XML Import/Usage
nav_order: 4
---

# Configure Virtual Machine NIC
#### <span style="color: #ffab52;">This is required to download macOS via recoveryOS</span>, as well as will be the general ethernet connection in the Virtual Machine.

## Using the Default Network

Select the "Add Hardware" button and choose the Network category on the left-hand side. You can now see your network source settings

For the default network you simply have to set the model depending on your target Mac OS X Installation.

### For Mac OS X 10.11 (El Capitan)+ utilize the ``vmxnet3`` ethernet adapter model.

<a href="https://raw.githubusercontent.com/royalgraphx/DarwinKVM/main/docs/assets/VManLegacyAddNICvmxnet3.png"><img src="../../../../assets/VManLegacyAddNICvmxnet3.png" alt=""></a>

### For older OS X Targets, utilize the Intel e1000 ethernet adapter model.

<a href="https://raw.githubusercontent.com/royalgraphx/DarwinKVM/main/docs/assets/VManLegacyAddNICe1000.png"><img src="../../../../assets/VManLegacyAddNICe1000.png" alt=""></a>

## You can now continue to the next <a href="../04-Review">page</a>.
Loading

0 comments on commit fcd25fd

Please sign in to comment.