Asahi Linux, plus better VM support, makes Apple Silicon more compelling for devs

Asahi Linux, plus better VM support, makes Apple Silicon more compelling for devs
Apple M1 Mac

In November 2020 Apple introduced the M1 processor – an Arm-based chip marking the beginning of the transition from Intel CPUs to Apple Silicon. Apple M1 machines can be good value despite the premium price if they save developers time, and the combination of excellent performance and high efficiency – leading to long battery life for those on a laptop – is a strong attraction.

A high-end Mac Studio running the M1 Ultra chip has a maximum power consumption of 215W, according to Apple’s specs – modest for a system that is among the best-performing workstations out there.

Windows on Arm running on M1 Mac via UTM (qemu)

There are some snags with the move away from Intel though. Rosetta 2 is a translation layer that enables x86 applications to run on macOS, but while it works well for many macOS applications, the M1 is not good for running x86 virtual machines. Virtualization is important for developers because it is ideal for testing and debugging applications in an isolated environment.

VMware lamented last year that “Rosetta 2 doesn’t support virtualization,” and added that “there isn’t exactly much business value relative to the engineering effort that is required … Running x86 operating systems on Apple Silicon is not something we are planning to deliver.”

That said, the story is improving for virtualization of Arm-based operating systems – whether using systems based on the open source qemu project, or commercial systems such as VMware Fusion (in public preview) or Parallels Desktop (which supports Windows on Arm for M1). Performance is good according to reports like this, which reported a virtualisation penalty of 6.7 per cent for single-core and 27 per cent for multi-core when running Arch Linux under emulation. There is still some friction though, especially when going the open source route, with extra configuration steps needed.

A compelling option

An option worth looking at is Asahi Linux – a port of Arch Linux that runs natively on the M1, released in alpha last month. Alpha releases are not recommended for production use, which makes a report from Jason Eckert (Dean of Technology at triOS College in Ontario, Canada) surprising. He said that he installed the Asahi Linux alpha immediately on its release and describes it as “unbelievably fast … and while it’s missing a few features that will be added shortly (GPU acceleration, Bluetooth, sound) it’s otherwise very polished and 100 per cent production ready. Moreover, it runs my software much faster than macOS on the same hardware.” For example, Eckert said, the Hugo static site generator composes his web site “in half the time it does on macOS.”

The main obstacles Eckert has encountered are “proprietary apps that don’t have an arm64 build (e.g. Slack), as well as Electron- and Chromium-based apps (e.g. VSCode, Chrome, etc.) because of the M1’s 16K page size that is apparently going to be fixed shortly with a new Linux kernel.” Luckily he is happy with the vim editor in place of Visual Studio Code. It should also  be noted that GPU acceleration is not yet supported.

Testing compilers on Asahi Linux, Michael Larabel at Phoronix found that “GCC 11.2 led by about 13 per cent over Clang.”

It is still early days for Asahi Linux, and developers do worry whether the M1 Mac may become a closed system at some future date – though there is no evidence that Apple is planning that. Taken together with emulation options though, M1 Macs are compelling for developers, and free of Windows annoyances like mystery slowdowns or creeping advertising in the user interface.