Installing macOS High Sierra on Proxmox 5

This tutorial for installing macOS Sierra has been adapted for Proxmox 5 from Kholia’s GitHub project for installing into vanilla KVM. There is more documentation there which will help out with enabling extra features and diagnosing problems!

Requirements

I’ll assume you already have Proxmox 5 installed. You also need a real Mac available in order to download High Sierra from the App Store and build the installation ISO. Your Proxmox host computer must have an Intel CPU at least as new as Penryn (I believe you would need a a custom Mac kernel in order to use an AMD CPU).

First step: Create an installation ISO

On a Mac machine, download the macOS High Sierra installer from the App Store (this will download it into your Applications folder).

Check the size of the completed download. Some people will end up with a 16MB installer, and some will receive the full 5GB installer (nobody knows why yet). If you received the 16MB version, follow the instructions here to get the full 5GB version instead.

Now run this script in order to create HighSierra.iso from the installer. The ISO should get saved to your desktop. Upload the ISO to your Proxmox server’s ISO store (typically /var/lib/vz/template/iso).

Prepare a Clover image

We’ll be using Clover as a bootloader for High Sierra.

Download this Clover disk image (that I built using kholia’s build script from Clover r4243), unpack it, and upload it to Proxmox’s ISO store at /var/lib/vz/template/iso. Although it has a .iso file extension, this is actually a hard disk image. (I do it this way because Proxmox has nicer tools for storing and picking .iso files for us)

Fetch the OSK authentication key

macOS checks that it is running on real Mac hardware, and refuses to boot on third-party hardware. You can get around this by reading an authentication key out of your real Mac hardware (the OSK key). Run the first bit of C code from this page (you’ll need XCode installed) and it’ll print out the 64 character OSK for you. Make a note of it.

Every Mac uses the same OSK, so don’t be surprised if it doesn’t look like a random string!

Create the VM

From the Proxmox web UI, create a new virtual machine as shown below.

In the Options page for the VM, change “Use tablet for pointer” to “No”. Change “BIOS” to “OVMF (UEFI)”.

In the Hardware page for the VM, change the the Display to Standard VGA (std). Add a second DVD drive at IDE0, set it to use your HighSierra.iso. Add an “EFI Disk” too.

Don’t try to start the VM just yet. First, SSH into your Proxmox server so we can make some edits to the configuration files.

Edit /etc/pve/qemu-server/YOUR-VM-ID-HERE.conf (with nano or vim). Add these two lines, being sure to subtitute the OSK you extracted earlier into the right place:

machine: pc-q35-2.9
args: -device isa-applesmc,osk="THE-OSK-YOU-EXTRACTED-GOES-HERE" -smbios type=2 -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on

Find the two lines that define the CDROM drives (ide0 and ide2), and remove the “,media=cdrom” part from both lines. Add “,cache=unsafe” in its place. If the Sierra boot option doesn’t appear in Clover later, try adding “,media=cdrom” back to the line for the Sierra ISO.

On the net0 line, change “e1000” to “e1000-82545em”. This variant is supported by OS X.

macOS doesn’t support the PS2 keyboard and mouse that QEMU will emulate, nor does it support the tablet, so edit /usr/share/qemu-server/pve-q35.cfg and add these USB input devices to the bottom of the file instead:

[device "mouse1"]
 driver = "usb-mouse"
 bus = "ehci.0"
 port = "1"

[device "keyboard1"]
 driver = "usb-kbd"
 bus = "ehci.0"
 port = "2"

We’ve added those to the config file instead of to the VM’s args directly. If we were to add them to the VM’s args, then when Proxmox constructs its call to KVM to launch the VM, those device definitions would appear before the pve-q35.cfg file is included, which defines the USB busses. However, the device definitions must appear after the definitions of the USB bus that they refer to.

Note that this file is whitespace-sensitive, make you you don’t add any blank lines that have extraneous spaces on them.

Return to the Options tab and change the boot order to put IDE2 (the Clover image) first.

