Running non-Apple Intel binaries on an M1 Mac
Tags: x86, macos, qemu, m1
Published: 2022-05-21 05:31:00

> This article originally appeared on my personal dev blog: [Byte High, No Limit](https://andrewowen.net/blog/).

Since late 2018, I've been _developing on Apple Silicon_. You can read about it in an earlier post. But that's using an iPad, and the only native builds I can do rely on an app that's no longer available. What most people think of developing on Apple Silicon, they're thinking of M1 Macs. And I've been doing that since May 2021.

When Apple ditched 32-bit support in macOS, I had a feeling ARM Macs wouldn't be far behind, on the basis that unlike Intel, Apple's chips didn't have a 32-bit mode. This is the fourth time Apple has changed architecture in its computer lines. When it went from 6502 to 65C816 with the Apple IIGS, it developed a partial system-on-a-chip (SoC) implementation of the Apple II. It later created a card based on this for the Mac, which had an MC68000 CPU.

When Macs moved to PowerPC CPUs, they were fast enough to emulate the MC68000 instruction set. The move from PowerPC to Intel depended on just-in-time (JIT) instruction translation software licensed from Transitive (a company spun out of a research project at Manchester University in England). Transitive used to support a plethora of architectures, until IBM bought the company to add support for running Linux Intel binaries on its Linux PowerPC machines. As an aside, I briefly used Transitive to run the SPARC version of FrameMaker on the x64 version of Solaris.

Apple branded the technology Rosetta, and it kept it around for quite a while, but eventually it dropped support for running PowerPC binaries on macOS. Now we have Rosetta 2, and I wonder if it has licensed the technology from IBM. This enables macOS Intel binaries to run on Apple's ARM CPUs. The catch is that I'm fairly sure that one day, just like it did with Rosetta, Apple will release a version of macOS that drops Rosetta 2 support. More on that later.

Development isn't all coding. Sometimes you need to run an application, for example to create an asset. As it's still early days for macOS on ARM CPUs, native apps aren't always available, but for now Rosetta 2 lets you run most of your old 64-bit Intel macOS apps. But what if you needed to run Linux or Windows apps? You can virtualize ARM Linux and ARM Windows on an ARM Mac with commercial offerings [Parallels](https://www.parallels.com/ "Parallels") or [VMware Fusion](https://www.vmware.com/products/fusion.html "VMware Fusion") (at the time of writing, there is no native version of [VirtualBox](https://www.virtualbox.org/ "VirtualBox")).

If there's an ARM version of the app you want, then great. If not? Well, Windows 11 on ARM has X64 emulation. But you can't buy Windows 11 ARM from Microsoft. It's only available to OEMs. So you'll have to use the preview edition. And that can't be upgraded, so if you need an upgrade, you'll have to reinstall. Microsoft has no intentions to license [Windows on ARM](https://answers.microsoft.com/en-us/windows/forum/all/activating-windows-11-on-parallels/89674d9c-96c2-44ac-a19c-2caca7156772 "Windows on ARM"). It's not clear that it will always be possible to install the [preview version](https://www.parallels.com/blogs/windows-11-tpm/ "Windows 11 on Parallels"). Maybe you'd prefer to stick with Windows 10. And what if you need to run an Intel Linux binary? The answer is [QEMU](https://www.qemu.org/ "QEMU"), a “generic and open source machine emulator and virtualizer.”

QEMU is notoriously difficult to configure, but on Macs there is a packaged version called [UTM](https://mac.getutm.app/ "UTM") (Universal Turing Machine?). It's available as a free download from the website or as a paid download with automatic updates from the app store. It comes with a gallery of pre-configured machines, which at time of writing include ArchLinux/ARM, Debian 10/ARM, macOS 9/PPC, ReactOS/x64, Solaris 9/SPARC, Ubuntu 14.04/x64, Ubuntu 20.04/ARM, Windows XP/x64, Windows 7/x64, Windows 10/ARM and Windows 11/ARM.

You'll note that the x64 version of Ubuntu is much older than the ARM version. And the reason for that is that x64 emulation is slow. I used to run SoftWindows 95, emulating an x86 CPU on a PowerPC Mac, and this can be slower. For that reason, if you're virtualizing a non-ARM OS, then you'll want the most lightweight version available.

I have a few tools that I used to run under WINE on macOS (until Apple dropped 32-bit support). Codweavers is working tirelessly to get 32-bit and 64-bit Windows apps running on macOS with [Crossover](https://www.codeweavers.com/crossover "Crossover"), its commercial version of WINE, but it's early days at the moment. That led me to trying out [ReactOS](https://reactos.org/ "ReactOS") with UTM. It's a project to create a completely open source Windows-binary compatible OS. But in its current state I'd consider it pre-alpha. So I had to find a different solution.

After trying a few different options, I settled on Lubuntu 18.04 (because 19.04 drops 32-bit support). This is essentially a lightweight version of Ubuntu. I went with the 32-bit version because the Windows apps I need to run are all 32-bit, and it simplifies installing WINE. It

As with any VM, the critical step to make it usable is installing the guest tools, in this case [SPICE](https://www.spice-space.org/ "SPICE"). With that installed and configured, you can set up shared folders and you no longer need to capture the mouse. I got away with just installing `spice-vdagent` with `apt`. After enabling directory sharing in the settings for the VM, you can click the folder icon in the running VM to set the shared directory.

The other VM that I use quite often is the latest Ubuntu/ARM release. I typically use this for running command line tools that haven't made it into macOS or [homebrew](https://brew.sh/ "homebrew") yet. But I have the full desktop environment installed, and it doesn't feel laggy. The one missing app is Chrome, but Chromium is available and works just as well for syncing with your Google account.

**Note**: At the time of writing, network support is somewhat flaky in the current version of QEMU. I assume this will eventually be fixed, but for now if you're running an ARM VM then I would recommend using the VMware [tech preview](https://blogs.vmware.com/teamfusion/2021/09/fusion-for-m1-public-tech-preview-now-available.html "VMware M1 Tech Preview") or Parallels [Desktop 17](https://www.parallels.com/eu/products/desktop/trial/ "Parallels Desktop 17"). I also found out that you can activate Windows 11 ARM in a VM if you have a developer license key.