Upgrading a Proxmox 5 macOS Sierra guest to High Sierra

macOS 10.13 High Sierra has finally been released, and the good news is that it works with Proxmox 5!

Here’s how I upgraded my Proxmox 5 Sierra installation, which has been previously updated to use Clover/UEFI boot and is stored on a passthrough NVMe SSD. Your setup may differ and your upgrade steps may need to change. I doubt these instructions would work for enoch/chameleon boot.

Take a snapshot of Sierra

I cannot stress this enough! If your filesystem gets completely trashed by the installer, you really need to be able to roll it back to a snapshot!

Since my install is on a passthrough NVMe SSD, and so doesn’t support Proxmox-managed snapshots, I shut down my Sierra VM, then cloned the VM to create a backup of its configuration. On the clone VM, I removed the passthrough-SSD from the config, then added a SATA disk in its place which was somewhat larger than the original SSD. I used dd if=/dev/nvme0n1 of=/dev/tank/vms/vm-999-disk-1 bs=4096 to fill that backup disk with a copy of the contents of the SSD.  Don’t just copy that command blindly, because you will end up erasing the wrong device!!

Then I used Proxmox’s interface to create a snapshot of the clone VM, which will snapshot the new SATA disk. At this point I could have tested the High Sierra upgrade on the clone, while leaving my original VM (and its corresponding SSD) completely untouched. But you only live once, so let’s upgrade the real thing instead!

Download the installer

In the App Store, search for High Sierra and hit the Download button to download the installer.

Upgrade Clover

My installation of Sierra boots using Clover, so I first upgraded that to the latest version, r4359, by running the Clover installer in the guest.

After the installer finishes, but before macOS is restarted, it’ll leave the EFI partition mounted for us. We need to add an EFI driver to Clover to support Apple’s new filesystem, “apfs.efi”. You can get this from the “Install macOS High Sierra” installer in your Applications folder. Just right click on it, click Show Package Contents, then navigate to Contents/SharedSupport and open BaseSystem.dmg. From inside there, the driver is found at usr/standalone/i386/apfs.efi copy that to your Clover EFI partition at EFI/CLOVER/drivers64UEFI/.

I rebooted to ensure that this upgraded Clover worked correctly.

Note that my Clover is set to use an SMBIOS of iMac 14,2. I think setting an SMBIOS manually like this will be a requirement, as the default SMBIOS doesn’t seem to work correctly for me. You can use Clover Configurator Vibrant to do that if you haven’t chosen an SMBIOS already.

Build the install ISO

Use Disk Utility’s File menu to create a new virtual disk image to copy the installation data into, 8GB is a good size.

I chose a filename of HighSierra.dmg, and a volume name of HighSierra. After creation, that empty image should get mounted to /Volumes/HighSierra for you.

Now run the High Sierra installer’s built-in createinstallmedia command to fill that image up:

sudo "/Applications/Install macOS High Sierra.app/Contents/Resources/createinstallmedia" --volume /Volumes/HighSierra

Eject the completed “Install macOS High Sierra” image using finder, then convert the image into an ISO:

hdiutil convert HighSierra.dmg -format UDTO -o HighSierra.iso
mv HighSierra.iso.cdr HighSierra.iso

Upload the resulting HighSierra.iso file to your Proxmox installation’s ISO storage (by default I believe this is  /var/lib/vz/template/iso).

Add this ISO as a new SATA CD drive to your Sierra VM. Clover can’t see CD drives for some reason, so edit the VM’s config file and edit the line for the CD drive to remove “media=cdrom” and add “cache=writeback” to turn it into a pseudo-harddrive. The resulting line in my config ended up being:

sata1: isos:iso/HighSierra.iso,cache=writeback,size=7812520K

Remove any hacked NVMe drivers

I had installed a modified HackrNVMeFamily.kext into /System/Library/Extensions in order to support my Samsung 950 Pro SSD. This SSD will be supported natively in High Sierra, and the presence of this leftover Sierra kext will wreck the boot process after the upgrade to High Sierra completes.

