Skip to content

Latest commit

 

History

History
107 lines (93 loc) · 7.91 KB

File metadata and controls

107 lines (93 loc) · 7.91 KB

Virtualization

This section covers running macOS in a virtual machine in different fashions.

Virtualizing macOS in Proxmox Virtual Environment

🚧 Work in progress

Links

Virtualizing macOS in Windows with Hyper-V

System Requirements

  • CPU: 64-bit Intel CPU with support for virtualization technology
  • Mainboard with UEFI support
  • RAM: At least 16 GB or more (minimum requirement for current macOS versions is 8 GB; plus whatever is needed for running Windows, the Hypervisor and Hyper-V)
  • Windows Requirements:
    • Client: Windows 10 Professional v1809 or newer (non-pro versions don't support Hyper-V)
    • Server: Windows Server 2019 or newer (OpenRuntime.efi doesn't work properly on previous versions)
  • Hard Disk (preferably SSD) with enough space!

Note

Virtualizing macOS with AMD systems is currently not supported more details

Enabling Hyper-V

  • In UEFI, enable Virtualization (VT-D or whatever your mainboard supports)
  • Under Windows, type "features" into Cortana search and select "Turn Windows Features on or off" (alternatively, type appwiz.cpl and hit Enter to open "Programs and Features")
  • Scroll down to Hyper-V and enable it:
    01
  • Click "OK"
  • The system has to reboot to install and enable the Hyper-Visor layer

Creating a Virtual Machine (VM) for macOS

  • Once Windows has rebooted, Launch "Hyper-V Manager" via Cortana Search.
  • Under Action → Select "New…" → "Virtual Machine…":
    02
  • The "New Virtual Machine Wizard" starts
  • Click "Next"
  • "Specify Name and Location". Enter a name and a location to store the VM in. In this example, I chose "macOS" as name and C:\VMs\ as location:
    03 💡 Tick "Store the virtual machine in a different location" (→creates sub-folders for each VM for better organization)
  • Click "Next"
  • Specify Generation: select Generation 2 (= UEFI, 64-bit only) and click "Next":
    04
  • Assign Memory:
    05
    • Startup memory: 8192 MB (Minimum for current macOS)
    • 💡Untick "Use Dynamic memory for the virtual machine" if you run into RAM-related issues.
  • Click "Next"
  • Configure Networking: select "Default Switch" and click "Next"
  • Connect Virtual Hard Disk:
    06
    • 💡 "Name" and "Location" should already be present
    • 💡 "Size": adjust or leave as is (the virtual disk grows/shrinks dynamically). If this causes issues, you can change it to a fixed value in the VM's settings later.
  • Click "Next"
  • Installation Options: Select "Install an Operating System later" and click "Next"
  • Summary: Check if all settings are correct and click "Finish".
    07
  • The Hyper-V Manager now contains the entry "macOS" under "Virtual Machines":
    08

Preparing the macOS VM

Next, we need to add another virtual hard disk containing the EFI partition with OpenCore to boot macOS as well as the Recovery Partition to download and install macOS. Finally, we have to adjust some settings in the VM to make it all work together.

  • Next, download the latest release of UEFI_OC. It's a 1GB virtual hard disk image. It contains a pre-configured OpenCore EFI folder with the necessary config and files to boot the macOS VM under Hyper-V.
  • Unpack the .7z file and copy the UEFI.vhdx file to the "Virtual Hard Disks" folder (in my case it's located at C:\VMs\macOS\Virtual Hard Disks):
    Screenshot 2023-12-18 041516
  • Next, download a macOS Recovery for the macOS version you want to install.
  • Double-click the virtual "UEFI" hard disk to mount it
  • Copy the com.apple.recovery.boot folder containing the BaseSystem.chunklist and BaseSystem.dmg onto the virtual UEFI disk:
    Screenshot 2023-12-18 043718
  • Right-click the "UEFI" disk in Windows Explorer and select "Eject" to unmout it.
  • Back in Hyper-V Manger, right-click the macOS VM and select "Settings…":
    Screenshot 2023-12-18 045351
  • Adjust the following Settings:
    • Add Hardware:
      • Select "SCSI Controller" and click "Add"
      • Select "Hard Drive"
      • Tick "Virtual Hard Drive" and click "Browse…"
      • Navigate to the folder containing the UEFI.vhdx (in this example C:\VMs\macOS\Virtual Hard Disks), select it and click "Open"
      • Click "Apply" (important!)
    • Firmware: Boot order
      • Move the "UEFI" Hard Disk to the top of the list – it contains the OpenCore Boot Loader and the macOS Recovery.
      • Followed by the "macOS" Hard Disk
      • Move the "Network Adapter" to the bottom
      • Click "Apply"
    • Security: Unselect "Secure Boot"
    • Processor: Assign more than 1 virtual processors if possible (ideally 4 or more)
    • Integration Services: Enable "Guest Services"
    • Checkpoints: Unselect "Enable Checkpoints"
  • Click "OK" to save the settings and close the window.

Important

Make sure to "Eject" the UEFI disk prior to starting the macOS VM. Otherwise you get an error message because the disk is not accessible from within the VM!

Testing the VM

Now that the VM is prepared, we can test it. Booting macOS Recovery is most likely not going to work out of the box, but as long as OpenCore is booting you are half way there.

  • Back in Hyper-V, double-click on the macOS VM to connect to it
  • This opens a new Window. Click "Start" to boot the VM
  • In the OpenCore Boot Menu, select "UEFI (dmg)" with the arrow keys and press Enter to start the macOS Recovery:
    Screenshot 2023-12-18 052528
  • From the Recovery Menu, select "Disk Utility"
  • Select "Msft Virtual Disk Media" and click on "Erase"
  • Format: APFS
  • Scheme: GUID Partition Map
  • Once it's done, quit Disk Utility
  • Back in the Recovery Menu, select "Reinstall macOS" to start the installation

Note

If booting macOS Recovery fails, you will have to adjust the OpenCore EFI and config to match your system's requirements (Settings, Kexts, Drivers, etc). In this case shutdown the VM, mount the virtual "UEFI" disk to access the OC folder and config.plist.

If you have an already working OC folder for your system, you probably "only" have to add the Hyper-V related SSDTs, Kexts and Settings to your existing configuration. Check Acidantera's Mac Hyper-V Support repo for more details.