hn.today

A real Linux kernel, compiled to WebAssembly

github.com3 points0 comments
Screenshot of A real Linux kernel, compiled to WebAssembly

Unkernel runs a real Linux 7.x kernel as a WebAssembly module, rather than emulating an entire computer or replacing Linux with a compatibility layer. The kernel’s system calls, scheduler, memory management, filesystems and networking execute as compiled code; an included aarch64 CPU emulator runs unmodified ARM64 Linux programs, with a JIT that speeds up frequently used instructions. Its virtual memory supports features such as fork, copy-on-write, threads and signals. The system includes Linux filesystems and TCP/IP, plus namespaces, cgroups, devices, sound and graphics. It can boot Alpine to a shell in about 0.3 seconds after launch, with the browser download around 10 MB, and reports syscall and process-creation costs near native levels. CPU-heavy workloads remain slower than native Linux.

The project makes this environment available in modern browsers or through the `npx unkernel` command-line tool, without installing a guest system or relying on a server to run it. Users can install Alpine packages, run tools such as Python, Node and OpenSSL, or boot Debian; browser changes can persist in an ext4 disk stored locally. Networking works through a proxy in browsers and host sockets in the CLI. A TypeScript SDK lets developers embed the kernel in applications, connect terminals, mount host files and script tests. The repository also describes current limitations, while presenting Unkernel as a portable Linux shell and application runtime rather than a replacement for native performance.

Read on github.com0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Big Data Is Dead

Big Data Is Dead

Big data is not the main obstacle to useful insights: hardware has kept pace with data growth, while teams still struggle to make sense of their information. The author argues that organizations should focus on making data easier to understand and use, rather than buying tools built for ever-larger datasets. (motherduck.com)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.