Configure Proxmox

On Proxmox, run “echo 1 > /sys/module/kvm/parameters/ignore_msrs” to avoid a bootloop during macOS boot. To make this change persist across Proxmox reboots, run:

echo "options kvm ignore_msrs=Y" >>/etc/modprobe.d/kvm.conf && update-initramfs -k all -u

You must now install a patched version of Proxmox’s QEMU in order to be able to boot High Sierra, until this patch is merged by the upstream.

Install High Sierra

Now start up your VM.

Go to the Console tab, quickly hit Escape at the Proxmox logo to enter the OVMF configuration. If your keyboard doesn’t work, leave the Console tab, stop the VM, start the VM, then re-enter the console tab.

Follow the steps above to set the screen resolution to 1024×768 and “reset” to apply the new settings (not “continue”). This step is required to avoid scrambled graphics (Clover resolution must match OVMF resolution). It should now boot into Clover.

Clover boot screen

Press enter to boot the “Boot OS X Install from Install macOS High Sierra” entry and the installer should appear. Choose your language.

Our virtual hard drive needs to be erased/formatted before we can install to it, so select the Disk Utility option. Follow the steps below to format the disk:

Now we’re ready to begin installation!

After the first stage of installation, the VM should reboot itself and continue installation by booting from the hard drive. Answer the initial install questions, and you’ll be logged on! (Note that you’ll probably want to hold off on logging into your iCloud account until you’ve configured your SMBIOS to your liking in Clover Configurator)

Make the Clover install permanent

We’re currently booting using Clover from the attached CD image. Let’s install that to the hard drive instead. Pop open Terminal and run “diskutil list” to see what drives we have available.

Use “sudo dd if=source of=dest” to copy the EFI partition from the Clover CD and overwrite the EFI partition on the hard disk. The Clover CD is the one with the “linux filesystem” on it, and the main hard disk is the one with the large Apple_APFS container partition on it.

In my case these EFI partitions ended up being called disk0s1 and disk2s1 respectively, so I ran “sudo dd if=/dev/disk0s1 of=/dev/disk2s1” (N.B. if you get these names wrong, you will erase the wrong disk and you’ll have to start the installation over again!).

Now shut down the VM, and remove both the Clover and the Sierra CDROM drives from the Hardware tab. On the Options tab, edit the boot order to place SATA0 as the first disk. Boot up. If everything went well, you should see a Clover boot menu, and you can select “boot macOS from *disk*” to boot High Sierra.

Sleep management

I found that I was unable to wake High Sierra from sleep using my mouse or keyboard. You can either disable system sleep in High Sierra’s Energy Saver settings to avoid this, or you can manually wake the VM up from sleep from Proxmox by running:

qm monitor YOUR-VM-ID-HERE
system_wakeup
quit

Editing your Clover/EFI settings

You can use the Clover Configurator tool to edit your Clover configuration, which is stored in the hard drive’s EFI partition. This tool should mount the EFI partition for you. If you want to mount it without using Clover Configurator, first check the device name of the EFI partition in the terminal:

~$ diskutil list
/dev/disk0 (external):
   #:             TYPE   NAME           SIZE       IDENTIFIER
   0: GUID_partition_scheme             512.1 GB   disk0
   1:              EFI   EFI            209.7 MB   disk0s1
   2:        Apple_HFS   Main           511.8 GB   disk0s2

Then you can mount it like so:

sudo mkdir /Volumes/EFI
sudo mount -t msdos /dev/disk0s1 /Volumes/EFI

Passing through advanced CPU features

You can pass through CPU features like AVX and AES-NI for increased guest performance, see here for details.

USB passthrough

Using noVNC gets pretty annoying due to the Mac’s absence of tablet support for absolute cursor positioning. You can solve this by turning on the Mac’s screen sharing feature and using that instead. You might also be able to solve this by installing this third-party driver and re-enabling the tablet feature on the Options tab. However, since I want to use this as my primary computer, I want to use a USB keyboard and mouse plugged directly into Proxmox, rather than sending my input through the web VNC console.

