Patch OVMF to support macOS in Proxmox 5 and 6

Proxmox 5 and 6’s version of the OVMF firmware includes two commits (2ac1730 and 147fd35) that are intended to mark the pagetables as read-only during startup. This was first seen in Proxmox 5.1. This conflicts with the OsxAptioFixDrv drivers in Clover, which expect to be able to modify the pagetables to remap memory:

I’ve patched OVMF to revert the effect of these two commits, which allows macOS to boot again (I also tested it by booting Windows 10, which worked fine). If you just want to download the fixed .deb, skip to the end of the article, otherwise if you want to build it yourself, follow along with the instructions in the next section:

Building the fixed pve-edk2-firmware

Proxmox 5

Use Debian 9 (Stretch) as a template to create a new container. Inside it, run:

# Add missing locale
export LC_ALL=en_US.UTF-8
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen

# Add tools and build dependencies:
apt-get update
apt-get install build-essential git lintian debhelper iasl nasm \
  python uuid-dev gcc-aarch64-linux-gnu bc -y

# Clone my patched source
git clone -b macos-support-proxmox-5.6

# Build it
cd pve-edk2-firmware

This will include my patch, which you can see here as the newest commit on EDK2:

Proxmox 6

Use Debian 10 (Buster) as a template to create a new container. Inside it, run:

# Add missing locale
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
export LC_ALL=en_US.UTF-8

# Add tools and build dependencies:
apt update
apt install build-essential git lintian debhelper iasl nasm \
  python uuid-dev gcc-aarch64-linux-gnu bc python3-distutils -y

# Clone my patched source
git clone -b macos-support-proxmox-6.0

# Build it
cd pve-edk2-firmware

You’ll end up with a built .deb file ready to be installed.

Installing the fixed OVMF

Download the prebuilt pve-edk2-firmware_1.20190312-1_all.deb (Proxmox 5) or pve-edk2-firmware_2.20190614-1_all.deb (Proxmox 6) if you didn’t build it yourself in the previous step. Upload it to Proxmox somewhere and run these commands in that directory to install it:

dpkg -i pve-edk2-firmware_*.deb

# Prevent it from being replaced later by apt upgrade:
apt-mark hold pve-edk2-firmware

You’re done! All future VM launches will use this new OMVF build.

