{"id":80517,"date":"2026-12-02T07:06:10","date_gmt":"2026-12-02T07:06:10","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=80517"},"modified":"2026-12-02T07:06:12","modified_gmt":"2026-12-02T07:06:12","slug":"xnulinux-tutorial-how-to-run-macos-and-puredarwin-on-arm64-linux","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/xnulinux-tutorial-how-to-run-macos-and-puredarwin-on-arm64-linux\/","title":{"rendered":"xnulinux Tutorial: How to Run macOS and PureDarwin on ARM64 Linux"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\n  A hands-on guide for Linux engineers, developers, SREs and operating-system researchers. Source review: 2 December 2026.\n<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"630\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/original-featured-illustration-showing-linux-and-d.png\" alt=\"Original featured illustration showing Linux and Darwin applications converging on an ARM64 Linux host via FKI and hosted XNU.\" class=\"wp-image-80518\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/original-featured-illustration-showing-linux-and-d.png 1200w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/original-featured-illustration-showing-linux-and-d-300x158.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/original-featured-illustration-showing-linux-and-d-1024x538.png 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/original-featured-illustration-showing-linux-and-d-768x403.png 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/original-featured-illustration-showing-linux-and-d-820x430.png 820w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"caption wp-block-paragraph\">\n  Featured image \u2014 xnulinux technical field guide (1200 \u00d7 630 px).\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\n  What if Linux could host the XNU kernel without launching a second conventional virtual machine? xnulinux explores that idea using kernel modules and a modified XNU build. The project has demonstrated graphical macOS and a separate open-source Darwin console environment. It is a research system, not a drop-in replacement for a supported Mac.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What you will learn<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><br>    Understand the XNU, FKI, memory and GPU architecture.<br>  <\/li>\n\n\n\n<li><br>    Prepare an isolated ARM64 Linux lab, build XNU and boot PureDarwin or macOS.<br>  <\/li>\n\n\n\n<li><br>    Validate the runtime, manage its service, troubleshoot failures and evaluate real-world use cases.<br>  <\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Evidence legend: UPSTREAM = documented by the project; EXAMPLE = proposed diagnostic or lab procedure, not executed here. All xnulinux commands in this article are independently untested. Do not interpret example results as measured output.\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/AFK-surf\/xnulinux\" rel=\"noopener\">Official xnulinux repository and README<\/a>\n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. What is xnulinux?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\n  XNU is the kernel underlying Darwin and macOS. It combines Mach facilities, BSD services and I\/O Kit. Darwin is not the complete macOS desktop: proprietary frameworks, applications and drivers are additional components. xnulinux adapts XNU so it can operate within an ARM64 Linux host, rather than reimplementing the macOS API in Linux.\n<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"630\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/linux-applications-enter-the-linux-kernel-directly.png\" alt=\"Linux applications enter the Linux kernel directly; Darwin applications enter hosted XNU, whose modules mediate host resources.\" class=\"wp-image-80519\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/linux-applications-enter-the-linux-kernel-directly.png 1200w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/linux-applications-enter-the-linux-kernel-directly-300x158.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/linux-applications-enter-the-linux-kernel-directly-1024x538.png 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/linux-applications-enter-the-linux-kernel-directly-768x403.png 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/linux-applications-enter-the-linux-kernel-directly-820x430.png 820w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"caption wp-block-paragraph\">\n  Figure 1. Conceptual xnulinux architecture.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How it differs from emulation<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  The hosted kernel controls execution and address translation for its ARM64 workloads. FKI (Foreign Kernel Interface) coordinates resources with Linux, including reserved RAM, CPUs, faults and devices. The Linux kernel remains the host. No CPU instruction emulator or separate hypervisor is required at that inner boundary; on a Mac, the outer Linux VM still uses virtualization.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Key components<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><p><strong>Component<\/strong>\n<\/p><\/th><th><p><strong>Purpose<\/strong>\n<\/p><\/th><\/tr><\/thead><tbody><tr><td><p>\n  fki.ko\n<\/p><\/td><td><p>\n  Host interface; resource and interrupt coordination.\n<\/p><\/td><\/tr><tr><td><p>\n  xnu.ko\n<\/p><\/td><td><p>\n  Loads the XNU collection and executes hosted kernel code.\n<\/p><\/td><\/tr><tr><td><p>\n  Kernel collection\n<\/p><\/td><td><p>\n  Patched XNU and extensions; free or Apple-dependent build.\n<\/p><\/td><\/tr><tr><td><p>\n  System disk\n<\/p><\/td><td><p>\n  Darwin HFS+ or prepared macOS disk; separate from kernel.\n<\/p><\/td><\/tr><tr><td><p>\n  xnudrmd\n<\/p><\/td><td><p>\n  Optional host GPU bridge.\n<\/p><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/AFK-surf\/xnulinux\/blob\/main\/docs\/hosted-service.md\" rel=\"noopener\">Architecture and distribution details<\/a>\n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. Requirements and supported environments<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Start on an Apple Silicon Mac with an isolated Ubuntu ARM64 VM. The upstream prerequisites are ARM64 with pointer authentication (PAC), 4 KiB Linux pages and at least 16 GB RAM in the Linux environment, of which roughly 8 GB is set aside. A Mac with 24\u201332 GB or more physical memory is a sensible lab recommendation, not an upstream minimum.\n<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><p><strong>Environment<\/strong>\n<\/p><\/th><th><p><strong>Assessment<\/strong>\n<\/p><\/th><\/tr><\/thead><tbody><tr><td><p>\n  Apple Silicon + Ubuntu VM\n<\/p><\/td><td><p>\n  Upstream demonstrated via Tart or krunkit.\n<\/p><\/td><\/tr><tr><td><p>\n  NVIDIA DGX Spark\n<\/p><\/td><td><p>\n  Upstream bare-metal demonstration; machine-specific configuration and macOS license restrictions.\n<\/p><\/td><\/tr><tr><td><p>\n  AWS Graviton \/ other ARM\n<\/p><\/td><td><p>\n  Not established by the reviewed README. Check PAC, page size, interrupt and RAM layout.\n<\/p><\/td><\/tr><tr><td><p>\n  Intel or AMD x86-64\n<\/p><\/td><td><p>\n  Not the current target.\n<\/p><\/td><\/tr><tr><td><p>\n  Raspberry Pi\n<\/p><\/td><td><p>\n  Do not assume compatible; CPU features and kernel layout matter.\n<\/p><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Preflight checklist (EXAMPLE)<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">uname -m\nuname -r\ngetconf PAGESIZE\nlscpu\ngrep -m1 Features \/proc\/cpuinfo\nfree -h\ndf -h \/\nls -ld \/lib\/modules\/$(uname -r)\/build\ncat \/proc\/cmdline<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">\n  Expect aarch64 and 4096 bytes per page. Look for PAC-related CPU features (for example paca\/pacg), and verify actual guest exposure. Missing kernel headers can be fixed before the build; unsupported page size or hardware is a stop condition.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Before touching the kernel<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><br>    Take a powered-off VM snapshot or clone; retain console access independent of SSH.<br>  <\/li>\n\n\n\n<li><br>    Use a disposable network, no real credentials, and ample disk space (plan for 150 GB or more for a full macOS build lab).<br>  <\/li>\n\n\n\n<li><br>    Review Apple\u2019s applicable macOS license; a technical demonstration on non-Apple hardware does not grant permission.<br>  <\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">3. Prepare the Apple Silicon lab<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"630\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/build-toolchain-and-kernel-collection-on-linux-pr.png\" alt=\"Build toolchain and kernel collection on Linux, prepare Apple disk on Mac, reserve memory and boot.\" class=\"wp-image-80520\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/build-toolchain-and-kernel-collection-on-linux-pr.png 1200w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/build-toolchain-and-kernel-collection-on-linux-pr-300x158.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/build-toolchain-and-kernel-collection-on-linux-pr-1024x538.png 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/build-toolchain-and-kernel-collection-on-linux-pr-768x403.png 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/build-toolchain-and-kernel-collection-on-linux-pr-820x430.png 820w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"caption wp-block-paragraph\">\n  Figure 2. End-to-end installation workflow.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1 \u2014 Create the Ubuntu VM<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  On the Mac, install Tart using its official installation guide. Create or clone an Ubuntu ARM64 guest named xnupoc using a trusted image or installer. Allocate at least 16 GiB RAM and enough vCPUs to leave Linux capacity. Set up an admin account with SSH access and an SSH key; keep the VM on an isolated network.\n<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">tart <span class=\"hljs-keyword\">list<\/span>\ntart ip xnupoc<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">\n  Tart commands are examples. If using krunkit later, follow the project\u2019s scripts\/krun-install.sh and scripts\/krun-vm.sh rather than starting two VMs on the same disk.\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/tart.run\/\" rel=\"noopener\">Tart installation and VM documentation<\/a>\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2 \u2014 Clone and record the revision<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Run the following inside Ubuntu as the lab user, then clone the same revision on the Mac if preparing the full macOS disk. The repository evolves quickly; never mix scripts from different revisions.\n<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">mkdir -p ~\/lab\ncd ~\/lab\ngit <span class=\"hljs-keyword\">clone<\/span> https:<span class=\"hljs-comment\">\/\/github.com\/AFK-surf\/xnulinux.git<\/span>\ncd xnulinux\ngit rev-parse HEAD\ngit status --short<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">\n  Record the commit SHA in your lab notes. Install git first if absent. Review scripts, downloads and licenses before running anything with elevated privileges.\n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. Build XNU and the kernel collection<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3 \u2014 Prepare the build toolchain (UPSTREAM)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Run on Ubuntu ARM64 from the repository root. The upstream builder obtains the DroidVM toolchain, configures LLVM and installs dependencies including matching Linux headers. It changes package configuration; review it first.\n<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">less scripts\/vm-xnu-build.sh\nless scripts\/vm-xnu-rebuild.sh\nbash scripts\/vm-xnu-build.sh<\/code><\/span><\/pre>\n\n\n<p class=\"wp-block-paragraph\">\n  The source review identified XNU xnu-12377.121.6 in the README. Exact versions may change. Do not run the whole build under sudo: scripts request elevation for privileged steps and expect the lab user\u2019s home directory.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4 \u2014 Choose the kernel collection<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  The free route uses source-built extensions and PureDarwin. For a graphical macOS boot, the patched kernel needs compatible Apple extensions from the exact kernelcache expected by the checked-out revision. At review time the README referenced macOS 27.2 build 26B123. Never substitute an arbitrary IPSW or use latest blindly.\n<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Full macOS branch (UPSTREAM)<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\n  On Linux, check the DroidVM configuration for the supported restore image. Use its actual URL in place of the example shell variable; install lzfse if required by the extraction tool. The Apple kernelcache is not supplied by xnulinux.\n<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">cat ~\/w\/dvm\/configs\/macos<span class=\"hljs-number\">-27.2<\/span><span class=\"hljs-number\">-26<\/span>B123.json\nmkdir -p ~\/w\/dvm\/out\/kc\n<span class=\"hljs-comment\"># Set IPSW_URL to the exact URL from the config.<\/span>\nread -r IPSW_URL\npython3 scripts\/apple-kc\/im4p.py <span class=\"hljs-string\">\"$IPSW_URL\"<\/span> \\\n  ~\/w\/dvm\/out\/kc\/kc27.bin\nbash scripts\/vm-xnu-rebuild.sh\nls -lh \/lib\/firmware\/xnu\/kc.bin<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">\n  An alternate documented route packages a source-built kit and links the matching Apple collection locally using scripts\/apple-kc\/link.sh. See the linked manual. Do not publish the resulting Apple-dependent collection.\n<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">PureDarwin branch (UPSTREAM)<\/h4>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">bash scripts\/vm-xnu-rebuild.sh\nbash scripts\/free-kc\/build.sh\nls -lh \/lib\/firmware\/xnu\/kc-free.bin<\/code><\/span><\/pre>\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/AFK-surf\/xnulinux\/blob\/main\/docs\/free-kc.md\" rel=\"noopener\">Kernel collection and PureDarwin build manual<\/a>\n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">5. Reserve RAM and initialize FKI<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"630\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-of-linux-managed-ram-an-approximatel.png\" alt=\"Illustration of Linux-managed RAM, an approximately eight GiB FKI carve-out and firmware-reserved memory in a sample VM.\" class=\"wp-image-80521\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-of-linux-managed-ram-an-approximatel.png 1200w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-of-linux-managed-ram-an-approximatel-300x158.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-of-linux-managed-ram-an-approximatel-1024x538.png 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-of-linux-managed-ram-an-approximatel-768x403.png 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-of-linux-managed-ram-an-approximatel-820x430.png 820w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"caption wp-block-paragraph\">\n  Figure 3. Illustrative memory split, not a physical address map.\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\n  A carve-out is a physical memory region Linux must not allocate. The installer adds a GRUB drop-in, disables kernel address randomization for its documented layout, and configures a boot-time FKI unit. This reduces hardening and available host RAM. Do not run on a shared or production system.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 5 \u2014 Configure and reboot (UPSTREAM)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  The defaults are intended for the project\u2019s 16 GiB VM layout. Confirm that layout against the script and \/proc\/iomem before applying. On other layouts, derive LINUX_MEM, CARVE_BASE and CARVE_MB from the actual host map; do not guess physical addresses.\n<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">cat \/proc\/iomem\nless scripts\/vm-install-fki-service.sh\nbash scripts\/vm-install-fki-service.sh\nsudo reboot<\/code><\/span><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Step 6 \u2014 Verify the reservation (EXAMPLE)<\/h3>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">cat \/proc\/cmdline\nfree -h\nsystemctl status xnulinux-fki --no-pager\nlsmod | grep fki\nsudo journalctl -k -b | grep -i fki<\/code><\/span><\/pre>\n\n\n<p class=\"wp-block-paragraph\">\n  Continue only if FKI is present without carve-out overlap errors. If the VM cannot boot, use its recovery console or restore the snapshot. Do not repeatedly change memory addresses by trial and error.\n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">6. Boot PureDarwin: the kernel research route<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\n  PureDarwin is a useful first experiment: it boots a Darwin shell, not Finder, Safari or the full macOS desktop. The upstream recipe relies on a particular fork and image build; review its current Nix instructions before starting.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 7A \u2014 Build and prepare a Darwin disk (UPSTREAM)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  On Linux, install Nix according to its official guidance and the dependencies required by the fork. Use a lab directory, not an existing disk or partition. The revision below is the one shown in the reviewed free-kc manual; the long URL is split using shell concatenation.\n<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">PD=<span class=\"hljs-string\">\"git+https:\/\/github.com\/AFK-surf\/PureDarwin\"<\/span>\nREV=b3b4b2812fdd1c5c251dc3089b5a1a9e00d29970\nPD=<span class=\"hljs-string\">\"$PD?submodules=1&amp;rev=$REV\"<\/span>\nnix build <span class=\"hljs-string\">\"$PD#image-arm64-virt-minimal\"<\/span>\nls -l result\/<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">\n  Find the actual image within result. The next command prompts for that path; do not pass a physical disk device. The extraction helper mounts the image read-only and retains file ownership.\n<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">read -r PD_IMAGE\nbash scripts\/puredarwin-root.sh <span class=\"hljs-string\">\"$PD_IMAGE\"<\/span> root.tar.gz\n<span class=\"hljs-comment\"># Install the required HFS+ tooling and gdisk first.<\/span>\nbash scripts\/mk-puredarwin-disk.sh root.tar.gz pd.img &gt; pd.conf\nls -lh pd.img pd.conf<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Step 8A \u2014 Boot and inspect (UPSTREAM)<\/h3>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">MAC_CONF=pd.conf DISK=pd.img IMAGE=xnu\/kc-free.bin \\\n  TRUSTCACHE= GPU=off scripts\/xnulinux-boot.sh<\/code><\/span><\/pre>\n\n\n<p class=\"wp-block-paragraph\">\n  Open a second Linux terminal. Read the kernel log; the root console channel is privileged. On a disposable system only, send a harmless command to it.\n<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">sudo journalctl -k -f\n<span class=\"hljs-comment\"># In another terminal:<\/span>\nprintf <span class=\"hljs-string\">\"uname -a\\n\"<\/span> | sudo tee \/dev\/xnu-chan0<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">\n  Expected evidence: a Darwin kernel identification in the hosted console log. Stop with scripts\/xnulinux-boot.sh stop. PureDarwin includes permissive security stubs; it is not a hardened multi-user platform.\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/AFK-surf\/xnulinux\/blob\/main\/docs\/free-kc.md\" rel=\"noopener\">PureDarwin upstream recipe<\/a>\n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">7. Boot full macOS: the Apple-dependent route<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Step 7B \u2014 Create a matching macOS disk on the Mac<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  On an Apple Silicon Mac with Xcode and Tart installed, clone the same xnulinux commit as the Linux host into ~\/lab\/xnulinux. Use a legally obtained, exact-version restore image matching the collection. Ensure the VM is shut down before copying its disk. This preparation modifies a working copy, not your everyday macOS installation.\n<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">cd ~\/lab\/xnulinux\n<span class=\"hljs-comment\"># Enter the local path or URL of the matching IPSW.<\/span>\nread -r MATCHING_IPSW\ntart create xnumac --from-ipsw <span class=\"hljs-string\">\"$MATCHING_IPSW\"<\/span>\ntart <span class=\"hljs-keyword\">list<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Step 8B \u2014 Stage and transfer the prepared disk<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  The upstream disk helper defaults to ~\/.tart\/vms\/xnumac\/disk.img. Its OUT_DIR option stages the files locally, avoiding the automatic SSH helper. Use a fresh directory. Review the script: it may merge the OS cryptex into the system volume and configure lab login and console access.\n<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">OUT_DIR=<span class=\"hljs-string\">\"$HOME\/lab\/mac-stage\"<\/span> \\\n  bash scripts\/mk-macvm-disk.sh\nls -lh <span class=\"hljs-string\">\"$HOME\/lab\/mac-stage\"<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">\n  Transfer mac.img, mac.conf and trustcache.bin privately to the Linux lab using an authenticated SSH connection. Set LINUX_HOST to the guest address (not a public server). Check free space; sparse disk images may expand during SCP.\n<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">read -r LINUX_HOST\nssh <span class=\"hljs-string\">\"admin@$LINUX_HOST\"<\/span> <span class=\"hljs-string\">\"mkdir -p ~\/mac-stage\"<\/span>\nscp <span class=\"hljs-string\">\"$HOME\/lab\/mac-stage\/\"<\/span>* \\\n  <span class=\"hljs-string\">\"admin@$LINUX_HOST:~\/mac-stage\/\"<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">\n  On Linux, ensure any earlier hosted system is stopped. Install the artifacts in the default locations. This example assumes a clean lab with no existing files at these paths.\n<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">sudo install -d \/lib\/firmware\/xnu\nsudo mv ~<span class=\"hljs-regexp\">\/mac-stage\/m<\/span>ac.img \/<span class=\"hljs-keyword\">var<\/span>\/tmp\/mac.img\nsudo mv ~<span class=\"hljs-regexp\">\/mac-stage\/m<\/span>ac.conf \/<span class=\"hljs-keyword\">var<\/span>\/tmp\/mac.conf\nsudo install -m <span class=\"hljs-number\">600<\/span> ~<span class=\"hljs-regexp\">\/mac-stage\/<\/span>trustcache.bin \\\n  \/lib\/firmware\/xnu\/trustcache-mac.bin\nsudo chmod <span class=\"hljs-number\">600<\/span> \/<span class=\"hljs-keyword\">var<\/span>\/tmp\/mac.img \/<span class=\"hljs-keyword\">var<\/span>\/tmp\/mac.conf<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">\n  If ownership prevents the selected service user from reading a required file, resolve ownership narrowly; never make disk images world-readable.\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/AFK-surf\/xnulinux\/blob\/main\/scripts\/mk-macvm-disk.sh\" rel=\"noopener\">Official disk preparation script<\/a>\n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">8. First macOS boot and validation<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Step 9 \u2014 Start with CPU rendering (UPSTREAM)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Run on Ubuntu from the repository root after the collection, disk and FKI are prepared. Begin with two hosted CPUs and the documented memory size. Verify your lab has spare CPUs and the selected memory fits the carve-out. GPU=off is a diagnostic baseline, not a promise that every desktop app will render.\n<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">CPUS=2 RAM_MB=7900 GPU=off scripts\/xnulinux-boot.sh<\/code><\/span><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Step 10 \u2014 Observe both environments (EXAMPLE)<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-12\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">lsmod | grep -E <span class=\"hljs-string\">\"^(xnu|fki)\"<\/span>\nsudo journalctl -k -b | tail <span class=\"hljs-number\">-100<\/span>\nip -br addr\nip addr show xnu0\nls -lh \/<span class=\"hljs-keyword\">var<\/span>\/tmp\/xnu-fb.raw<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">\n  The Linux host should remain Linux, and the hosted Darwin system should report Darwin. Use the console tool from the Mac if the vm.sh SSH helper has been configured, or the local FKI channel as documented for your revision. The helper expects vm.ip and vmkey in the parent workspace, admin SSH access, and optionally vm.port. It disables SSH host-key checking; use only on a private disposable network.\n<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-13\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">printf <span class=\"hljs-string\">\"uname -a\\nsw_vers\\n\"<\/span> | sudo tee \/dev\/xnu-chan0\nsudo journalctl -k -b | grep <span class=\"hljs-string\">\"darwin console\"<\/span> | tail <span class=\"hljs-number\">-30<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-13\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Desktop and networking checks<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><br>    Use the framebuffer tool with the actual width and height from your run; example below is illustrative.<br>  <\/li>\n\n\n\n<li><br>    Use Screen Sharing or SSH only if enabled and reachable on the isolated guest link. Discover the address from the hosted console; do not expose it directly to the internet.<br>  <\/li>\n\n\n\n<li><br>    In the hosted terminal, check sw_vers, open Finder or Safari, and test access to a benign webpage. Record errors and screenshots as lab evidence.<br>  <\/li>\n<\/ul>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-14\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">python3 tools\/hosted\/fb2png.py \\\n  \/<span class=\"hljs-keyword\">var<\/span>\/tmp\/xnu-fb.raw <span class=\"hljs-number\">1280<\/span> <span class=\"hljs-number\">800<\/span> \/tmp\/xnu-screen.png<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-14\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">\n  The framebuffer command requires a complete BGRA dump at the specified dimensions. A blank image may indicate a GUI or rendering issue, not necessarily a kernel failure.\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/AFK-surf\/xnulinux\/blob\/main\/scripts\/xnulinux-boot.sh\" rel=\"noopener\">Boot script and runtime options<\/a>\n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">9. GPU, systemd and ongoing operations<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">GPU acceleration<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  After a stable boot, investigate GPU=auto. On a compatible krunkit Linux guest the bridge uses a virtio-gpu render node; on the demonstrated DGX Spark path it uses virglrenderer. The Darwin-side driver and Metal plugin must be built and installed as documented; CPU rendering and GPU rendering are not identical in capabilities.\n<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">ls -l \/dev\/dri\/\nscripts\/xnulinux-boot.sh stop\nGPU=auto CPUS=2 scripts\/xnulinux-boot.sh\nsystemctl status xnudrmd --no-pager<\/code><\/span><\/pre>\n\n\n<p class=\"wp-block-paragraph\">\n  If GPU initialization fails, return to GPU=off. The project also describes a remote GPU mode; it is experimental and should remain confined to a trusted lab.\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/AFK-surf\/xnulinux\/blob\/main\/tools\/dgx-spark\/README.md\" rel=\"noopener\">GPU implementation notes and DGX Spark setup<\/a>\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Install a systemd service (UPSTREAM)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Stop the manual boot first. The service installer needs noninteractive privileged access or must run as root. Avoid adding broad passwordless sudo to an ordinary workstation account; use a disposable dedicated VM and review the unit. The configuration is sourced as shell, so protect it from untrusted edits.\n<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">scripts\/xnulinux-boot.sh stop\nsudoedit \/etc\/xnulinux.conf<\/code><\/span><\/pre>\n\n\n<p class=\"wp-block-paragraph\">\n  Example full-macOS configuration (use a separate config for PureDarwin).\n<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-15\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">CPUS=<span class=\"hljs-number\">2<\/span>\nRAM_MB=<span class=\"hljs-number\">7900<\/span>\nGPU=off\nIMAGE=xnu\/kc.bin\nMAC_CONF=<span class=\"hljs-regexp\">\/var\/<\/span>tmp\/mac.conf\nDISK=<span class=\"hljs-regexp\">\/var\/<\/span>tmp\/mac.img\nTRUSTCACHE=xnu\/trustcache-mac.bin<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-15\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">\n  Run the service commands separately from the configuration above.\n<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-16\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">sudo bash scripts\/install-service.sh\nsudo systemctl start xnulinux\nsudo systemctl status xnulinux --no-pager\nsudo journalctl -u xnulinux -b\nsudo ls -l \/<span class=\"hljs-keyword\">var<\/span>\/log\/xnulinux\/<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-16\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">\n  The service can restart after a hosted failure and saves per-run logs. A restart is not evidence of isolation or data integrity. Inspect logs after each run.\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/AFK-surf\/xnulinux\/blob\/main\/scripts\/install-service.sh\" rel=\"noopener\">Systemd installer and removal procedure<\/a>\n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">10. Troubleshooting and rollback<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"630\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/lifecycle-from-snapshot-and-revision-recording-to.png\" alt=\"Lifecycle from snapshot and revision recording to boot, validation and controlled stop or recovery.\" class=\"wp-image-80522\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/lifecycle-from-snapshot-and-revision-recording-to.png 1200w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/lifecycle-from-snapshot-and-revision-recording-to-300x158.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/lifecycle-from-snapshot-and-revision-recording-to-1024x538.png 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/lifecycle-from-snapshot-and-revision-recording-to-768x403.png 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2026\/12\/lifecycle-from-snapshot-and-revision-recording-to-820x430.png 820w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"caption wp-block-paragraph\">\n  Figure 4. Safe experimental lifecycle.\n<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><p><strong>Symptom<\/strong>\n<\/p><\/th><th><p><strong>Likely cause \/ next step<\/strong>\n<\/p><\/th><\/tr><\/thead><tbody><tr><td><p>\n  Exec format error\n<\/p><\/td><td><p>\n  Wrong architecture; confirm ARM64 and matching toolchain.\n<\/p><\/td><\/tr><tr><td><p>\n  Module build or invalid format\n<\/p><\/td><td><p>\n  Headers or ABI differ; rebuild against uname -r. Review Secure Boot policy; do not weaken a production host.\n<\/p><\/td><\/tr><tr><td><p>\n  Carve-out overlaps RAM\n<\/p><\/td><td><p>\n  Incorrect boot memory reservation. Restore known-good configuration.\n<\/p><\/td><\/tr><tr><td><p>\n  No ROOT_UUID \/ BOOT_UUID\n<\/p><\/td><td><p>\n  Missing or wrong mac.conf \/ pd.conf; regenerate from correct disk.\n<\/p><\/td><\/tr><tr><td><p>\n  Missing kc.bin or boot panic\n<\/p><\/td><td><p>\n  Kernel collection absent or incompatible with the disk. Recheck pinned inputs and logs.\n<\/p><\/td><\/tr><tr><td><p>\n  No network or blank screen\n<\/p><\/td><td><p>\n  Check xnu0, network manager, framebuffer dimensions and GPU bridge; try GPU=off.\n<\/p><\/td><\/tr><tr><td><p>\n  Host hangs\n<\/p><\/td><td><p>\n  Potential kernel\/interrupt failure. Use out-of-band console or restore snapshot.\n<\/p><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Stop and remove cleanly (UPSTREAM)<\/h3>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">sudo systemctl stop xnulinux\nscripts\/install-service.sh remove\nscripts\/vm-install-fki-service.sh remove\nsudo reboot<\/code><\/span><\/pre>\n\n\n<p class=\"wp-block-paragraph\">\n  If never installed as a service, stop with scripts\/xnulinux-boot.sh stop first. The removal scripts retain disks and logs; archive or delete them deliberately only after backup. Verify restored RAM and boot arguments after reboot.\n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">11. Practical use cases for DevOps and developers<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><p><strong>Scenario<\/strong>\n<\/p><\/th><th><p><strong>What is credible now<\/strong>\n<\/p><\/th><th><p><strong>Next validation<\/strong>\n<\/p><\/th><\/tr><\/thead><tbody><tr><td><p>\n  Kernel engineering\n<\/p><\/td><td><p>\n  Darwin console, patched XNU and host calls\n<\/p><\/td><td><p>\n  Reproduce boots and inspect traces.\n<\/p><\/td><\/tr><tr><td><p>\n  Safari compatibility\n<\/p><\/td><td><p>\n  Upstream reports Safari desktop\n<\/p><\/td><td><p>\n  Manual smoke test; validate safaridriver separately.\n<\/p><\/td><\/tr><tr><td><p>\n  macOS CLI testing\n<\/p><\/td><td><p>\n  Darwin userland exists\n<\/p><\/td><td><p>\n  Confirm each Mach-O binary and framework.\n<\/p><\/td><\/tr><tr><td><p>\n  iOS \/ Xcode CI\n<\/p><\/td><td><p>\n  Potential; disk helper has Xcode staging options\n<\/p><\/td><td><p>\n  Validate actual builds, simulator, signing and licensing.\n<\/p><\/td><\/tr><tr><td><p>\n  Cloud \/ K8s workers\n<\/p><\/td><td><p>\n  Research idea only\n<\/p><\/td><td><p>\n  Do not deploy privileged modules in shared nodes.\n<\/p><\/td><\/tr><tr><td><p>\n  AI desktop agents\n<\/p><\/td><td><p>\n  Potential controlled GUI lab\n<\/p><\/td><td><p>\n  Validate input, screenshots and safe isolation.\n<\/p><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Hands-on exercise 1 \u2014 Compare the kernels<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Run uname -a and getconf PAGESIZE on Linux; run uname -a and sw_vers in the hosted macOS terminal. Record OS, CPU architecture and observed differences. Success means distinguishing the two userspaces while verifying the host remains healthy.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Hands-on exercise 2 \u2014 Safari smoke test<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  In the hosted macOS terminal, try opening a test site. Use an internal staging URL that contains no private data. Inspect responsive layouts, navigation and JavaScript behavior. A successful manual test is not automated browser support.\n<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-17\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">open -a Safari https:<span class=\"hljs-comment\">\/\/example.com<\/span>\nsafaridriver --version<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-17\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">\n  EXAMPLE, untested. Only attempt WebDriver after verifying Safari supports it in this environment; do not use this as a release gate until repeated runs are reliable.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Hands-on exercise 3 \u2014 Xcode feasibility<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-18\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">xcode-select -p\nxcodebuild -version\nxcodebuild -showsdks\nxcrun simctl <span class=\"hljs-keyword\">list<\/span> devices<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-18\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">\n  EXAMPLE, untested. These are probes, not proof that Xcode or iOS Simulator works. Use a disposable sample project, no distribution certificates, and compare the result to a supported Apple runner.\n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">12. Security, performance and alternatives<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\n  The main risk is privilege: hosted XNU executes at kernel privilege inside Linux. A compromised hosted system may compromise its Linux host. Treat the outer machine or VM as the isolation boundary. Never allow untrusted tenants to share it.\n<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><br>    The reviewed project documents relaxed SIP and AMFI behavior and changes to the sealed system volume. Do not use production secrets, signing keys, Apple ID or sensitive data in this lab.<br>  <\/li>\n\n\n\n<li><br>    Keep the source commit, dependencies, kernel version, collection hash and disk provenance together. Revalidate after kernel or macOS changes.<br>  <\/li>\n\n\n\n<li><br>    Do not distribute Apple installers, trust caches, system disks or Apple-dependent collections. Open-source XNU does not make macOS open source.<br>  <\/li>\n\n\n\n<li><br>    Apple license terms restrict use on non-Apple hardware; verify the exact applicable agreement and obtain authorization for hosted services. PureDarwin has separate open-source obligations.<br>  <\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Benchmark responsibly<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Compare identical workloads and OS builds on the same hardware: cold boot time, app-launch latency, compilation throughput, disk I\/O, CPU use and memory footprint. Repeat at least five times, publish medians and ranges, and include the outer VM overhead. No performance results are asserted here. A different memory page model or GPU path can change performance materially.\n<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><p><strong>Option<\/strong>\n<\/p><\/th><th><p><strong>Design<\/strong>\n<\/p><\/th><th><p><strong>Best fit<\/strong>\n<\/p><\/th><\/tr><\/thead><tbody><tr><td><p>\n  xnulinux\n<\/p><\/td><td><p>\n  Hosted XNU in Linux kernel\n<\/p><\/td><td><p>\n  Research and experimental compatibility.\n<\/p><\/td><\/tr><tr><td><p>\n  Tart \/ Apple VM\n<\/p><\/td><td><p>\n  Separate guest kernel via virtualization\n<\/p><\/td><td><p>\n  Supported architecture for Mac-based CI, subject to license.\n<\/p><\/td><\/tr><tr><td><p>\n  Darling\n<\/p><\/td><td><p>\n  macOS compatibility layer on Linux\n<\/p><\/td><td><p>\n  Selected CLI programs; check per-app compatibility.\n<\/p><\/td><\/tr><tr><td><p>\n  Docker \/ OCI\n<\/p><\/td><td><p>\n  Linux containers share kernel\n<\/p><\/td><td><p>\n  Linux workload delivery, not macOS.\n<\/p><\/td><\/tr><tr><td><p>\n  Native Mac runner\n<\/p><\/td><td><p>\n  Actual macOS on Apple hardware\n<\/p><\/td><td><p>\n  Production Xcode, signing, Safari validation.\n<\/p><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/AFK-surf\/xnulinux\/blob\/main\/docs\/production.md\" rel=\"noopener\">Upstream production-readiness notes<\/a>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.apple.com\/legal\/sla\/\" rel=\"noopener\">Apple software license agreements<\/a>\n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">13. Frequently asked questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Is xnulinux a Linux distribution?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  No. It is a set of kernel modules, XNU patches and tooling for hosting a Darwin system on Linux.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Can I install it on a normal Intel laptop?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  No supported x86-64 route was identified. The reviewed project targets ARM64.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Does it need a Mac?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  The full macOS disk workflow uses a Mac and Apple installer; the PureDarwin path is a separate Linux-oriented experiment.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Is it the same as WSL?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  No. The analogy is useful for coexistence, but WSL2 uses a virtualized Linux kernel, whereas this project hosts XNU within Linux at the inner boundary.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Does Docker run macOS through it?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Not as a normal OCI container. Kernel hosting, disk setup and privilege requirements differ from ordinary containers.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Can I use it on AWS Graviton?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Not established in the reviewed documentation. Hardware and kernel support require validation, and full macOS use raises licensing issues.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Can I run Xcode and iOS Simulator?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Potentially worth investigating; neither is independently validated by this tutorial. Use supported Mac runners for production.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Is it faster than a macOS VM?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  There is no general proof of superiority. Measure your workloads and account for the outer VM, RAM and GPU path.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Can I use it in production?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Not recommended. The upstream project remains experimental and documents security and stability gaps.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Conclusion<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  xnulinux is a fascinating approach to OS interoperability. Begin with PureDarwin, progress to a disposable Apple Silicon lab if permitted, and treat Safari or Xcode automation as a hypothesis to validate rather than an established production capability.\n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">14. Official documentation and further reading<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Primary project sources were reviewed on 2 December 2026. Links point to the live main branch; preserve your actual commit when reproducing the tutorial.\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/AFK-surf\/xnulinux\" rel=\"noopener\">xnulinux README<\/a>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/AFK-surf\/xnulinux\/blob\/main\/docs\/free-kc.md\" rel=\"noopener\">PureDarwin and free kernel collection<\/a>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/AFK-surf\/xnulinux\/blob\/main\/docs\/hosted-service.md\" rel=\"noopener\">Hosted service and isolation model<\/a>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/AFK-surf\/xnulinux\/blob\/main\/docs\/production.md\" rel=\"noopener\">Production readiness<\/a>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/AFK-surf\/xnulinux\/blob\/main\/scripts\/vm-xnu-build.sh\" rel=\"noopener\">Build toolchain<\/a>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/AFK-surf\/xnulinux\/blob\/main\/scripts\/vm-xnu-rebuild.sh\" rel=\"noopener\">Rebuild XNU and extensions<\/a>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/AFK-surf\/xnulinux\/blob\/main\/scripts\/mk-macvm-disk.sh\" rel=\"noopener\">Disk preparation<\/a>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/AFK-surf\/xnulinux\/blob\/main\/scripts\/vm-install-fki-service.sh\" rel=\"noopener\">Memory reservation<\/a>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/AFK-surf\/xnulinux\/blob\/main\/scripts\/xnulinux-boot.sh\" rel=\"noopener\">Boot and stop script<\/a>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/AFK-surf\/xnulinux\/blob\/main\/scripts\/install-service.sh\" rel=\"noopener\">Service management<\/a>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/AFK-surf\/xnulinux\/blob\/main\/tools\/dgx-spark\/README.md\" rel=\"noopener\">DGX Spark configuration<\/a>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.apple.com\/legal\/sla\/\" rel=\"noopener\">Apple software licenses<\/a>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/developer.apple.com\/documentation\/virtualization\" rel=\"noopener\">Apple Virtualization framework<\/a>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/cirruslabs\/tart\" rel=\"noopener\">Tart VM project<\/a>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/wordpress.org\/plugins\/mammoth-docx-converter\/\" rel=\"noopener\">Mammoth WordPress plugin<\/a>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/mwilliamson\/python-mammoth\" rel=\"noopener\">Mammoth converter and custom style maps<\/a>\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Verification disclosure<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  All project commands are source-reviewed or explicitly illustrative; none were executed on ARM64\/macOS in preparing this article. The repository\u2019s demonstrations are not author-run benchmarks. Exact command arguments and dependencies can drift; inspect the checked-out source. No proprietary Apple files or screenshots are embedded.\n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">15. SEO publishing details<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Editorial metadata: copy these values into your WordPress SEO plugin and remove this section from the public article if desired. WordPress featured-image and SEO fields are not populated automatically by Mammoth.\n<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><p><strong>Field<\/strong>\n<\/p><\/th><th><p><strong>Recommended value<\/strong>\n<\/p><\/th><\/tr><\/thead><tbody><tr><td><p>\n  SEO title\n<\/p><\/td><td><p>\n  xnulinux Tutorial: Run macOS on ARM64 Linux\n<\/p><\/td><\/tr><tr><td><p>\n  Meta description\n<\/p><\/td><td><p>\n  Learn xnulinux architecture, ARM64 requirements, XNU builds, PureDarwin and macOS boot, GPU setup, systemd, troubleshooting and security.\n<\/p><\/td><\/tr><tr><td><p>\n  Focus keyword\n<\/p><\/td><td><p>\n  xnulinux tutorial\n<\/p><\/td><\/tr><tr><td><p>\n  Secondary keywords\n<\/p><\/td><td><p>\n  macOS on Linux, XNU kernel, ARM64 Linux, PureDarwin, Foreign Kernel Interface, macOS kernel module, Safari testing, Darwin on Linux\n<\/p><\/td><\/tr><tr><td><p>\n  URL slug\n<\/p><\/td><td><p>\n  xnulinux-tutorial-macos-arm64-linux\n<\/p><\/td><\/tr><tr><td><p>\n  Categories\n<\/p><\/td><td><p>\n  Linux, DevOps, Operating Systems, Virtualization\n<\/p><\/td><\/tr><tr><td><p>\n  Tags\n<\/p><\/td><td><p>\n  xnulinux, XNU, Darwin, ARM64, FKI, PureDarwin, macOS, Ubuntu, kernel modules, systemd\n<\/p><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">WordPress import checklist<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><br>    Upload this single DOCX using Mammoth .docx Converter. Preview before inserting.<br>  <\/li>\n\n\n\n<li><br>    Confirm one H1 (avoid duplicating the theme\u2019s post title), headings, five images, tables, hyperlinks and code blocks.<br>  <\/li>\n\n\n\n<li><br>    Assign the embedded 1200 \u00d7 630 featured illustration through the WordPress featured-image selector.<br>  <\/li>\n\n\n\n<li><br>    Copy SEO metadata into the SEO plugin, check the slug, then remove editorial metadata if not needed.<br>  <\/li>\n\n\n\n<li><br>    Check code whitespace, mobile layout, image ALT text and links on the draft before publishing.<br>  <\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\n  The embedded Mammoth style map maps Code Block to a preformatted code element and headings to semantic HTML. If the installed plugin ignores embedded maps or alters line breaks, configure its style map or use a WordPress Code block and verify the preview. No separate publishing files are required.\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A hands-on guide for Linux engineers, developers, SREs and operating-system researchers. Source review: 2 December 2026. Featured image \u2014 xnulinux technical field guide (1200 \u00d7 630 px)&#8230;. <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[49],"tags":[],"class_list":["post-80517","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/80517","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=80517"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/80517\/revisions"}],"predecessor-version":[{"id":80523,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/80517\/revisions\/80523"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=80517"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=80517"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=80517"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}