Skip to content

Unkernel boots a real Linux kernel in WebAssembly in your browser

An open-source project compiles the actual Linux kernel, not an emulator, to WebAssembly. A shell boots in well under a second, and unmodified aarch64 Alpine or Debian binaries run as they are.

Unkernel compiles a real Linux kernel to WebAssembly rather than emulating one. The kernel’s syscalls, scheduler, memory management, ext4 filesystem and TCP/IP stack all run as compiled WebAssembly code, with a Zig-written CPU emulator called kwemu handling the aarch64 user-space programs underneath it.

Running it from the command line gets you an Alpine shell prompt about 0.3 seconds after Node starts, inside 48MiB of guest memory. The browser version at unkernel.dev downloads roughly 10MB and boots the same way. The emulator’s JIT kicks in for hot code paths: once warmed up, a shell loop runs 1.6 times as fast and sort runs 2.3 times as fast. Individual syscalls, like a 64-byte read, cost around 170 nanoseconds.

npx unkernel

Why it matters: this isn’t a stripped-down shell simulation, unmodified Alpine and Debian aarch64 packages run on it as they are. Anyone building a browser-based dev environment, a coding playground, or a sandbox for an AI agent now has a way to offer a real Linux filesystem and network stack without a server round-trip for every command.

The caveat: it only runs aarch64 binaries, so x86-64 packages won’t work, and this is a solo open-source project rather than a vendor-backed product, so don’t expect the support guarantees that come with something like Docker or a managed cloud sandbox.

Share

Related reading

More from The Wire

All briefs