Proxmox has good documentation for USB passthrough. Basically, run “qm monitor YOUR-VM-ID-HERE”, then “info usbhost” to get a list of the USB devices connected to Proxmox:

qm> info usbhost
 Bus 3, Addr 12, Port 6, Speed 480 Mb/s
 Class 00: USB device 8564:1000, Mass Storage Device
 Bus 3, Addr 11, Port 5.4, Speed 12 Mb/s
 Class 00: USB device 04d9:0141, USB Keyboard
 Bus 3, Addr 10, Port 5.1.2, Speed 12 Mb/s
 Class 00: USB device 046d:c52b, USB Receiver
 Bus 3, Addr 9, Port 14.4, Speed 12 Mb/s
 Class 00: USB device 046d:c227, G15 GamePanel LCD
 Bus 3, Addr 8, Port 14.1, Speed 1.5 Mb/s
 Class 00: USB device 046d:c226, G15 Gaming Keyboard
 Bus 3, Addr 6, Port 11, Speed 12 Mb/s
 Class e0: USB device 0b05:17d0,
 Bus 3, Addr 2, Port 1, Speed 1.5 Mb/s
 Class 00: USB device 068e:00f2, CH PRO PEDALS USB

In this case I can add my keyboard and mouse to USB passthrough by quitting qm, then running:

qm set YOUR-VM-ID-HERE -usb1 host=04d9:0141
qm set YOUR-VM-ID-HERE -usb2 host=046d:c52b

This saves the devices to the VM configuration for you. It’s possible to hot-add USB devices, but I just rebooted my VM to have the new settings apply.

You can also pass through USB devices by passing through an entire USB controller using Proxmox’s PCIe passthrough feature.

PCIe GPU passthrough

For near-native graphics performance you can pass through a video card. There are details in the Proxmox manual. You should also check out Hackintosh tutorials for more details on installing the drivers correctly (and configuring Clover correctly) for the card you want to install.

If you don’t want to pass through a video card, but want to bump the screen resolution up to 1920×1080, use Clover Configurator to set Clover’s screen resolution to match that, then enter the OVMF settings at boot time by pressing escape, and set the new resolution there as well.

