xnulinux: macOS 27 Desktop Inside Linux Without a Hypervisor
AFK-surf/xnulinux
About the project
xnulinux is a project that builds the XNU source code released by Apple and loads it as a Linux kernel module. Unlike existing virtualization methods, it does not go through a hypervisor; instead, macOS processes directly use the host Linux CPU and MMU. Linux provides memory, timers, files, network, and GPU to XNU through small interface modules.
In an arm64 Linux environment based on Ubuntu 24.04.5 LTS, the macOS 27 system disk boots with just the insmod xnu.ko command. The login screen, WindowServer, Dock, Finder, Safari, and Chrome run natively on the same CPU as Linux processes. On an arm64 Linux VM on an Apple Silicon Mac, the desktop is reached in 31 to 48 seconds, and it also runs on the NVIDIA DGX Spark with an allocation of 4 CPUs and 8GiB RAM.
GPU integration is achieved through metal2vulkan, which converts Metal to Vulkan. If a host GPU is present, hardware acceleration is used via a DRM bridge; otherwise, it falls back to CPU rendering with Mesa lavapipe. Currently, only virtio-gpu (Venus) ioctls are passed through, so GB10 GPU hardware passthrough requires the implementation of a new DRM bridge backend.
An arm64 Linux host supporting PAC (FEAT_PAuth) and 4K pages is required, with 8GB of the minimum 16GB RAM reserved for the host kernel. Apple binaries are not included in the repository; users must create the system disk using their macOS installation files and Xcode. It is suitable for developers who want a structure where macOS and Linux coexist as two user spaces on a single system.
AFK-surf/xnulinux
XNU as a loadable kernel module inside Linux (macOS personality for arm64 Linux)
C