31 thoughts on “Patch OVMF to support macOS in Proxmox 5 and 6”

  1. Hello,

    I’m trying to install macOS High Sierra 10.13.4 with no success.
    Without this ovmf version I could not get to installer.
    Now, the installer gives me an error:
    and in the installer.log

    * proxmox version:
    pve-manager/5.1-52/ba597a64 (running kernel: 4.13.13-6-pve)
    * config
    args: -device isa-applesmc,osk=”…” -smbios type=2 -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on
    balloon: 0
    bios: ovmf
    boot: cdn
    bootdisk: ide2
    cores: 4
    cpu: Penryn
    efidisk0: local-zfs:vm-102-disk-2,size=128K
    ide0: shared-data:iso/HighSierra-10.13.4-mod.iso,cache=unsafe,media=cdrom,size=5600M
    ide2: shared-data:iso/clover-r4428-amd64.iso,cache=unsafe
    machine: pc-q35-2.11
    memory: 8192
    name: osx1
    net0: e1000-82545em=C6:C4:F0:42:99:01,bridge=vmbr0
    numa: 0
    ostype: other
    sata0: local-zfs:vm-102-disk-1,cache=unsafe,size=40G
    scsihw: virtio-scsi-pci
    smbios1: uuid=cbcf9d9a-c152-411c-8911-349969148059
    sockets: 1
    vga: std

    Do you have any idea ?

    Thank you.

    1. I would guess you are not using the full ISO image, or its damaged. Nick’s other post on running High Sierra mentions that some Macs used to create the ISO don’t get the full installer. It also mentions how to work around it.

      This is only a guess, but it’s based on your log saying “Image not found” when looking osinstallersetup.

  2. Excellent! Wasn’t able to make it work with the patched Qemu package but with this is works.

    I passed a GTX 770 through to the VM but i’m still stuck with the 1280*1024 resolution, even after changing it in the GUI option in the config.plist and in the OVMF boot. And installed the latest Nvidia web drivers. Any solution for that?

    Are the also some recommended UEFI drivers?

  3. Hello,

    I am following the guide but when I try to start my VM I get the error:

    kvm: -machine type=pc-q35-2.11: unsupported machine type

    I’m on Proxmox 5.1-41

    1. There’s a new QEMU and pve-manager version available, you need to upgrade:

      pve-manager 5.1-52
      pve-qemu-kvm 2.11.1-5
      qemu-server 5.0-25

      If you already have, you may need to restart the host to start using the new QEMU version.

  4. Hi nick! thank you for your packages.
    I’m trying to figure out another way to do this without modify the pve-firmware package, maintaining original OVMF plus the modified one for mac…
    Maybe we can change in this:

    push @$cmd, ‘-drive’, “if=pflash,unit=0,format=raw,readonly,file=$OVMF_CODE”;
    push @$cmd, ‘-drive’, “if=pflash,unit=1,format=$format,id=drive-efidisk0,file=$path”;

    to add something like this: ( I don’t know perl syntax so…)

    if $conf->{ostype} && $conf->{ostype} eq ‘other’; {
    push @$cmd, ‘-drive’, “if=pflash,unit=0,format=raw,readonly,file=$OVMF_CODE_MAC”;
    push @$cmd, ‘-drive’, “if=pflash,unit=1,format=$format,id=drive-efidisk0,file=$OVMF_VARS_MAC”;
    } else {

    What do you think?

    PS:Sorry for bad english, not main language

    1. hi Zeusin,
      I was trying a cleaner way : changing /etc/pve/qemu-server/ID.conf adding the line

      args: -drive if=pflash,unit=0,format=raw,readonly,file=/DIR/OVMF_CODE.fd ….

      but I get the error: “drive with bus=0, unit=0 (index=-1) exists”

      did you find something better?

  5. Hello Sir!

    I am trying to set up macOS High Sierra on Proxmox 5.1 by following your article but i am stuck at the point
    “Install Patched version of proxmox OVMF library”
    you mentioned above that i have to upload that package file on proxmox somewhere.. but the problem is that i am not able to find any place in proxmox where i could upload a package file with extension “.deb”
    kind guide me that how and where do i upload prebuilt pve-edk2-firmware on proxmox ?

        1. SSH/SFTP works the same way on Proxmox as on any other Linux system, I suggest that you google for tutorials. Without this knowledge, working with Proxmox in general is going to be very difficult.

  6. Hi Nick,

    Nice article! but i am running into a problem when booting up the installation. When i am booting the installation with verbose mode i am finding out it starts hanging at:
    AppleKeyStore::start: _sep_enabled = 0

    Screenshot of the boot log:

    I just can’t figure out how to fix this problem, anybody known an solution to this?

    Kindly regards,

    Pascal S.

  7. Are we going to be blessed with an update on how to install Mac OS X Mojave with Proxmox?

    I can supply the beta download if you need it 🙂

  8. Hi, I followed your guide and downloaded clover iso; also I created high sierra iso and tried to boot with clover but it does not work. Always, boot in shell uefi.

    1. Most likely your Boot Order setting on the Options tab is not set to the Clover device, or your Clover device is not configured correctly. Post your VM conf file on or something and link it here.

  9. Hi,

    thanks for the tutorial! I can’t install mojave because Proxmox says “Guest has not initialized the display (yes) .”
    Did anyone encounter this error before?


    1. Try starting the VM from the Proxmox command line (qm start xxx), it may print some errors/warnings that are missed in the GUI.

  10. Hi,

    There is a new version of this package avalaible on Proxmox’s repository.
    pve-edk2-firmware/stable,stable 1.20181023-1

    Can you please update your patched version ?

    Thanks for the good work.

  11. Hi there,

    There is (again) a new version of this package available on Proxmox’s repository.
    pve-edk2-firmware/stable,stable 1.20190312-1

    Can you please update your patched version ?

    Thanks !

    1. I’ve updated that now!

      I upgraded my other Proxmox packages too and encountered a side-effect: VMs with passthrough video that had also set “vga: std” used to be equivalent to setting “vga: none” (the emulated adapter was disabled), but this now results in the emulated adapter being enabled as the primary video adapter, with the passthrough video card as secondary.

      I had to edit my VM config to set “vga: none” for my VMs that use passthrough video.

      It was super weird having Clover being invisible on boot, and then both of my two hardware monitors being relegated to “secondary displays”!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.