55 thoughts on “Installing macOS High Sierra on Proxmox 5”

  1. hi !
    i have not tested yet, but does it work whit filevault ?
    even with sierra ? (i have one working but i’m looked out when i have activated filevault, i can’t type anything at the pre-login screen)
    even on a remote proxmox ?

    1. It encrypted my disk for me, but the FileVault preboot option doesn’t work properly. It seems like the keyboard and mouse both stop working, so I’m unable to enter the password, and the screen doesn’t paint correctly:

      https://i.imgur.com/Ppb2Krl.png

      I was able to use the Recovery environment to unlock the drive.

      It might be that some combination of input device kexts could fix this.

  2. Love these tutorials, Nick! Never noticed the comments section on your site. Half way through this High Sierra tutorial now – will report back shortly. 😀

    1. Had an issue with getting the High Sierra installer to appear in Clover. This was fixed by leaving `media=cdrom` in the HighSierra.iso line. Installer seems to be working fine with this setting.

        1. No problem! I’ve got a few more issues which I’m still trying to iron out. Hoping to fix them over the next week

  3. Another update! I found that my mouse had an irritating offset when using Proxmox’s console. Fixed by using this in the pve-q35.cfg file in place of your mouse1 device….

    [device “mouse1”]
    driver = “usb-tablet”
    bus = “ehci.0”
    port = “1”

    Working perfectly in the installer!

  4. Hi, first, thanks for the tutorial.
    I am not sure what is wrong, but I am not able to boot clover. There is just a hang, and the UEFI shell is opening. So no boot in the clover. :-<
    Thanks for any idea,
    Ronny

    1. Hm, maybe try the suggestion in the other comment to add back the media=cdrom part on the High Sierra CD drive in the VM configuration.

  5. Question – can you enable the caching service with this? System preferences, sharing, caching.

    Or terminal, sudo assetcachemanagerutil activate (I think)

    I can’t get those working on any vm yet

  6. First of all I want to thank you for this great tutorial!

    I encountered a strange behavior of the SATA disk I attached to Promox. It did not show up. When hot plugging an IDE drive, the SATA drive did show up in the disk util. Any idea?

    I would really like to see a tutorial, that includes GPU redirection, as this would be an way of setting up powerful VR-ready setups.

    1. Proxmox is a hypervisor, so it acts as an operating system itself. You install it as an OS on a bare computer. If you’re currently running Debian Linux then it’s also possible to just install it into your current OS as a package.

      1. Thanks for your reply! So I install it on a clean computer, afterwards I can configure the VM through the WebUI on a different machine, is that correct?

          1. Awesome! Seems clear to me now. Last question (I promise) Do you boot into the VM directly when booting up your machine? Or do you need to run an additional command through Proxmox first?

  7. You can set a “start on boot” flag on a VM which will cause it to start automatically after Proxmox boots with no user interaction required (just hit the power button and wait).

      1. There’s actually a wrinkle with Proxmox and WiFi. The problem is that Proxmox sets up a network bridge to connect itself and the guests to the network, and this bridge is supposed to be responsible for choosing the Proxmox host IP address. However, it seems that a lot of WiFi systems don’t allow this, they want to manage one single address for the interface themselves.

        The net result was that I just couldn’t figure out how to achieve it with my hardware. Maybe turning on WDS on the hotspot could fix it?

        If you search for “vmbr0 WiFi” you’ll find other people’s efforts to solve it. (vmbr0 is the name of the default bridge). For example:

        https://forum.proxmox.com/threads/proxmox-laptop-wireless-adapter-wifi.712/

        “Don’t bother. Most wireless cards, including Broadcom cards, cannot see traffic for more than one MAC address. So even if you find 64-bit Windows XP drivers for the card that actually work with ndiswrapper, you won’t be able to use it usefully with Proxmox VE. (You won’t be able to successfully bridge your VMs virtual adapters over the wireless network.)”

  8. Hi Nick!

    Just wondering if you’re getting any CPU stuttering on your setup?
    I’m getting random lag spikes for a split second – wondering if it’s anything to do with the emulated frequency?

    1. Mine’s pretty smooth. MacOS can read the actual CPU frequency using the vmware-cpuid-freq option in the VM args, so it should see the correct frequency. The invtsc option should allow macOS to perform accurate timekeeping for smooth animations.

      I do sometimes get lag spikes when there is disk IO on the host, but I assumed that was just down to my hardware. Since I pass through an NVMe SSD for macOS, there’s no good reason for it to stall when the host is doing disk IO on other drives…

      1. Thanks Nick! I’ll pick up an NVMe drive when I get the chance and give that a go – worst case scenario I can just use it as a cache or a new boot drive on another machine.

        1. A regular SSD presented as a virtual SATA drive, or a regular SSD attached to a passthrough SATA controller, should both be an improvement too, if you have a spare SSD to try that with.

          NVMe is so perfect for passthrough since each drive is its own PCIe device.

  9. I’m having some weird display issues. The display is all teared up, although it does boot fine into the installer. Any idea how to fix this or what could have caused it?

    1. This will happen if the screen resolution set in the guest UEFI options doesn’t match the resolution configured in Clover’s options.

      1. I’m absolutely sure I configured it correctly, but after setting the resolution in the bios again, the display is now working. Maybe I did make a mistake… Thanks for the tip and the great guide!

  10. I’m having great difficulty in getting the OSK authentication key. When I run the code with Xcode, the only output I seem to be able to get is a message along the lines of “our hard-work…”.
    Could you please inform me how I can get this key.

  11. Hi,

    thank’s for your tutorial.
    I have a little problem, I can’t see HighSierra.iso in clover.
    I can see it on the console tab, in boot manager (named UEFI QEMU HARDDISK QM00003), but not in clover.
    My clover.iso is saw as UEFI QEMU HARDDISK QM00001) in boot manager.
    I make a lot of tests, inspired by your 2 tutorials.
    For example, I can’t start with vmware-cpuid-freq=on option
    -> kvm: can’t apply global Penryn-x86_64-cpu.vmware-cpuid-freq=on: Property ‘.vmware-cpuid-freq’ not found
    So I start without it.
    I tried to start using enoch, not better.

    Any ideas ?

    proxmox 4.4.13
    kernel 4.4.59-1-pve

    Thank’s

    1. This tutorial requires Proxmox 5 for those new QEMU features like the frequency one.

      If the ISO does not appear then try removing or adding media=cdrom to the line for that ISO in the VM configuration

  12. Sorry, another what is probably another silly question. When trying to set boot order, I don’t get the option for ide2. Just sata0, CD rom, network.
    Would it start off with Cd rom first?

  13. Very nice step by step tutorial, but I am running into the same problem a few above have brought up. I am not seeing the mounted CDROM iso in clover.

    proxmox-ve: 5.1-26 (running kernel: 4.13.4-1-pve)
    pve-manager: 5.1-36 (running version: 5.1-36/131401db)
    pve-kernel-4.13.4-1-pve: 4.13.4-26

    I have the following disks:
    Hard Disk (ide0): local:iso/MacOS_High_Sierra_13.1.05.iso,cache=unsafe,size=5510527K
    Hard Disk (ide2): local:iso/clover-r4243-amd64.iso,cache=unsafe
    Hard Disk (sata0): local-vm:vm-103-disk-1,cache=unsafe,size=32G

    Boot Order: Disk ‘ide2’, CD-ROM, Network

    I’ve tried toggling media=cdrom and a few other things, but not seeing any install option in Clover. Any ideas?

    Thanks,

    Jacob

    1. Gee, I hope this isn’t an incompatibility with Proxmox 5.1 (I’m still on 5.0)! I’ll have to upgrade here and see what happens.

      Try rebuilding the Sierra ISO just in case. I can’t think of anything else that would modulate this behaviour… is the VM set for UEFI/OVMF boot?

      1. No I don’t think so, I just upgraded to 5.1 today since I was running into the same issue on 5.0 and ran out of easy troubleshooting and thought I would give it a try. The VM is set for UEFI and clover comes up fine, just no mounted cdroms. I’ll try rebuilding the iso and try some other isos and then dive into more detail if that doesn’t work.

        Thanks!

  14. Looks like it was a bad ISO; rebuilding it fixed the issue. Now I seem to have a problem with the display. Clover looks fine, but when going to install I get a mac logo shifted up and left. During the loading step the screen is totally scrambled. Making the display 1024×768 didn’t help (and have been trying other resolutions).

    Thanks!

    1. That’s definitely a screen resolution issue. Are you picking the option in the UEFI to save and reboot correctly?

      You can probably confirm what resolution Clover is set for within its configuration menus.

  15. Install went fine, but after reboot when going through the initial options it reboots after the networking section. If I set it up without a network connection it finishes correctly. But the Networking section in preferences does not open. Any ideas?

    1. That’s weird, I’ve not seen that before! Does the dialog open if you remove the emulated network card? If so, maybe you can pass through a real network card instead so it’ll use a different driver.

  16. Thank you so much for this site, which helps a lot!

    Unfortunately I’ve got a problem.

    When booting into Clover for the first time, I can see a device, named “optical”. When I choose that one and pressing Enter, nothing happens. If I press Space on the keyboard, everything freezes.

    Also, when marking the “optical”-device, it’s name is:

    Boot Legacy OS from APPLE INC., TYPE: 002

    It should look as in your screenshot.

    What is wrong?

  17. Thanks for your answer. Yes, I’ve tried removing that, but then Clover doesn’t recognize any OS at all.

    Yes, the VM is set up for UEFI/OVMF. Have also tried to rebuild the High Sierra ISO two times (even downloaded High Sierra from AppStore each time).

    I’m running Proxmox 5.1.

    1. I tried with an old Lion ISO, and it started – I got to the installation and doing a testinstallation now! So it has to be my High Sierra ISO that has some issues. Strange…

  18. Nick your blog has been priceless for setting up macOS guests in proxmox for me. Thanks.

    I have a couple questions if you can spare some time.

    In your experience when using an UEFI compatible GPU and OVMF/EFI BIOS guest in Proxmox does the system shutdown/reset properly AND allow you to start up the guest VM without restarting the HOST?

    I have used your blog to build a guest VM with SeaBIOS using my GTX 580. My GPU will only properly reset in Windows. Linux and OSX systems cause my host to require a restart when shutting down the VM. If using UEFI doesn’t resolve this than I hope to avoid spending the money to upgrade my GPU. Your answer would be valuable to me. Thanks in advance.

    Furthermore, are you doing any USB controller passthrough? I have read many success stories at insanelymac. But I am having the hardest time. I can USB Passhthrough my host keyboard and mouse. But known native working USB devices will not USB Passthrough (USB Webcam works perfectly on hardware Mac – wont USB Passthrough without error) and when I PCI Passthrough a USB Controller I get mild success — Hard/flash disks work fine. That same webcam will not work. And even an Apple mouse and host mouse when moved to passed-through port will not work.

    If you have PCI passthrough working with a USB Controller can you share your PCI device details?

    Thanks again for sharing your research and guides.

    God bless.

    1. >UEFI compatible GPU and OVMF/EFI BIOS guest, system shutdown/reset properly without restarting the HOST?

      I used to have troubles with my Radeon R9 280X hanging the host when trying to move it between OS X and Windows guests, but I don’t recall if the host or guest was using UEFI at that time, sorry!

      My host and my Windows, Linux and High Sierra guests currently boot UEFI. (Note that Proxmox can’t use a ZFS root volume when booting UEFI). My eVga GTX 750 Ti and eVga GTX 1060 both passthrough great in this configuration, and don’t need a host restart between guest boots. I’m switching the GTX 1060 between macOS and Windows guests, and the GTX 750 Ti between macOS, Linux and Windows guests. Another thing that I think helps this configuration is that my host has a VGA adapter onboard which is set as the primary video adapter in its UEFI setup, which I believe avoids initialising the discrete video cards during host boot.

      >Furthermore, are you doing any USB controller passthrough?

      I used to pass through individual USB devices, but it was a pain having to change my configuration for each new USB device I wanted to attach. So now I just use PCIe (not PCI) passthrough to pass 3 USB controllers to macOS: 2x “Intel Corporation C600/X79 series chipset USB2 Enhanced Host Controller” and 1x “Fresco Logic FL1100 USB 3.0 Host Controller [1b73:1100]”. That Fresco Logic chip is on this adapter: https://www.amazon.com/gp/product/B00JFR2H64/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1

  19. Nick, thanks for your great post, very helpful.

    Are ACPI power commands from Proxmox supposed to work with this setup or are additional steps required?

    Cheers

    1. They don’t work for me either, which is annoying. Let me know if you find a solution!

      I suspect the answer is that real Macs don’t use ACPI for the power button, but I don’t know for sure.

  20. Hello. Thank you for putting together this guide! I currently have a hackintosh so I get all the clover part. Is it the same standard upgrade process as a Hackintosh after the intial install? Where you can just install the next major MacOS release as long as you have updated Clover first? Or do you have to wait for Proxmox updates to be pushed to mess with the proxmox config file every time?

    1. The only time I had to mess with things was when Sierra 10.12.4 added more copy protection and I had to patch QEMU (I could have used FakeSMC instead to fix this). Apart from that, it upgrades just like a regular Hackintosh – with the bonus that you can take drive snapshots to roll things back instantly if something goes wrong!

Leave a Reply

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