OC4VM (OpenCore for VMware)

repository·main·Indexed 19 days ago

https://github.com/drdonk/oc4vm

A toolset for running macOS virtual machines on Intel and AMD hardware using VMware Fusion Pro 25H2 or VMware Workstation Pro 17.6 and 25H2. It utilizes OpenCore to patch the virtualization environment, enabling macOS Recovery and Intel e1000e virtual NIC compatibility for macOS Ventura and later. The project provides pre-configured templates, boot images, and specific kernel patches for AMD CPU architectures (Bulldozer, Jaguar, Zen) to ensure stability and hardware compatibility.

Tokens
2.1K
Snippets
3
Records
13
Agent score
66%

What's inside OC4VM

  1. Overview of OC4VM

    main

    OC4VM (OpenCore for VMware) provides an OpenCore disk image designed to run macOS virtual machines on Intel-based Apple Macs or PC hardware using VMware Workstation. It acts as a flexible patching system to overcome virtualization limitations, such as enabling macOS Recovery mode (which is broken in VMware's default EFI) and adding Intel e1000e virtual NIC compatibility for macOS Ventura and later.

    Supported Hypervisors:

    • VMware Fusion Pro 25H2
    • VMware Workstation Pro 17.6 and 25H2 (Windows and Linux)

    CPU Requirements: Your CPU must support the following instruction sets:

    • AVX
    • AVX2
    • F16C
    • RDRAND
  2. Understand OC4VM folder structure

    main

    The OC4VM distribution contains the following sub-folders:

    FolderFunction
    configOpenCore config.plist files for reference
    disksOpenCore boot variants in DMG and VMDK formats
    isoVMware Mac OS X and macOS guest tools ISO images
    packagesPost-install packages
    toolsOC4VM tools
    vmwareTemplate VMs for VMware (Most important folder)

    Note: The vmware folder contains the templates required to set up your virtual machine.

  3. Choose the correct PAT patch for your GPU

    main

    The mtrr_update_action - fix PAT patch is used to handle memory type range registers. You must choose one version; do not use both simultaneously.

    • Algrey's Patch (Default): Works with all GPUs and does not affect audio. It does not provide a performance boost.
    • Shaneee's Patch: Increases GPU performance on AMD GPUs. Warning: This may prevent NVIDIA GPUs from booting and can cause audio issues when using HDMI or DisplayPort audio.

    Note for TRX40 systems: These patches are not required. Disabling them may improve GPU performance. Test this on a USB drive first.

  4. Fix PCI bus enumeration on AM5 motherboards

    main

    On certain AM5 motherboards with on-board Thunderbolt/USB4 (e.g., Asus ROG Crosshair X670E Hero, Gene, Extreme; Asus ProArt X670E-Creator), macOS Ventura may fail to enumerate devices on the PCI bus if both on-board WiFi and on-board Thunderbolt are enabled.

    A specific patch is provided to bypass this issue, but it is disabled by default.

  5. Configure Zen 4 (Ryzen 7000) stability

    main
    Zen 4 systems require patching for IOPCIFamily.kext. This patch is enabled by default in this repository and is required for stability. It also enables macOS Monterey and newer support for MSI A520, B550, and X570 boards.
  6. Configure OpenCore for AMD CPU Support

    main

    To use these binary kernel patches for AMD CPUs, you must use OpenCore 0.7.1 or newer.

    Critical Requirement: You must enable the OpenCore kernel quirk ProvideCurrentCpuInfo in your config. If this quirk is not enabled, the system will not boot.

    <Kernel>
      <ProvideCurrentCpuInfo>True</ProvideCurrentCpuInfo>
    </Kernel>
  7. Upgrade an existing OC4VM macOS VM

    main

    Depending on your current version, follow the appropriate upgrade path:

    Upgrading an OC4VM 2.0 macOS VM

    1. Ensure the VM is completely shutdown.
    2. Copy the opencore.iso from the new release template folder into your existing VM's folder.

    Upgrading an OC4VM 1.x macOS VM

    Warning: There is no automated script for this upgrade due to risk. Manual steps required.

    1. Ensure the VM is shutdown and remove all snapshots.
    2. Create a full backup of the VM folder.
    3. Copy a template folder from the new OC4VM distribution to a new location.
    4. Copy your old guest's macos.vmdk into this new folder.
    5. (Optional) Compare the new template's .vmx file with your old one. If there are changes, manually copy the new lines into your existing .vmx file.
  8. Create a new macOS VM using OC4VM templates

    main

    To set up a new macOS virtual machine, use the templates provided in the vmware folder. You must choose the folder that matches your host CPU (AMD or Intel).

    Steps:

    1. Copy either the Intel or AMD template folder from the vmware directory to a new destination folder.
    2. Open the .vmx file (or the VM itself) in VMware from that new folder.
    3. Attach your macOS installation media (ISO or virtual disk) to the new VM.
    4. Power on the VM and proceed with the standard macOS installation.

    Template File Contents:

    • opencore.iso: OpenCore boot ISO image
    • macos.nvram: Preconfigured NVRAM settings
    • macos.vmx: VMware VMX settings file
    • macos.vmdk: Pre-formatted APFS virtual disk
    • macos.plist: VMware Fusion configuration file
    # Example workflow (conceptual)
    cp -r ./vmware/intel_template/ /path/to/my_new_macos_vm/
    cd /path/to/my_new_macos_vm/
    vmware /path/to/my_new_macos_vm/macos.vmx
  9. Modify Core Count patches for AMD CPUs

    main

    The algrey - Force cpuid_cores_per_package patches must be manually configured to match your physical core count. You must locate the four instances of this patch and modify the Replace value only.

    Important: Use your physical core count, not your CPU's thread count.

    Hexadecimal Core Count Reference

    Core CountHexadecimal
    4 Core04
    6 Core06
    8 Core08
    12 Core0C
    16 Core10
    24 Core18
    32 Core20

    Replace Value Mapping by macOS Version

    macOS VersionReplace Value (Base)New Value Pattern
    10.13.x, 10.14.xB8000000 0000B8 <Hex> 0000 0000
    10.15.x, 11.xBA000000 0000BA <Hex> 0000 0000
    12.x, 13.0 - 13.2.1BA000000 0090BA <Hex> 0000 0090
    13.3 +BA000000 00BA <Hex> 0000 00

    Example for a 6-core processor:

    • 10.13/14: B8 06 0000 0000
    • 10.15/11: BA 06 0000 0000
    • 12.x/13.0-13.2: BA 06 0000 0090
    • 13.3+: BA 06 0000 00
  10. Install VMware macOS Guest Tools

    main

    OC4VM includes the VMware macOS guest tools ISO images within the boot disk. To install them:

    1. Boot the macOS guest.
    2. Mount the file located at /Volumes/OPENCORE/OC4VM/iso/darwin.iso inside the guest.
    3. Run the installer from the mounted volume.
  11. Upgrade OC4VM version 3 releases

    main

    To upgrade an existing OC4VM virtual machine within the version 3 release cycle, follow these steps:

    1. Pre-upgrade checks

    Before attempting an upgrade, ensure the following conditions are met to prevent data loss or corruption:

    • No snapshots: Delete all existing VM snapshots.
    • No linked clones: Ensure the VM is a full clone and not a linked clone.

    2. Replace Boot Drive Files

    Copy the new opencore.iso and opencore.vmdk files from the new release into the existing VM's folder, overwriting the current files.

    3. Update VMX Parameters

    You must update the .vmx file configuration using vmx tools to reflect the new version and apply necessary hardware fixes (such as the USB Mouse Fix).

    # Example of updating VMX parameters for version 3.0.1
    <vmxtool_path> set <vmx_file_path> guestinfo.oc4vm.version="3.0.1"
    <vmxtool_path> set <vmx_file_path> guestinfo.oc4vm.revision="b28843f"
    <vmxtool_path> set <vmx_file_path> guestinfo.oc4vm.upgraded="TRUE"
    <vmxtool_path> set <vmx_file_path> tools.upgrade.policy="manual"
    <vmxtool_path> set <vmx_file_path> __USB_Mouse_Fix__=""
    <vmxtool_path> set <vmx_file_path> mouse.vusb.enable="TRUE"
    <vmxtool_path> set <vmx_file_path> mouse.vusb.useBasicMouse="FALSE"
    <vmxtool_path> set <vmx_file_path> usb.generic.allowHID="TRUE"
  12. Download and extract OC4VM

    main

    To use OC4VM, follow these steps to prepare the release files:

    1. Download a binary release from the GitHub releases page.
    2. (Optional) Verify the sha512 checksum against the one published with the release.
    3. Unzip the archive.
    4. Navigate to the extracted folder to access the sub-directories.