# Linux in a browser tab: unkernel compiles the kernel to wasm and emulates only the programs

> Satyajit Ghana — Head of Engineering @ Inkers Technology
> canonical: https://ai.satyajit.si/articles/linux-in-a-browser-tab
> date: 2026-12-01
> tags: webassembly, sandboxing, microvm, webgpu, agentic-coding
> flair: measured, interactive

On 27 November Guillermo Rauch [posted](https://x.com/rauchg/status/2126416223592473046) that [unkernel.dev](https://unkernel.dev) *"runs a full Linux kernal and distro in a browser tab. No tricks. The full thing. It can run coding agents, it can even run Chrome inside Chrome"*. Half a million people watched the clip. A day later [@alvarombt](https://x.com/alvarombt/status/2126733359149625464) summed it up in Spanish: a real Linux kernel compiled to WebAssembly, 3.6 MB, booting in a tab in under a second, running unmodified ARM64 Alpine and Debian binaries.

<Tweet id="2126416223592473046" />

People have run Linux in a browser for over a decade, so "Linux in a tab" alone is not news. What is new is where the line between compiled and emulated code sits. Most earlier projects either emulate the kernel along with everything else, or throw the kernel away and reimplement the syscalls. unkernel compiles the kernel itself to wasm and emulates only user space. Its README credits the idea, a native kernel with emulated user space behind a software MMU, to Kernarium; unkernel is the first I have seen do it with Linux in a browser. That one decision decides how fast a syscall is, whether `fork` is real, how threads work and what a snapshot has to capture.

Within days, two projects built on the idea or argued with it. On 30 November Steve Faulkner [put unkernel in a Cloudflare Durable Object](https://x.com/southpolesteve/status/2127432702827561228) you reach with `ssh`, a machine per SSH key, with the coding agent running outside the VM on the JavaScript host. On 28 November [@_uwu_cocoa](https://x.com/_uwu_cocoa/status/2126768867674628503) answered "that's so lame and so yesterday" with kido, which boots Apple's arm64 XNU kernel in a tab and forks the live machine in about 120 ms, by its own count. kido turns out to make the opposite choice from unkernel, which makes it a useful comparison.

I read [pithings/unkernel](https://github.com/pithings/unkernel) at `ad23026` (30 November), including its contributor notes in `.agents/`, [southpolesteve/computerplease](https://github.com/southpolesteve/computerplease) at `cbf8e86`, and [kido-sh/kido-wasm](https://github.com/kido-sh/kido-wasm) at `db147cc`. I pulled the published npm package `unkernel@0.3.0-261130-3ef745b` and took its `unkernel.wasm` apart with a small section parser. Then I ran unkernel's SDK under Node, and both playgrounds in headless Chromium, on one of my servers: an Intel i7-6850K with 12 threads, Node v24.23.0. None of their code ran on the machine I write on, and every number below is the project's own unless I say I measured it.

<RepoCard repo="pithings/unkernel" note="Read at ad23026 (30 November 2026): README, .agents/kernel.md, kernel/parking.md, kernel/smp.md, include/kw_emu.h. The npm bundle measured here is 0.3.0-261130-3ef745b." />

The quickest way to understand it is to use it. The box below boots the project's own page in a frame when you press the button, and not before. This article is not cross-origin isolated, so unkernel runs on one CPU here, and `?data=0` means nothing is saved. kido's tab restores its warm Darwin snapshot from play.kido.sh; its code has no JSPI dependency. unkernel needs a browser with JSPI, which the box checks before it loads anything.

<LiveLinux />

I checked the frame from a page with no isolation headers, in headless Chromium on my server: unkernel reached its prompt 2.11 s after load on one CPU and ran a typed `uname`, and kido was ready in 2.27 s.

It does not need the project's page either. I served the SDK's browser build, the release's uniprocessor kernel and its Alpine image from a plain static server with no isolation headers, and a page of about twenty lines booted it in headless Chromium on my server: one CPU, the first command back 445 ms after load, 16.6 MB served, and the distro image read with Range requests. Any page can embed it the same way.

<Video
  src="https://ai.satyajit.si/articles/linux-in-a-browser-tab/unkernel-demo"
  poster="https://media.thesatyajit.com/ai/articles/linux-in-a-browser-tab/unkernel-demo-poster.jpg?v=fda1e6c2b8144737"
  alt="A browser window at unkernel.dev. A boot log lists checked browser features, a 3.6 MiB unkernel-smp.wasm download, a compiled kernel, a 1.5 MiB initramfs, 2048 MiB of memory and an attached Debian image, then Booted in 1.30 s on 4 CPUs. A terminal agent called fx answers who are you, uname -a prints Linux unkernel 7.3.4+ SMP aarch64, and the Settings window shows the distro choice and a 4-CPU machine."
  caption="unkernel.dev in Rauch's clip: the boot log, Debian on four CPUs, a coding agent in the guest, uname, and the machine settings. (@rauchg, 27 November; the boot time on screen is the page's own.)"
/>

## Four ways to put Linux in a tab

The unkernel README sorts earlier projects into groups, and the groups are a good map. I checked each against that project's own documentation rather than unkernel's description of it.

**Emulate the whole machine.** [v86](https://github.com/copy/v86) emulates an x86 PC, and its README says machine code *"is translated to WebAssembly modules at runtime in order to achieve decent performance"*. The guest kernel is real Linux, but it runs on the emulated CPU too. A syscall is an emulated trap into an emulated kernel, a page fault walks emulated page tables, and disk I/O goes through an emulated controller. [container2wasm](https://github.com/ktock/container2wasm) is the same idea packaged for containers: Bochs for x86_64, TinyEMU for riscv64, or QEMU's wasm port with its TCG JIT, with Linux and runc inside. Its README notes that the kernel is pre-booted at build time with wizer to cut startup, for its WASI target so far.

**Emulate the CPU, drop the kernel.** WebVM runs on CheerpX, which its README describes as an *"x86-to-WebAssembly JIT compiler"*, a *"virtual block-based file system"* and a *"Linux syscall emulator"*. There is no Linux kernel. That makes it fast, and it covers exactly as much Linux as Leaning Technologies has reimplemented. It is also the one closed engine in the group: WebVM is Apache-2.0, but CheerpX may not be self-hosted without a commercial licence.

**Recompile the programs.** WASIX, WebContainers and the NOMMU Linux ports (linux-wasm, LKL) run code that was rebuilt for wasm. That is fast, but no unmodified binary runs, and without an MMU `fork` cannot copy an address space, so it becomes `vfork` or an approximation.

**unkernel's choice.** Compile the real kernel to wasm, as the NOMMU ports do, but give it a real MMU and run unmodified aarch64 programs on a software CPU. The kernel's code runs at wasm speed and keeps Linux's behaviour in the corners. The only emulated thing is the program, and the program spends much of its time asking the kernel for something.

<SyscallPath />

| | Kernel | User space | MMU | A syscall is |
|---|---|---|---|---|
| v86, JSLinux, container2wasm | Linux, emulated | unmodified, emulated | emulated | an emulated trap into an emulated kernel |
| WebVM (CheerpX) | none | unmodified x86, JIT to wasm | the runtime's | a call into a syscall emulator |
| WASIX, WebContainers, linux-wasm | a runtime, or NOMMU Linux | rebuilt for wasm | none | a wasm import call |
| unkernel | Linux 7.3.4, compiled to wasm | unmodified aarch64, interpreted and JIT-compiled | real Sv48 page tables | a return from `kw_run()` into compiled kernel code |
| kido | XNU, emulated | unmodified arm64 Mach-O, emulated | emulated Stage-1 | an emulated exception to `VBAR_EL1` |

## A syscall is a function return

<Figure
  src="https://media.thesatyajit.com/ai/articles/linux-in-a-browser-tab/unkernel-architecture.png?v=f959b73a3921507e"
  alt="Three stacked boxes. Top: Linux programs, unmodified aarch64 binaries, which run on kwemu. Middle, inside unkernel.wasm: kwemu, the user-mode CPU, an aarch64 CPU written in Zig, and Linux 7.x, the kernel, as native wasm, with syscalls going from kwemu to the kernel and a return arrow back; the kernel box lists MMU, cgroups, namespaces, userfaultfd, ext4, overlayfs, tmpfs, FUSE, 9p, loop, fanotify, TCP/IP, TUN, vsock, ALSA, evdev and fbdev. Bottom: the JavaScript SDK with console, terminals, exec, host files, disks, network, fetch, screen, input, sound, vsock, shm, snapshots and worker, joined to the kernel by paravirtual devices."
  caption="unkernel's own diagram. The user-mode CPU box still says 'an interpreter (JIT to come)'; the README and the code now have the JIT. (unkernel repository, assets/architecture.svg, rendered on white.)"
/>

The kernel is Linux 7.3.4 plus a patch series, with an `arch/wasm` that grew from Joel Severin's linux-wasm port. It is built with clang to a single module. The user-mode CPU is kwemu, written in Zig and linked into the same module. Its contract with the kernel is one C header, `include/kw_emu.h`, at ABI version 4.

When a program executes `SVC #0`, kwemu does not emulate an exception level, a vector table or an `ERET`. `kw_run()` simply returns to its caller in the kernel with an event code, and the kernel's arm64 syscall path runs: the number in `x8`, arguments in `x0` to `x5`, through the real syscall table, as compiled wasm. When it is done, the kernel's `user_mode_loop()` calls `kw_run()` again. A page fault comes back the same way, as `KW_EV_FAULT`. The README says it plainly: *"There is no emulated trap and no emulated kernel mode in between."*

That is why the README's syscall numbers sit next to native rather than next to QEMU. They measured `getppid` at 172 ns against 110 native and 1,662 under qemu-system, and fork, exit and wait at 57 µs against 73 native. Those were taken on 14 November with the riscv64 user space the project started with; the kernel path is the same for arm64, but they are the project's numbers, not mine.

<Figure
  src="https://media.thesatyajit.com/ai/articles/linux-in-a-browser-tab/unkernel-performance.png?v=5530383ceae3479e"
  alt="Four panels of horizontal bars, time per operation, lower is faster, measured under Node. getppid: native 110 ns, qemu-user 320 ns, qemu-system 1,662 ns, unkernel 172 ns. read 64 B from /dev/zero: 161, 481, 2,247 and 172 ns. pipe write plus read: 417, 1,032, 7,256 and 482 ns. fork plus exit plus wait: 73, 537, 1,178 and 57 µs."
  caption="The README's kernel-path benchmarks, measured under Node on 2026-11-14 with the earlier riscv64 user space. Pure computation is the other story: the README puts the interpreter at 250 to 300 million guest instructions a second, well behind native. (unkernel repository, assets/performance.svg.)"
/>

The flip side is that everything that is not the kernel is slow. Programs run on kwemu's decoded-op interpreter, and hot blocks go to a second tier that compiles them to small wasm modules at run time (`kw_host_jit_compile`). The README's own Alpine numbers with the JIT are a shell loop in 2.5 s against 4.0 s without it, and `seq 100000 | sort -r` in 3.1 s against 7.1 s. The README is candid about the rest: `apk search` over the main index takes about 0.8 s and `apk add python3` about 3.4 s. CPU-heavy work in the guest, a compiler above all, pays the interpreter's price.

### What the host sees

If the kernel is in the module, what is left for the JavaScript host to do? I listed the imports of the published `unkernel.wasm` in the npm package, which is the uniprocessor kernel (the SMP build adds a few, such as `wasm_cpu_start`). There are 84. Thirteen are WASI preview 1: the clock, random bytes, console reads and writes, `poll_oneoff` for idle, and the file calls that load the initramfs. One is the memory. The other seventy are unkernel's own, and sixty-four of those are device drivers: block, network, framebuffer, input, sound, camera, vsock, shared memory, virtio-gpu, serial, Bluetooth and USB, each a handful of calls. The remaining six are the task switch, the snapshot point, a stack dump and the JIT's three hooks. Nothing is named after a syscall. `openat`, `mmap` and `clone` are handled entirely inside the module, and only device I/O ever leaves it.

<BundleAnatomy />

The size in the Spanish post is real but needs a footnote. The npm bundle's `unkernel.wasm` is 12,692,003 bytes, 12.1 MiB. About 8.2 MiB of it is the kernel's code and data. The rest is custom sections: the 1.53 MiB base initramfs, a 2.04 MiB patch that turns the uniprocessor kernel into the SMP one when you ask for more CPUs, and function names. Brotli at level 11 takes that file to 3,867,222 bytes, 3.69 MiB. The page loads a different file, the SMP build: in the current release `unkernel-smp.wasm` is 11,772,862 bytes, 4,162,671 gzipped, and the page's boot log from an earlier build reports *"Downloaded unkernel-smp.wasm, 3.6 MiB"*. So the 3.6 MB in the post is a compressed transfer of the page's kernel, the same order as my brotli number, and not the size of the module. The README's own figure for a first visit to the page is about 10 MB, because the Alpine image comes on top. In headless Chromium on my server, unkernel.dev had fetched 9,222,573 bytes in 23 requests when the prompt appeared, 3.64 s after navigation.

<Figure
  src="https://media.thesatyajit.com/ai/articles/linux-in-a-browser-tab/unkernel-boot-log.jpg?v=efd5b49b149ca44e"
  alt="The unkernel.dev desktop over a mountain photograph. A terminal window titled con shows unkernel, Linux on WebAssembly, and a boot log: Checked browser features (6 ms), Downloaded unkernel-smp.wasm, 3.6 MiB (0 ms), Compiled the kernel (0 ms), Found the base initramfs (1.5 MiB), and Starting the kernel worker in progress. The top bar says Allocating memory."
  caption="The page's boot log on 28 November: the kernel download is reported as 3.6 MiB, a compressed transfer. (@alvarombt, 28 November.)"
/>

## Memory: a real MMU, done by the emulator

The kernel runs only in its direct map. Virtual equals physical equals an offset into the wasm memory, and `phys_base` is 0. Guest RAM sits below 4 GiB. `vmalloc` is patched to hand out direct-mapped memory too, so there are no kernel page tables to walk at all.

User space is where the MMU matters, and here unkernel does something unusual. The user page tables use the RISC-V Sv48 format whatever the guest ISA is: four levels, nine bits each, a 12-bit page offset. This is a leftover of the riscv64 start, and it does not matter to the program, which never sees its page tables. kwemu walks them exactly like hardware does, keeps a software TLB, and never writes a page-table entry itself. If the accessed bit is clear, or the dirty bit is clear on a store, kwemu returns `KW_EV_FAULT` and lets the kernel set the bit (a fast path that does what a RISC-V core with Svadu does) or run `handle_mm_fault()`. So copy-on-write after `fork`, `mmap` of a file, `userfaultfd`, shared memory and swapless reclaim are all Linux's own code. The address space is arm64's 48 bits: anything at or above `1 << 48` faults, and since kwemu has no top-byte-ignore, tagged pointers fault too.

The kernel's own accesses to user memory (`copy_to_user` and friends) walk those tables in software as well, and retry while another thread races them. The notes record a page being taken away under them up to 17 times in a row under host load on 17 November. That is the kind of corner a syscall emulator never has to think about, and a reimplementation usually gets wrong.

<PageWalk />

## Threads: JSPI stacks that cannot move

A kernel has to switch tasks in the middle of a function. Plain wasm cannot do that: there is one call stack and no way to set it aside. unkernel uses JSPI (`WebAssembly.Suspending` and `WebAssembly.promising`). Every kernel task runs on its own wasm stack. `__switch_to` calls the suspending import `wasm_switch_to`, which parks the current stack on a promise and resumes the next one, or starts a fresh stack for a new task through the promising export `ret_from_fork`. This is why the browser list in the README is "anything with JSPI": Chrome and Edge 137 and up, Firefox 153, Safari 27.

The uniprocessor kernel has one CPU and no preemption. It gets control back three ways. A time slice is 200,000 user instructions, and each syscall or fault costs 1,000 of them, so a loop of cheap syscalls still gets preempted (apt busy-polling `pselect()` on dpkg's pipe was the bug that forced this). While user code is busy, the kernel yields to the host every 20 ms. And idle goes through `poll_oneoff`. Time is odd in one respect: the arm64 counter register counts retired instructions, not wall time, so there is no vDSO and `clock_gettime` is a real syscall.

The SMP kernel is a second build of the same tree: one module instance per CPU, each in its own Web Worker or Node thread, all on one shared memory, with wasm atomics for the kernel's locks. JSPI limits it again. A suspended stack belongs to the thread that created it, so a task can move to another CPU only at the points where its stack can be thrown away: a user task on its way back to user mode, a kernel thread at a restart point. Device imports are answered on CPU 0 only. The README's guidance is that four CPUs get about 3x on parallel work and eight or sixteen add little.

## What it costs on my server

Boot is as fast as the README says. Under Node, `createKernel()` with Alpine resolved in about 40 ms, and the first `exec("true")` came back after a median of 183 ms over five boots with the JIT, 168 ms over three without it. Squeezing the guest to computerplease's 64 MiB changed nothing: 170 ms. The CLI's scripted run (boot, wait one second, type `poweroff`, exit) took 1.65 to 1.69 s from process start to exit.

Then I ran the SDK's own profile workloads, the same shell lines the project uses, three times each, on one guest CPU.

<MeasuredRuns />

Anything that is mostly the kernel is cheap: 60 spawns of `/bin/true` took 102 ms with the JIT and 100 ms without, and `find` over the image took 21 ms either way, because process creation and directory walks are compiled kernel code. Anything that is mostly user instructions is slow: sorting 100,000 numbers took 6,884 ms against 29 ms in the server's own shell. And the JIT is worth a lot more on real work than the README's loop suggests: `sha256sum` over 16 MiB went from 3,471 ms to 467 ms, the sort from 24,977 ms to 6,884 ms (3.6 times, by my arithmetic), gzip from 5,416 ms to 2,737 ms. In that run the JIT compiled 1,318 blocks into 9,228,277 bytes of wasm and spent 522.7 ms doing it. My sort is not the README's (`sort -rn` piped into `md5sum` here, `sort -r` there, on a 2016 desktop chip), so the absolute numbers differ from theirs; the shape is the same.

SMP did what the README promises. Eight parallel `seq 20000 | sort -rn | md5sum` jobs took 12,913 ms on one CPU and 4,016 ms on four, in worker mode, about 3.2x by my arithmetic. Booting the four-CPU machine took 813 ms against 365 ms for one.

In the browser the numbers hold up. In headless Chromium, unkernel.dev was cross-origin isolated, booted four CPUs with 2,048 MiB, and ran the 40,000-iteration shell loop in 2.78 to 3.69 s by `time`, in line with the 3,518 ms I got under Node.

## Snapshots: park everything first

Here the design pays a price that the emulators do not. A task suspended in JSPI has its continuation inside the engine, and the engine cannot serialise it. So before unkernel can save a machine, every task has to reach a point where its whole state is in guest memory. The kernel parks them: user tasks at the top of `user_mode_loop()`, where they are just `pt_regs` and a `task_struct`; every kernel thread at a `kw_park_point()` in its loop, where it holds no locks. Then, at a consistent point in the idle loop, the kernel marks its free pages in a bitmap and calls `wasm_snapshot_point()`, and the host copies the memory during that one call, skipping free pages. A restore instantiates the same build, copies the memory back, and enters through `kw_resume` instead of `_start`, so every task starts again on a fresh stack.

A kernel thread without a park point makes every snapshot fail with `EBUSY` and its name, so every new driver thread needs one. And a restore steps the wall clock and reseeds the RNG through `add_vmfork_randomness()`, so two machines restored from one snapshot do not hand out the same random numbers. Without that, forking a machine with SSH host keys or TLS sessions would be a quiet security bug.

The notes give the sizes. The idle base shell in a 2 GiB guest saved to 46 MiB on 30 November. A Debian guest that had read every file under `/usr` and written 300 MiB saved to 593.0 MiB as is, and to 65.1 MiB when the snapshot first syncs and drops the clean page cache, which took 33 ms. The restored machine then reads back what it needs: its first commands took 0.32 s instead of 0.25 s.

I checked the mechanism end to end under Node. With a 256 MiB Alpine guest I wrote a marker file to `/tmp`, took `snapshot({ stop: true })`, and restored it twice in a row. The snapshot took 18 ms and encoded to 22,087,752 bytes, 4,276,636 gzipped. Each restore had a working shell in under 60 ms (59 and 56 ms to the first command), the marker was there both times, and the two restores read different values from `/proc/sys/kernel/random/uuid`. That last check shows the copies diverge; I did not separate the reseed from anything else that might cause it.

kido needs none of this. Its guest kernel runs on an emulated CPU whose entire state is Rust structs in linear memory, so the host can stop scheduling instructions and write everything out. That is the general rule: a full-system emulator snapshots for free, and a kernel compiled to the host's instruction set has to cooperate.

<SnapshotFork />

## Eighteen days later, in a Durable Object

The unkernel repository was created on 12 November, and its npm package the same day. On 30 November Steve Faulkner shipped computerplease:

<Tweet id="2127432702827561228" />

<Video
  src="https://ai.satyajit.si/articles/linux-in-a-browser-tab/computerplease-demo"
  poster="https://media.thesatyajit.com/ai/articles/linux-in-a-browser-tab/computerplease-demo-poster.jpg?v=96e5922c70909d50"
  alt="A title card reads a full Linux VM in a Durable Object, ssh ssh.computerplease.dev. A terminal runs uname -srm, which prints Linux 7.3.4+ aarch64. Then agent create hello.py that prints the date and run it: the agent checks for python3, writes /home/user/hello.py (106 bytes), runs it, and reports the printed date, credited to deepseek-v4.1-flash. cat hello.py shows the script."
  caption="computerplease from the post: ssh in, uname, and the agent command writing and running a script; the model call happens outside the VM. (@southpolesteve, 30 November.)"
/>

<RepoCard repo="southpolesteve/computerplease" note="Read at cbf8e86 (30 November 2026). Path: gateway/main.go and src/gateway.ts (SSH), src/tenant.ts (the VM Durable Object), src/data-disk.ts (SQLite block device), src/host/bridge.ts and src/host/agent.ts (host commands), src/network.ts (egress)." />

The README draws the path as Spectrum TCP on port 22, a Worker running an SSH server written in Go and compiled to wasm, a Durable Object running unkernel with Alpine, and SQLite for the disk. Reading the code fills in the parts that make it work.

**Identity is the routing key.** The Worker authenticates the SSH key and sends the session to `VM.idFromName(fingerprint)`. The same key always reaches the same object, and so the same disk; a different key gets a different machine. There is no account system.

**The disk is a table.** `DataDisk` implements unkernel's `BlockDevice` on the object's SQLite: one row per 4,096-byte page in `disk_pages`, all-zero pages deleted rather than stored, each kwblk request one transaction. Its `flush()` deliberately does not wait for `storage.sync()`. The comment explains why that is safe: a Durable Object's output gate already holds every outgoing message, SSH bytes included, until the writes before it are durable, so a crash can only lose writes nobody was told about, which is a valid ext4 crash state. The same comment says waiting on every flush had cost about 90 storage round trips on a new tenant's first boot.

**The guest is small, and the JIT is off.** `createKernel` is called with `memoryMiB: 64` and `jit: false`. The README gives the limits: 64 MiB of RAM, a 128 MiB disk, two sessions per machine, 15 minutes idle and an hour's lifetime. The repository does not say why the JIT is off, but Cloudflare's runtime documentation does list `WebAssembly.compile` and `WebAssembly.instantiate` with a buffer among the things a Worker may not call. kwemu's second tier works by compiling fresh wasm modules at run time, so my reading is that it cannot work in a Worker at all, and every guest instruction there goes through the interpreter. My runs above show what that costs: the same sort takes 24,977 ms instead of 6,884 ms, and hashing 16 MiB takes 3,471 ms instead of 467 ms.

**One kernel per isolate.** unkernel supports one running kernel per thread, and Cloudflare can place several Durable Objects in one isolate. `tenant.ts` keeps a module-level `kernelInUse` flag and a queue of at most four waiters that give up after 8 seconds. A second tenant landing in a busy isolate gets "the demo is running another machine". That is the real density limit of the design today: one live Linux per isolate, not per object.

**The agent lives on the host.** `agent` in the guest is an unkernel host command: a stub at `/run/kw/bin/agent` that forwards argv, working directory, uid and stdio over vsock to a JavaScript handler. The handler cannot start Worker I/O from inside the kernel's call path, so it queues a job and has the live terminal session start a self-RPC, `VM.runHostJob()`, that owns the command. Pi Durable runs there and calls Workers AI through the binding. Its tool calls come back into the guest as ordinary processes. Steve's post puts it as *"the secrets and the model never enter the VM"*. A coding agent would not fit in 64 MiB anyway.

**Egress has one hole to plug.** A Worker's `connect()` cannot open sockets to Cloudflare's own IP ranges. For those destinations only, the Worker terminates TLS 1.3 itself with a demo CA that it installs into the guest, and re-issues the request with `fetch()`. Everything else is a plain socket and the guest does its own TLS. If you deploy your own copy, the README tells you to make your own CA, which you should.

<DurableObjectPath />

This is the use I find more interesting than the browser tab. [Cloudflare's own Computer workspace](/articles/openshell) keeps state in a Durable Object and runs real binaries in a container that mounts it over FUSE. computerplease removes the container: the Linux machine is a computation inside the object, its disk is the object's SQLite, and the agent and its credentials sit on the other side of an interface that is just a list of commands. Compared with [a micro-VM sandbox like NVX](/articles/nvx), the isolation boundary is the wasm module and the V8 isolate, not a hypervisor, and the CPU is an interpreter at a few hundred million instructions a second. For an agent that mostly runs `git`, `python` and `curl`, that is plausible. For one that compiles Rust, it is not.

## kido does it the other way

<Tweet id="2126768867674628503" />

kido is a native macOS micro-VM tool, and [kido-wasm](https://github.com/kido-sh/kido-wasm) is its browser engine, Apache-2.0 and written in Rust. Its README describes a *"Clean-room, Apache-2.0 full-system ARMv8-A (AArch64) emulator and WebAssembly VMM"*, and the code matches: an A64 decoder and interpreter, a Stage-1 MMU with 4, 16 and 64 KiB granules and a software TLB, exception delivery at EL0 and EL1, GICv2 and GICv3, the generic timer, PSCI, a PL011 UART and a PCIe bus with virtio devices. The kernel is Apple's open-source XNU from the macOS 26.5 release, built with Nix in kido's KidoDarwin image, running at EL1 on that emulated CPU. A syscall in kido is an emulated `SVC` that jumps to the guest's exception vector at `VBAR_EL1`, exactly what v86 does for x86.

<RepoCard repo="kido-sh/kido-wasm" note="Read at db147cc (29 November 2026): crates/arm64-core (CPU, MMU, exceptions), crates/snapshot (KWSN), crates/virtio-metal, web/src/vm-worker.js (snapshot and fork)." />

So on the axis this article is about, kido is in the v86 group, not unkernel's. I found no JIT anywhere in the workspace, and the page's own throughput counter is labelled *"Active AArch64 interpreter throughput"*. What kido gets in return is what full-system emulators always get: the machine's state is the emulator's state, so snapshot and fork are close to free. A fork takes a raw snapshot of VM 1, starts a second Web Worker with a fresh module instance, and restores it there with the same read-only disk chunks and a copy of the dirty blocks. The post puts that at about 120 ms.

On my server, in headless Chromium with no GPU, kido was ready 3.59 s after navigation: a 31,709,216-byte warm snapshot of a 512 MiB machine, downloaded in 821 ms and restored in 1,373 ms. Darwin reported one CPU. The page's counter read 27.3 to 28.7 MIPS. The same 40,000-iteration loop that takes unkernel about 3.5 s took zsh 53.3 s in kido, by zsh's own `time`; about fifteen times longer by my arithmetic, but the shells differ, so read it as an order of magnitude. Fork worked, and the page reported *"Forked in 997 ms"*: a raw 109,220,654-byte snapshot, restored in the second worker in 481 ms. That is eight times the post's figure, on an old desktop chip with software rendering, so I would not call the 120 ms wrong, but I could not reproduce it.

<Figure
  src="https://media.thesatyajit.com/ai/articles/linux-in-a-browser-tab/kido-play.png?v=30169096489a5b57"
  alt="kido's social card: Real arm64 Darwin in your browser, unmodified XNU kernel and Apple Metal with live snapshots and instant fork. Two terminal panes: VM 1 with a Snapshot 95 ms badge runs metal-demo, which reports MTLDevice WebGPU, matmul 64x64 PASS and a Mandelbrot rendered on the GPU in 5.2 ms; VM 2, a fork marked 124 ms and 512 MiB, runs kl update and kl add libffi. Badges read about 120 ms fork, WebGPU Metal, Apache-2.0."
  caption="kido's own card for the playground, with its own timings. (kido-wasm repository, web/public/og-image.png.)"
/>

The other trick is the GPU. kido registers a virtio PCI device (`0x1af4:0x1090`) that XNU sees as a Metal compute device. When a guest program loads a real Apple `.metallib`, the host compiles its AIR bitcode to WGSL with kido's separate `air2` compiler and runs it on the page's WebGPU. unkernel does the same kind of thing for Linux at the API level instead: the guest's Mesa renders through virglrenderer on WebGL2, and its Vulkan goes to WebGPU through a SPIR-V-to-WGSL translator.

## And Android, by someone who has done it before

<Tweet id="2127235958743703555" />

weishu, whose profile lists KernelSU, Twoyi and VirtualXposed ([Twoyi](https://github.com/twoyi/twoyi) is *"a lightweight Android container on Android"*), says Twoyi now runs Android in a tab and boots in a second, after Apple pulled the iOS build from TestFlight. The post has a clip and no link, and I could not find code, so I cannot tell you which of the groups above it belongs to. A one-second boot of something Android-sized suggests a snapshot restore rather than a cold boot, but that is my guess, not something the post says.

## Where the line should sit

Moving the line between compiled and emulated code changes more than speed. unkernel's placement makes syscalls, page faults and `fork` cost roughly what they cost natively, gives every corner of Linux's behaviour for free, and fits a real kernel in a download of a few MiB. It pays in two places. Programs run on an interpreter with a JIT bolted on, which is fine for a shell and an agent's tools and bad for a compiler. And because the kernel's tasks live on JSPI stacks, snapshots need a cooperative parking protocol that every kernel thread has to honour, and threads can only migrate at safe points.

kido's placement pays the other way: every instruction of the kernel is interpreted, and in exchange the machine can be frozen, copied and forked without the kernel's help. If what you want is many disposable copies of one warm machine, that is the better trade. If what you want is a Linux that behaves like Linux and boots in a tab or a Durable Object, unkernel's is.

My position: unkernel is the first browser Linux I would put an agent in, and computerplease shows the shape that makes sense. Keep the guest small and disposable, keep the model and the keys on the host, and give the guest a list of host commands instead of credentials. I would not trust the wasm sandbox as the only boundary for hostile code without the V8 isolate around it, and I would not expect CPU-bound work in the guest to be anything but slow until the JIT can run where the guest runs.

<Callout type="note">
**How I checked.** I read the three repositories at the commits above, including unkernel's `.agents/` notes, and quoted the posts through the fxtwitter mirror. I parsed the sections and imports of `unkernel.wasm` from the npm package `unkernel@0.3.0-261130-3ef745b` and compressed it with `gzip -9`, `zstd -19` and `brotli -q 11`. On one of my servers (i7-6850K, Node v24.23.0) I booted that package under Node, ran its profile workloads with and without the JIT, the same shell lines on the host, a snapshot with two restores and a one-versus-four CPU run, and loaded unkernel.dev and play.kido.sh in headless Chromium. I checked v86, container2wasm and WebVM against their own READMEs, and Cloudflare's restriction on `WebAssembly.compile` against its runtime documentation. The benchmarks in the figures are the projects' own; the ones in the text and the bar chart are mine.
</Callout>
