HACKER Q&A
📣 xrd

Is there any way to create a virtualized build machine for macOS?


I was really excited to see virtualization become a first class citizen on recent versions of MacOS.

Why? This means that I can now create a build system that is a disk image I can run on any MacOS hardware, and a disk image I can copy like a file over to a new host. Backups of this build system now are simple.

For years, I've maintained several old Macs solely for the purpose of having a reliable build machine that can build our software, but more importantly, have a stable and working set of certificates and entitlements to do the signing and notarization dance that Apple requires to deliver software that can run on their OS.

Reccently, one of these machines stopped working. Hardware failure? Software upgrade behind the scenes? Certificate expiration? Change on Apple's end? I don't really know.

But, I figured it was time to get a VM running and see if I could build our software. I decided to use UTM and had a new machine up in minutes. I was so excited when I got our software to build, which requires older versions of QT, XCode and a bunch of other software that only comes as a PKG or DMG, so challenging to manage versions, etc. There are lots of issues with all the packaging systems out there, but at least Rust and NodeJS, for example, support a lock file, where I can be somewhat assured I'm running something close to what was on the dev machine. Not as easy with MacOS software like XCode or C++ libraries distributed as PKGs or DMGs, downloads which often go missing or change.

But, then I wanted to do the signing and notarization step. I tried multiple times to login to Apple and it failed each time, with bad password. I tried using the recovery process, got a SMS message. Finally got the "login failed" with nothing more. I chalked this up to Apple.com developer servers having a problem and figured I would try later.

Then I read this thread:

https://apple.stackexchange.com/questions/444379/virtualized-macos-via-utm-will-not-allow-sign-in-to-the-app-store-for-installati

It says:

> Yes. There is an 'entitlement restriction' which prevents Apple ID related actions in VMs.

So, does this mean that I will never be able to get a full build machine up within a VM? Has anyone successfully virtualized their MacOS build system to avoid all the problems I've been facing for years?

Is this because I am using UTM instead of the native MacOS VM system? I want to use the native MacOS VM system, but all the examples seem to require using Swift, and I'm not a Swift developer. I believe that UTM is different and runs QEMU instead of MacOS VM, but the documentation seems to suggest that it runs both?


  👤 JoeAltmaier Accepted Answer ✓
Sometimes. Usually no. You can't even develop on the wrong mac - one that's too old for instance. It won't install the modern tools, which are supported on the latest versions.