AI Focus

headless browser linux & webmcp custom ui

Why this matters

Compiling a real Linux 7.x kernel to WebAssembly via Unkernel and WebAssembly JSPI lets a static web page execute standard POSIX binaries locally—yet most demos stop at an xterm.js terminal window. Terminals force both people and language models to parse unstructured text, ANSI sequences, and fragile column spacing. This lab tests running Linux 7.x headlessly inside a Dedicated Worker behind purpose-built web cards and typed WebMCP tools.

What this opens up

Static browser apps that run real Linux utilities (awk, grep, loopback HTTP servers, and kernel memory checkpoints) over an in-memory 9p workspace (/work) with zero server compute, zero external guest network sockets, and deterministic JSON tool surfaces for browser agents.

How the tests work

  1. Wait for auto-boot (or click Boot / Reboot Linux 7.x VM) to load unkernel.wasm inside public/vm-worker.js (memoryMiB: 112, jit: true, external net omitted) and mount a reactive 9p MemoryFs at /work.
  2. Edit sales-q4.csv, notes.md, config.json, or site/index.html in the Reactive 9p File Explorer and watch mem.onChange() events update the workspace while real BusyBox awk and grep cards recalculate locally.
  3. Click Start & Fetch Loopback Site to run a BusyBox loopback HTTP server on guest port 8080 serving /work/site and fetch http://localhost:8080/ over vsock (vm.fetch()) with zero external sockets.
  4. Click Run Side-by-Side Comparison to measure exact wire bytes, parse stability, and real vm.exec() latency between structured WebMCP JSON and raw shell table stdout, then run Checkpoint -> Mutate -> Restore to verify vm.snapshot() kernel RAM rollback.
  5. Invoke any of the five registered WebMCP tools directly or connect an optional client-side LLM via Port Authority AI Router (https://llmchannel.dev/router.js), Chrome Built-in LanguageModel, or local Ollama.
Booting real Linux 7.x inside a browser Dedicated Worker via Unkernel and WebAssembly JSPI to drive a custom web UI, 9p MemoryFs explorer, BusyBox awk/grep cards, vsock loopback HTTP preview, and five typed WebMCP tools with zero server compute. Open headless browser linux & webmcp custom ui full screen ↗

Hypothesis

Running a full Linux 7.x kernel headlessly inside a Dedicated Worker behind a reactive 9p MemoryFs and typed WebMCP JSON tools removes terminal scraping fragility while keeping real POSIX execution latency in the tens of milliseconds with zero external network exposure.

What confirms it: BusyBox awk, grep, vsock loopback vm.fetch("http://localhost:8080/"), mem.onChange() live file sync, and vm.snapshot() / createKernel({ restore }) all execute cleanly inside the browser worker while returning schema-validated JSON with zero banner or column-parsing noise.

What bounds or disproves it: Dedicated Worker boot time, 12.2 MiB unkernel.wasm delivery, or JSPI browser support limitations prevent the headless UI from responding faster and more reliably than a terminal wrapper or server-backed API.

Under the hood

Headless Browser Linux & WebMCP Custom UI (GitHub) boots unkernel@0.3.0-261202-b033dc7 inside a module Dedicated Worker (public/vm-worker.js) importing /vendor/unkernel/0.3.0-261202-b033dc7/web.mjs with memoryMiB: 112, jit: true, and no external network device (net omitted). The 12.2 MiB unkernel.wasm binary is copied at build time by scripts/copy-unkernel.mjs into public/vendor/ (gitignored) and served directly by Cloudflare Static Assets with Cache-Control: public, max-age=31536000, immutable.

Instead of presenting a terminal emulator, the worker mounts an in-memory 9p MemoryFs at /work seeded with sales-q4.csv, notes.md, site/index.html, and config.json, subscribes to mem.onChange() to push live guest write notifications to the main thread, and exposes structured RPC methods backed by real BusyBox utilities (vm.exec("awk", ...), vm.exec("grep", ...), loopback HTTP fetched via vm.fetch("http://localhost:8080/"), and vm.snapshot() / createKernel({ restore })). The main thread (public/app.js) registers five typed tools (list_workspace_files, analyze_csv_with_awk, search_project, preview_guest_http, and checkpoint_and_restore) via navigator.modelContext?.registerTool with an automatic local fallback registry, lets users inspect real Linux uname -a output in an optional collapsible console peek, and compares WebMCP JSON payloads directly against human-formatted shell stdout on the same query.

Key terms & further reading

Unkernel (Linux 7.x in WebAssembly) ↗
A Linux 7.x kernel compiled to WebAssembly with an embedded BusyBox initramfs, vsock transport, 9p host file mounts, and live memory snapshots.
WebAssembly JSPI (JavaScript Promise Integration) ↗
Standard WebAssembly extension (WebAssembly.Suspending) that allows compiled kernel code to suspend on async host operations and resume cleanly.
WebMCP (navigator.modelContext) ↗
Browser specification for registering typed JSON-schema tools (registerTool) on a web page so agents invoke structured capabilities instead of scraping UI or terminal text.
9p MemoryFs & Dedicated Worker ↗
Runs the Linux VM off the main UI thread while mounting a host JavaScript file tree at /work with live onChange() callbacks whenever the guest modifies files.
Port Authority AI Router ↗
Optional client-side MessagePort router (https://llmchannel.dev/router.js) allowing users to connect their own LLM provider to drive WebMCP tools with zero server-held keys.

Open questions

  • How does unkernel.wasm cold-start latency scale when paired with persistent OPFS block overlays across repeat page visits?
  • Which subset of POSIX utilities should remain hidden behind typed WebMCP tools versus exposed directly when an agent hits an unanticipated edge case?

Iteration log

  • — Initial deployment on unkernel@0.3.0-261202-b033dc7 (Linux 7.3.4+): headless Dedicated Worker runtime, reactive /work 9p MemoryFs explorer, BusyBox awk CSV analytics, BusyBox grep project search, vsock loopback HTTP preview via vm.fetch(), 5-tool WebMCP surface with optional Port Authority / Chrome Built-in AI / Ollama runner, structured-vs-raw comparator, and vm.snapshot() checkpoint/restore.

Primitives tested: Unkernel (Linux 7.x WASM), WebAssembly JSPI, Dedicated Worker, 9p MemoryFs, Vsock Loopback vm.fetch(), WebMCP (navigator.modelContext), Kernel Snapshot & Restore.

This is an active lab under /labs/ and stays off the main RSS feed until graduated into a full essay.

More in browser-delivered vms & container fabrics

Connected labs

← browser-delivered vms & container fabrics · All labs