To remove it, I first had to change my VM’s configuration to comment out the “hostpci0” line that passed through the SSD, then I added it back as a SATA disk instead using “sata0: file=/dev/nvme0n1”. This way it appears as a simple SATA drive to macOS, and it won’t need the hacked NVMe driver to boot. Proxmox needed to be rebooted so that the NVMe would be available for use in this way (if I pass it through, it becomes unavailable for non-passthrough tasks until the next host reboot for some reason).

Then I booted Sierra from the SSD (using this SATA emulation) and from it I ran sudo rm -rf /System/Library/Extensions/HackrNVMeFamily.kext to delete the hacked kext. (You might also have had a IONVMEFamilyBorg.kext in there, which needs to be deleted too.)

Finally, and critically, after shutting down the VM, I removed the SATA device from the config, and added back the SSD passthrough. The High Sierra installer won’t upgrade the filesystem to APFS for us if the drive doesn’t appear to be an SSD.


Start the upgrade

If your VM was booting from an NVMe SSD originally, it should now have any hacked NVMe drivers removed from its filesystem. In the VM configuration, the NVMe SSD should once again be passed-through using a hostpciX line. Any passthrough of an NVidia video card should be commented-out.

One last configuration change: I upgraded the “machine” line in the VM config to “machine: pc-q35-2.5” (I was using 2.4 previously). I’m not sure if this was needed or not, but it doesn’t seem to hurt.

Boot your VM, and at the Clover menu, choose the option to boot the High Sierra installer. Follow through the prompts to install to your disk.

Pretty soon, the system will reboot, and you should pick the “Boot macOS install from (your main disk)” entry to continue installation (it should be selected by default).

Continue installation by selecting this option
It’s installing!

After this section, the installer will reboot again, because installation is complete. But this time things look a little freaky:

This time there will be two new options, “Boot macOS from (your drive)” and “Boot FileVault Preloader from Preboot”. I believe the second option would only apply to systems using FileVault encryption (I’m not using it and I’m not sure if it’s compatible with Clover yet), so I’m using the “Boot macOS” one instead. I hit space on it to customise the boot options:

I ticked Verbose, so I could see how well the first-boot went. Now you can “boot with selected options” and you should get to your login screen and log in!

Now all that’s left to do is to upgrade your NVidia web drivers (if you were using them) to the latest version and restart!

After successfully booting with NVidia enabled, you can grab the latest CUDA drivers too.

If everything went well, you should see in Disk Utility that your SSD was upgraded to APFS during installation! I’m hoping that this improves my filesystem integrity on the rare occasion that my VM locks up.


6 thoughts on “Upgrading a Proxmox 5 macOS Sierra guest to High Sierra”

  1. Thanks for the writeup, was really helpful. I hit a couple of issues when doing this,

    The first one happened when I downloaded the installer from the app store, there wasn’t a SharedSupport folder at all under “/Applications/Install macOS High Sierra.app/” (the entire directory was about 18MB instead of the expected ~4GB), instead the installer would download files into “/macOS Install Data/” so I waited until the installer had downloaded all the files by manually monitoring the directory, aborting the install and moving the files over.

    The second problem was that the installation got stuck with a message saying

    kextd stall[0], (240s): ‘AppleACPICPU’

    and that was solved by installing the FakeSMC and/or NullCPUPowerManagement kexts in EFI/CLOVER/Other (not sure if it was just one of them and I’m afraid to remove either now since it might break my system). This might be related to me applying your patches to HEAD of master for pve-qemu (2.9.1-1) instead of the 2.9.0 version you based your patch on top of.

    Other than that it was smooth sailing, thanks!

    1. Hm, it seems like the High Sierra installer might have been gutted of data soon after I wrote this post… mine included all the data to begin with. That’s annoying!

    1. Sorry, I don’t have a tutorial for that yet. The process will be very similar to a regular hackintosh, so try combining my guide with the guides people are now making for hackintosh High Sierra.

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.