A real Linux kernel compiled to WebAssembly boots to a shell in under a second

A real Linux kernel, compiled to WebAssembly

unkernel compiles Linux 7.x straight to WebAssembly with a real MMU, so syscalls, scheduling, memory management, ext4, and TCP/IP all run as native wasm code. Only user programs are emulated: unmodified aarch64 binaries, letting Alpine and Debian packages run as-is. It boots to a shell in about 0.3 seconds, hits near-native syscall and fork speeds, and ships as a zero-dependency TypeScript SDK that runs in browsers and Node.

unkernel keeps the best of each: the real Linux kernel, running at native wasm speed, under unmodified binaries with a real MMU.
  1. jaen

    The slowest part is always emulating the MMU, as that adds a 2-3× overhead to every memory access. In that sense ARM Sv39 is not a great choice.

    Usually emulators use a direct-mapped cache (basically a software TLB).

    In this case though, since you control the kernel, it could use something like the MIPS software-managed TLB of the olden days, with bespoke paging data structures and fast-path page fault handlers, perhaps also using PowerPC Inverted Page Tables as inspiration. (and eg. changing page allocation strategies to constrain pages in the lower address space region to simplify cache look up, and something to prevent cache set conflicts).

    Given that the working set is small tho in this use case, eg. just a kernel-managed direct-mapped `page_number[MAX_PAGES] → base_address` table is sufficient and fast. (with some trick for page faults; also who needs granular RWX access permissions...)

  2. solyin

    Fabrice Bellard beat you to it, with jslinux in 2011.

    http://bellard.org/jslinux

  3. baq

    Slow, but that’s expected. Otherwise ran Postgres unmodified. Not sure if this will be useful for anything serious, but demos of real Linux software have become zero friction today. Amazing.

  4. MattCruikshank

    Yeah, so, you drop V8 (or any other WASM engine) into your code, and you have a pretty tightly sandboxed Linux kernel running inside it?

  5. d33

    Awesome! I'd love to see userspace work in wasm too though. Someone once did a PoC, but scheduling processes was a pain - AFAIK noone knows how to force preemption?

    https://joelseverin.github.io/linux-wasm/

More from this day

2026-11-22