← Mon, Nov 23 digest

XNU Linux: Full OS X GUI Userspace on Linux

read article ↗ hn thread ↗

XNU Linux allows running the full macOS GUI userspace on arm64 Linux by loading the XNU kernel as a loadable kernel module.

read it It describes a highly novel architectural approach to running macOS on Linux without a hypervisor, providing significant technical depth on memory and GPU bridging.

summary

XNU Linux boots the open-source XNU kernel as a loadable module (xnu.ko) within an unmodified arm64 Linux kernel. By using a Foreign Kernel Interface (FKI), XNU manages the CPU and MMU directly while relying on Linux for memory, timers, networking, and GPU access. This allows macOS processes to run natively alongside Linux processes on the same CPU. The project supports full GUI environments, including Safari and Chrome, using a Metal-to-Vulkan bridge for GPU acceleration on supported hardware.

key points

  1. XNU runs as a non-GPL module in Linux, utilizing a contiguous block of memory (CMA) and sharing the user address space layout.
  2. GPU acceleration is achieved via a bridge that translates Metal calls to Vulkan, utilizing Mesa's Venus driver or falling back to CPU rendering.
  3. The system requires an arm64 host with PAC (Pointer Authentication) and at least 16GB of RAM, typically requiring Apple Silicon hardware.
  4. It boots a full macOS 27 system disk to the desktop in 31-48 seconds on Apple Silicon Macs running Linux VMs.

who should read it

Kernel engineers, OS enthusiasts, and developers interested in virtualization and cross-platform compatibility.

discussion warm

consensus

Commenters are impressed by the technical feat, noting that it bypasses the long-term struggles of projects like Darling or GNUstep by using the actual kernel.

pushback

Some argue the project's utility is limited because it still requires Apple hardware to function due to architectural extensions and PAC requirements.

best comment by mike_hearn ↗

It's not open source, really. Not anymore. A lot of the newer code added since the first versions of macOS is proprietary. A lot of the code signing and security subsystem is closed source, the APFS file system is too, most of the drivers are etc.

As for why a few parts remain open, it's probably just inertia. When OS X was new the open source/free software movement was at the peak of its hype cycle, many treated it as a locked in future, sort of how people talk about AI today. Kernel engineers in general were always pretty pro-open source, much moreso than GUI layer developers, and Linux …

Provides a nuanced explanation of why Apple keeps XNU open source while keeping the high-value userspace and security subsystems proprietary.

Generated by an LLM from the article and thread. Check the sources before relying on it.