Technology1 min read

XNU Linux: Full OS X GUI Userspace on Linux

By · Published by Everything Blog

In short

The implementation enables a macOS installation to boot directly to an interactive desktop environment using standard systemd service management. In evaluations conducted on Apple Silicon hardware, the platform reached an interactive state in under a minute and successfully sustained native applications during a multi-utility stress test. The setup utilizes a translation bridge to deliver hardware-accelerated graphics while providing software rendering when graphics processors are absent.

Key points

  • The project distributes no proprietary Apple binaries, requiring users to supply their ow…: The project distributes no proprietary Apple binaries, requiring users to supply their own macOS system disks.
  • Operating the environment requires an arm64 Linux host equipped with roughly 24 gigabytes…: Operating the environment requires an arm64 Linux host equipped with roughly 24 gigabytes of memory.
  • Current constraints include reduced memory performance from 4K page sizes alongside relax…: Current constraints include reduced memory performance from 4K page sizes alongside relaxed System Integrity Protection settings.

Sources checked by our analysis pipeline: 1

Run macOS userspace on Linux by loading the macOS kernel into it.

xnulinux builds XNU, the open-source kernel of macOS, from Apple's published sources and runs it as a loadable kernel

module (xnu.ko

) inside an unmodified arm64 Linux kernel. The hosted XNU drives the CPU and MMU directly, so macOS

processes run natively next to Linux processes on the same CPUs, with no hypervisor between them. Linux lends XNU its

memory, timers, files, network and GPU through a small interface module (fki.ko

).

With a stock Ubuntu kernel, insmod xnu.ko

boots a macOS 27 system disk made by Apple's own installer to the

desktop: loginwindow, WindowServer, Dock, Finder, Safari and Chrome.

One system, two userspaces. Left: a Terminal in the hosted macOS 27.2.1 (sw_vers

, the Darwin kernel, launchd,

WindowServer, Dock and Finder running). Right: from that macOS, an SSH session into the Linux it runs inside (Ubuntu,

Linux 7.0, the xnu

and fki

modules loaded, and the insmod xnu.ko

process the macOS kernel runs in).

Straight from the hosted framebuffer, 1280×800.

The hosted desktop at the end of…

Technology