Omarchy Architecture Guide

How Omarchy runs natively in a browser tab.

No remote desktop stream, no VNC server, and no cloud VM. Every packet of systemd, Hyprland, Quickshell, and Arch Linux ARM runs locally inside your browser tab on a WebAssembly Linux 7 kernel and WebGL2 virtio-gpu.

Browser Tab (Static Astro + Tailwind site from a Cloudflare Worker + R2)
  ├─ Service Worker (sw.js)
  │    ├─ Stitches pipelined Range reads across ≤45 MiB zstd EROFS chunks
  │    └─ Keeps streamed 4 MiB blocks + Wasm in Cache Storage for repeat boots
  ├─ unkernel.wasm (Linux 7.3.4 compiled to WebAssembly)
  │    ├─ Real Linux MMU, ext4, EROFS (zstd), overlayfs, cgroups, systemd
  │    └─ kwemu aarch64 JIT running unmodified Arch Linux ARM binaries
  ├─ GPU Worker (gpu-worker.js + virgl.wasm → WebGL2)
  │    └─ Off-thread virtio-gpu 3D scanout over direct MessageChannel → zero-copy ImageBitmap
  └─ Arch Linux ARM + Omarchy 4.5
       ├─ systemd 262 + udev + VT-less seatd (SEATD_VTBOUND=0)
       ├─ Hyprland 0.56 (Lua config, GLES 3.0, software cursor, AQ_NO_MODIFIERS=1)
       └─ Quickshell + Tokyo Night + Foot + Neovim + Starship + Btop

Step 1 Booting a real Linux 7 kernel in WebAssembly

Rather than emulating an x86 PC or faking POSIX syscalls in JavaScript, this runs unkernel: Linux 7.3.4 compiled straight to WebAssembly (unkernel.wasm) with a real software MMU and a multi-CPU SMP patch. Syscalls, page faults, overlayfs, cgroups, and EROFS run at WebAssembly speed, while unmodified aarch64 Linux binaries run on kwemu (an interpreter + WebAssembly JIT across up to 16 Web Workers).

Step 2 Preparing an Arch Linux ARM base image for unkernel

Unkernel's bundled initramfs looks for a read-only root image labelled kwroot containing /usr/lib/kw-distro, then mounts an overlayfs whose writable upper layer lives on a persistent disk labelled kwdata. Stock Arch Linux ARM doesn't include those markers or unkernel's kwtty vsock daemon, so gpu/build.sh builds arch.ext4 rootlessly under fakeroot with three additions:

  • /usr/lib/kw-distro (omarchy) and /usr/lib/kw-image so overlayfs persists changes to kwdata instead of falling back to RAM tmpfs.
  • kwtty.service running /usr/bin/kwbox tty serve over AF_VSOCK port 1022, enabling host 9p mounts (/mnt/stage) and live vm.exec() diagnostics.
  • An hvc0 serial autologin drop-in so the browser's slide-up Console drawer drops straight into a diagnostic shell.

Step 3 Installing Omarchy 4.5 inside the guest under Node

gpu/install.mjs boots arch.ext4 + an 8 GiB sparse omarchy.img (kwdata) under Node with direct host networking and runs gpu/guest/setup.sh cleanly over vm.spawn():

  • Removes the unused bare-metal linux-aarch64 kernel and 1.3 GiB of linux-firmware-* packages before updating.
  • Adds DisableSandbox to /etc/pacman.conf (pacman 7's Landlock sandbox isn't present in the Wasm kernel) and points /etc/pacman.d/mirrorlist at Omarchy's matched aarch64 stable snapshot (arm-stable-mirror.omarchy.org) alongside pkgs.omarchy.org/stable/aarch64 so Hyprland and Aquamarine sonames match exactly.
  • Installs extra/mesa explicitly first so opengl-driver gets Mesa's virgl driver instead of Apple Silicon's mesa-aurora.
  • Installs real omarchy, omarchy-settings, hyprland, quickshell, seatd, foot, neovim, btop, fastfetch, lazygit, starship, and core utilities, keeping all Omarchy themes (with intro videos removed and one background image per theme).

Step 4 Making Hyprland & Quickshell run without VTs or bare-metal DRM

Getting a real Wayland compositor to render smoothly inside a browser's WebGL2 canvas required solving five subtle Linux graphics & performance details:

  • VT-less seat management: unkernel.wasm has no CONFIG_VT (/dev/tty0 does not exist). Running seatd -g video with SEATD_VTBOUND=0 creates a clean non-VT seat0 so Aquamarine acquires /dev/dri/card0 and /dev/input/event*.
  • Lean systemd user session & direct launchers: Enabling linger and starting user@UID.service provides D-Bus and PipeWire, while fast shims bypass Python uwsm-app and desktop scans so Foot launches cleanly.
  • Software cursors & modifier-less DRM: Unkernel's virtio-gpu acknowledges hardware cursor queues as no-ops, so Hyprland runs via start-hyprland with cursor.no_hardware_cursors = 1, xwayland.enabled = false, and AQ_NO_MODIFIERS=1.
  • Zero-cost animations & lazy Quickshell rendering: Omarchy's no-animations.lua and window-opaque.lua toggles are applied unconditionally, Quickshell renders crisp Wayland SHM layers via QT_QUICK_BACKEND=software straight into Hyprland's WebGL2 virgl compositor, and heavy menus/panels load lazily on demand.
  • Volatile journal & log permissions: journald runs in volatile RAM mode to avoid IndexedDB write churn, and desktop logs write to /var/log/omarchy-desktop.log rather than sticky /tmp.

Step 5 Shipping a multi-gigabyte desktop from Cloudflare R2

One Cloudflare Worker serves the site and the disk image from an R2 bucket. It sends the COOP and COEP headers that SharedArrayBuffer needs, so the tab is cross-origin isolated on the first load and every vCPU gets its own Web Worker:

  • Boot-ordered compressed EROFS image: gpu/pack-pages.mjs trims unused bare-metal bloat (down to ~1.1 GiB), builds a two-pass zstd-compressed EROFS image (mkfs.erofs --incremental=data -zzstd,9 -L kwroot) placing the boot hot-set and metadata contiguously at the front, and stamps an unkernel KWDISTRO header so the browser prefetches it sequentially while the kernel boots.
  • 45 MiB immutable chunks, pipelined Range stitching & local caching: The EROFS file is split into <45 MiB chunks under distros/chunks/<digest>/. The folder name is the image hash, so a chunk URL never changes content and caches forever. The Worker answers each Range request straight from R2. The Service Worker (sw.js) intercepts Range requests for distros/omarchy.erofs, pipelines multi-chunk reads, and persists streamed 4 MiB blocks and Wasm binaries in versioned Cache Storage for zero-chunk repeat boots.
  • Atomic releases: Each release of the app uploads to its own R2 prefix. The Worker switches to it in one deploy, so a visitor never gets a new page with an old disk manifest.
  • Persistent browser storage: User changes made inside the running Omarchy desktop are written to unkernel's built-in kwdata overlay stored locally in your browser's IndexedDB.

Ready to try it locally in your browser?

Open Omarchy Launcher