XNU Linux For Booting MacOS Kernel And User Environment Into Linux

Heyang Zhou (Heyang Zhou), one of the creators of the Deno Deploy platform, published the project XNU Linux, which allows you to build and download the XNU as a Linux kernel module, and use it to run a custom macOS environment on Linux. XNU is used in macOS, is part of the open source Darwin project and is a hybrid kernel that combines the Mach microkernel, FreeBSD kernel subsystems and the IOKit C++ API for writing drivers. By loading XNU as a kernel module, you can launch the native macOS graphical environment inside Linux, in which macOS applications will run, including the Safari browser.

The XNU kernel is assembled from source code provided by Apple and runs on Linux in the form of the xnu.ko kernel module, which directly interacts with the CPU and memory management unit (MMU), allowing Linux and Linux processes to run side by side on the same CPU.
macOS without a hypervisor. To access the XNU kernel to memory, files, timers, exception handling, network and GPU through the Linux kernel, a layer module fki.ko (Foreign Kernel Interface) was created.

The module with the XNU kernel works in its own address space – the XNU kernel receives a contiguous block of physical memory from Linux and manages it through its pmap, and part of the address space for user processes is shared between Linux and XNU. Each virtual CPU for macOS is framed as a Linux kernel thread,
assigned to the physical CPU core. Plug-in drivers are provided to access the macOS disk image, display, keyboard, mouse, Ethernet, and GPU. The Metal graphics API is implemented on top of Vulkan through the metal2vulkan layer.

The project’s kernel glue module and related utilities are distributed under the GPLv2 license, XNU kernel module components supplied under the APSL-2.0 license, borrowed from the project macOS-DroidVM XnuDisplay, XnuEthernet and XnuInput drivers are available under the BSD license. XNU Linux also uses the developments of the UniXNU project, which allows you to run macOS and iOS on non-Apple ARM64 systems. XNU Linux is being developed using the Claude AI assistant. As an example, we demonstrate the launch of a system disk with macOS created by the Apple installer in Ubuntu Linux. Currently only supported to run on Apple ARM computers with M1 chips and later.




/Reports, release notes, official announcements.