DEV Community

Cover image for The WASM Linux Kernel Boots in 70ms. My Shell Took a Second.
AheadKit
AheadKit

Posted on

The WASM Linux Kernel Boots in 70ms. My Shell Took a Second.

The headline says 70 milliseconds. My shell took a second. Both numbers are true, and the gap between them is the whole story of what this project actually is.

Unkernel is a real Linux kernel, 7.3.4, built as a single WebAssembly module, and it runs in Node with no install beyond the npm package. The claim on the tin: the kernel reaches /init about 70 ms after it starts, and the Alpine prompt appears 0.3 s after node launches. I ran it twice on this box to see which of those numbers survives contact with a real machine. One of them does. The other one needs a footnote the size of the headline.

The first thing to get straight is what the clock starts on. The kernel prints its own timestamps, and those start when the kernel starts, not when you type the command. In my runs the kernel's first line appeared 0.35 and 0.57 seconds after launch, and /init followed at 0.083 and 0.088 seconds of kernel time. So the 70 ms claim is real, measured on the kernel's own clock, and mine came out a little slower, 83 to 88 milliseconds, on a small two-core box. That is the number for the kernel. It is not the number for you.

What you actually wait for is the prompt. The base shell printed its banner at 0.71 seconds in the first run and 0.92 in the second, and the first command I typed after that ran fine. The gap between the kernel's 88 milliseconds and my 0.92 seconds is the WebAssembly module loading and the runtime warming up, and it varies run to run by two tenths of a second, which is more than twice the number in the headline. If you are embedding this in a page, the user waits for the prompt, not for /init, and the prompt is a sub-second wait, not a 70-millisecond one. Sub-second is still startling for a Linux machine appearing out of nowhere. It is just not 70 milliseconds of waiting.

Run 1 Run 2 Claimed
Kernel's first line (wall) 0.35 s 0.57 s —
Kernel reaches /init (kernel time) 0.083 s 0.088 s ~0.070 s
Shell prompt (wall) 0.71 s 0.92 s 0.3 s (Alpine)
200-iteration shell loop 0.08 s 0.04 s —

One honest limit, and it matters: I did not boot Alpine. The first run tried to download the Alpine image from the project's GitHub release and the download failed, so both runs used the base shell with no distro image. The 0.3-second Alpine prompt claim is untested by me, and the prompt times above are for the lighter base shell, not the full distro. If Alpine adds its own startup on top, the real wait is longer than mine, not shorter.

What did run, and run properly, is the kernel itself. uname -a answers Linux unkernel 7.3.4+ ... aarch64 Linux, the version string names a clang 22.1.8 build from November 22, and the shell loop finished in under a tenth of a second. This is not a toy kernel or a reimplementation. It is Linux, compiled to WebAssembly, with a real memory manager and its own TCP stack, and the user programs run through a small ARM CPU written in Zig that sits inside the same module. The part that sounds impossible is the part that works.

So the headline is true in the only sense a kernel developer would mean it, and misleading in the only sense a user would read it. Quote 70 milliseconds for the kernel. Quote a second for the shell. And if you are deciding whether to embed a Linux machine in a web page, the second number is the one your users will feel, which makes it the one worth printing.


P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam

Buy me a coffee

AheadKit on Gumroad — Beginner-Friendly Books & Packs

Top comments (0)