r/linux • • 1d ago

Development XNU Linux: Run a full macOS GUI userspace inside an unmodified arm64 Linux kernel via xnu.ko

Repo: https://github.com/AFK-surf/xnulinux

xnulinux builds Apple's open source XNU kernel and loads it as a kernel module (xnu.ko) inside an unmodified arm64 Linux kernel. There is no hypervisor in between. The hosted XNU drives the CPU and MMU directly alongside Linux processes, borrowing memory, files, networking, and GPU access through a small interface module (fki.ko).

On a stock Ubuntu kernel, running insmod xnu.ko boots a macOS 27 system disk straight to the desktop with WindowServer, Dock,Finder, and Safari running.

88 Upvotes

26 comments sorted by

12

u/3rdUncleMeatSandwich 1d ago

if only i had an arm64 computer!

17

u/Sweet-Transition-787 1d ago

Even a random arm64 computer is not enough. The cpu must support Pointer Authentication from ARMv8.3 or newer, 4K pages, and 16 GB or more RAM because 8 GB goes to XNU. So something like a RPi 4 or 5 will not work.
You also still need a Mac with Xcode to make the system disk, and bare metal arm64 machines currently only get CPU rendering without GPU acceleration. Still a very interesting project for newer ARM laptops in the future.

1

u/3rdUncleMeatSandwich 1d ago

well, i didnt wanna be verbose but yes! this is exciting, given the death of OCLP

1

u/saiyate 17h ago

RTX Spark laptops satisfy the hardware reqs, just need some Linux catchup on the software side.

1

u/satmandu 3h ago

A 16Gb RPi5's bcm2712 processor supports 4k pages but only has ARMv8.2-A... so there is no pointer authentication... so close...

1

u/Small-Tap6130 22h ago

You also still need a Mac with Xcode to make the system disk, and bare metal arm64 machines currently only get CPU rendering without GPU acceleration.

May everything apple burn in ashes.

11

u/iBoMbY 1d ago

Death by Xnu Xnu.

6

u/sCeege 1d ago

I'm slightly amused at the thought that if someone buys one of those Surface spark laptops, they can now mix Microsoft, Apple, and Linux, on the same computer.

0

u/adoodle83 17h ago

got a link?

4

u/sCeege 11h ago

To the laptop? It's like $5k+ lmao (for a useful amount of RAM). Rather get a Mac Studio for that kind of price tag.

1

u/This_Music682 1d ago

Basically Means that Hackintosh is Back? (And even more Accessible?)

5

u/Sweet-Transition-787 1d ago

Not really like the old Hackintosh days, at least not yet.
First, it does not work on normal Intel or AMD PCs. There is no hypervisor or emulation here, so it needs areal arm64 CPU with Pointer Authentication, 4K pages, and at least 16 GB of RAM.
Second, bare metal GPU acceleration is not ready yet. Right now the GPU bridge only supports virtio gpu. It works inside a Linux VM on an Apple Silicon Mac, but on a bare metal arm64 Linux machine it falls back to slow CPU rendering.
Also you still need a real Mac with Xcode to prepare the system disk and build some parts. Right now it also disables several macOS security checks to boot. So it is a very cool kernel project, not an easy daily driver for everyone yet.

3

u/This_Music682 1d ago

Thanks for the Answer:)

But to think that the "Hackintosh" could (maybe) make a ARM-Comeback is pretty cool :)

1

u/adoodle83 17h ago

what arm64 board has those specs?

4

u/UNF0RM4TT3D 1d ago

Your Scientists Vibecoders Were So Preoccupied With Whether Or Not They Could, They Didn’t Stop To Think If They Should

2

u/brick-pop 1d ago

Sounds like a very interesting approach, props for the vision 👏

Just so I understand it, what's the use case that justifies using xnulinux?
Running mac apps on non Apple hardware, by leveraging Linux hardware support, while giving Darwin a wrapper to the logic devices available?

2

u/sheeproomer 11h ago

Oh god who even is so masochistic and wants the macos user space voluntarily? Everyone I know just installs there homebrew and pretends that user space doesn't exist?

1

u/Few-Flamingo-6678 17h ago

porting to x64 is ongoing

1

u/adamkex 10h ago

Is it possible to just run individual Mac apps in a Linux DE or do you need the entire Mac GUI?

1

u/crackhash 8h ago

Cutefish OS devs are working on a project called Reef to run macos gui apps in a Linux desktop. You can watch the video from Linux Experience youtube channel. It is still in pre-alpha stage.

1

u/mohsin0112 4h ago

Will my MacBook Pro 2015 support this?

1

u/Vladimir_Chrootin 3h ago

No. Your MacBook is AMD64, not Arm.

2

u/mohsin0112 3h ago

Thanks for the clarification.

1

u/Bulky-Hair8606 3h ago

Does a raspberry pi work

1

u/Electrical_Puffin 1h ago edited 1h ago

could i in theory get an M Series Mac, install asahi linux with xnu? and have best of both worlds?
mac on a mac running side by side with linux without needing to dualboot?

•

u/FaultWinter3377 55m ago

This might have been one of the most cursed things I’ve seen lately. Next we’ll get the Windows kernel embedded into Linux and the whole Windows user space running natively inside Linux..