Unkernel:把Linux搬进浏览器,3.6MB与秒开要分开看
Unkernel: Linux in Wasm, File Sizes and Boot Boundaries
Unkernel让真实Linux内核在浏览器或Node中运行,提供Shell和Linux程序执行环境。它适合嵌入式终端、教学实验和工具沙箱;“3.6MB”“不到1秒”需要带上版本、下载与计时条件,不能当成整台机器的统一规格。
项目仓库为pithings/unkernel。内核与相关组件包含GPL条款,JavaScript SDK及页面采用MIT;分发包同时带Linux内核与基础用户空间,package.json标注MIT AND GPL-2.0-only,不能把整个包笼统称作MIT软件。
核对日期:2026年11月30日。源码固定在
6f3b27b94da3ed3b5012df40a06403394717762c;实际运行下载的是11月29日发布的v0.3.0-261129-61519ce,两者分别记录。本次实测在Apple Silicon Mac的Node v26.10.0中完成,没有测浏览器冷启动、Debian或图形性能。
官方仓库:https://github.com/pithings/unkernel 浏览器演示:https://unkernel.dev/ 本次发布资产:https://github.com/pithings/unkernel/releases/tag/v0.3.0-261129-61519ce
真Linux内核,为何用户程序仍需要模拟?
关键在于两段执行路径。Linux的系统调用、调度、内存管理和文件系统被编译为Wasm;未修改的aarch64 Linux二进制则交给链接进内核的kwemu执行。kwemu用Zig实现ARM64软件CPU,包含解释执行、预解码层和把热点代码转成Wasm的JIT。
用户程序发起系统调用时,执行返回编译后的Linux内核处理。它不是把整台传统PC连内核一起模拟,也不是只用JavaScript重新实现一组POSIX接口;但也不能说“完全没有CPU模拟”。
项目基于arch/wasm及MMU页表,把fork、mmap、写时复制等Linux行为留给真实内核。分发的ARM64包能够按原有格式运行,是它对工具兼容性的核心取舍;纯计算代码仍受kwemu的执行路径影响。

3.6MB指什么,当前版本到底有多大?
原素材没有附3.6MB的版本与压缩口径。本次最新发布资产可以直接核对字节数;下面使用MiB,即每MiB为1,048,576字节。gzip列指发布页的.gz文件,不是浏览器必然采用的传输大小。
| 发布资产 | 原始文件 | 对应gzip文件 |
|---|---|---|
| unkernel-up.wasm(单核) | 11.27 MiB | 4.11 MiB |
| unkernel-smp.wasm(多核) | 12.11 MiB | 4.24 MiB |
| unkernel.wasm(可启动bundle) | 12.86 MiB | 4.98 MiB |
bundle不只等于裸内核。构建文档说明,它还携带基础initramfs、命令行、数据盘模板与SMP补丁等自定义段。npm分发包还包含SDK及其他运行资产。
发行版镜像又是另一笔:本次Alpine镜像为4,046,848字节,即3.86 MiB;Debian为77,791,232字节,即74.19 MiB。SDK不把它们全塞进npm包,而按调用者选择加载。浏览器对镜像可用范围请求按需读取,所以镜像总文件大小也不等于到Shell前一定下载的字节数。
我们下载了发布包、Alpine镜像及distros.json,核对GitHub资产大小与提供的摘要,并用发行版清单核对Alpine的SHA-256。由此能确认本次运行材料的身份,不能证明所有历史演示都用了相同资产。

“不到1秒”从哪一步开始计时?
README给出两种作者测量:内核启动后约70ms到/init,以及Node进程启动后约0.3秒出现Alpine提示符。这两种计时起点都不能直接替代“首次打开网页到可用终端”。
网页还可能经历特性检查、资源下载、Wasm编译、内存分配、发行版读取、持久盘打开或会话恢复。缓存、网络、单核/多核、发行版和设备不同,都会影响观察值。要验证浏览器秒开,应同时记录这些条件与终点,而不是只读内核日志中的某个时间戳。
本次没有设计冷/热启动基准,不报告自己的启动速度。实际Node烟测给基础系统和Alpine各配置1个CPU、128 MiB来宾内存;这只说明该配置下能完成所测命令,不代表浏览器总内存、峰值RSS或最低内存需求。
我们在真实来宾系统里跑通了什么?
Mycelium Protocol使用下载的SDK发行包,分别启动基础系统与Alpine。两次都通过exec执行Shell,得到Linux 7.3.4+、aarch64输出,完成/tmp文件写入回读和gzip压缩解压往返,再正常关机。
Alpine一侧还读到发行版标识及overlay根挂载。没有给来宾配置网络或宿主目录挂载,/proc/net/dev只显示回环接口。这次运行没有把真实工作目录交给来宾,也没有安装额外软件。
这比核对README多了一步实际执行,但范围很明确:没有运行浏览器测试套件,没有验证浏览器持久盘、多核、图形、音频、Wisp网络或Debian,也没有复现作者的系统调用与JIT性能表。两次启动通过不代表整个Linux软件仓库都已验收。
计算在本地,为什么还会用到服务器?
内核和用户程序的计算可在本机完成,但资源下载与对外联网是另外的路径。浏览器不能任意打开原始TCP连接,因此官方页面通常通过Wisp代理访问网络;Node则可以配置直接使用宿主Socket的后端。
代理能看到连接目标和线上传输字节。HTTPS流的应用内容受TLS保护,明文协议则没有这层保护。README还说明默认壁纸会请求Lorem Picsum;选择内置壁纸可以避免这一路请求。因而“没有远程计算服务器”不等于网页启动和后续操作都不联网。
SDK的createKernel不传net时默认不接网络;CLI默认联网,两者不要混用口径。做受控演示时,可先选无网络、无宿主文件挂载的配置,再按任务添加能力。
浏览器还要支持JSPI,即WebAssembly.Suspending等能力。当前README列出Chrome/Edge 137+、Firefox 153+、macOS Safari 27+及iOS/iPadOS 27;多核还依赖跨源隔离和Worker。不能只凭“支持Wasm”就认定旧浏览器能运行。

适合用它做Agent沙箱吗?
适合考虑的场景包括:给文档嵌入可操作Linux终端、为学习者提供可重置实验环境、让Agent执行一些已有ARM64命令,或通过SDK拿到结构化的标准输出与退出码。
边界需要由宿主应用定义。SDK可以挂载宿主文件、接入网络,甚至提供宿主命令桥;启用这些能力会扩大来宾能触及的范围。Linux来宾加浏览器沙箱也不等于无需权限设计的多租户安全产品。
浏览器磁盘可以留在站点的OPFS或IndexedDB中,Node可附加数据盘文件;不附加持久盘时,根文件系统的改动默认留在内存、退出即消失。浏览器存储额度、用户清理站点数据和导出备份都要考虑。本次没有做跨刷新或异常退出恢复测试。
我们的判断是:Unkernel的价值在于把真实Linux行为做成可嵌入的运行组件,让已有命令行工具更容易进入网页。选用它时,应先固定内核/基础系统/镜像组合和输入输出,再验证具体工作负载;不要用一个体积数字替代兼容性、性能与隔离验收。
内核构建说明:https://github.com/pithings/unkernel/blob/6f3b27b94da3ed3b5012df40a06403394717762c/kernel/README.md 浏览器配置:https://github.com/pithings/unkernel/blob/6f3b27b94da3ed3b5012df40a06403394717762c/web/src/config.ts 相关Agent运行时阅读:https://blog.mushroom.cv/blog/exo-self-improving-harness-runtime-boundaries/
常见问题
Unkernel是一个只有3.6MB的完整发行版吗?
不能这样概括。内核、带基础系统的bundle、SDK与发行版镜像是不同资产,原始大小和压缩大小也不同。本次版本的单核Wasm原始文件为11.27 MiB,Alpine与Debian镜像另计。
支持Wasm的浏览器都能运行吗?
不一定。项目需要JSPI等特性,多核还需要Worker和跨源隔离。应按当前兼容性列表核对具体浏览器版本,并在目标设备上验证。
本次是否实测浏览器不到1秒启动?
没有。本次实测是Node SDK中的两个真实来宾启动与命令执行,没有测浏览器冷启动或复现性能基准。作者的70ms和0.3秒也有各自的计时起点。
© 2026 Author: Mycelium Protocol. 本文采用 CC BY 4.0 授权——欢迎转载和引用,须注明作者姓名及原文链接,不得去除署名后以原创发布。
Unkernel runs a real Linux kernel in a browser or Node, providing a shell and Linux-program execution. It is useful for embedded terminals, learning environments and tool sandboxes. The “3.6 MB” and subsecond claims need a version, download scope and timing definition.
The project is pithings/unkernel. Kernel-related components carry GPL terms, while the JavaScript SDK and page are MIT. The distributed package contains a Linux kernel and base system and declares MIT AND GPL-2.0-only; the whole package is not simply MIT.
Checked November 30, 2026: source is pinned to 6f3b27b94da3ed3b5012df40a06403394717762c; our actual runtime came from v0.3.0-261129-61519ce, released November 29. We tested Node v26.10.0 on an Apple silicon Mac, not browser cold startup, Debian or graphics performance.
Repository: https://github.com/pithings/unkernel Browser demo: https://unkernel.dev/ Tested release: https://github.com/pithings/unkernel/releases/tag/v0.3.0-261129-61519ce
Why does a real Linux kernel still need user-program emulation?
Linux syscalls, scheduling, memory management and filesystems are compiled to Wasm. Unmodified aarch64 Linux executables run through kwemu, an ARM64 software CPU written in Zig and linked into that kernel. It has interpretation, a decoded-operation tier and a JIT that compiles hot guest code to Wasm.
A syscall returns to compiled Linux code. This differs from emulating a whole traditional PC including its kernel, or reimplementing POSIX calls without Linux. It still includes CPU emulation for user programs.
The arch/wasm port and MMU page tables retain Linux behavior for fork, mmap and copy-on-write. Running distribution binaries unchanged is the compatibility tradeoff; CPU-heavy work remains sensitive to kwemu’s execution tiers.

What does 3.6 MB include, and how large is this release?
The supplied note does not identify a release or compression convention for 3.6 MB. Current release assets can be checked directly. This table uses MiB, or 1,048,576 bytes. The gzip column is the explicit .gz asset, not guaranteed browser transfer size.
| Asset | Raw file | Gzip file |
|---|---|---|
| unkernel-up.wasm, single CPU | 11.27 MiB | 4.11 MiB |
| unkernel-smp.wasm, multiple CPUs | 12.11 MiB | 4.24 MiB |
| unkernel.wasm, bootable bundle | 12.86 MiB | 4.98 MiB |
The bundle is more than a bare kernel: build documentation includes a base initramfs, command line, disk template and SMP patch in custom sections. The npm archive also contains SDK and other runtime assets.
Distribution images are separate: Alpine is 4,046,848 bytes, or 3.86 MiB; Debian is 77,791,232 bytes, or 74.19 MiB. They are not all embedded in the npm package. Browser range reads can load image regions lazily, so a complete image’s size is not necessarily the bytes needed before the prompt.
We checked the downloaded package, Alpine image and distros.json against GitHub asset sizes and supplied digests, and checked Alpine against its manifest SHA-256. That identifies our inputs, not the artifacts used by every earlier demo.

Where does the subsecond timer begin?
The README reports about 70 ms from kernel start to /init and an Alpine prompt about 0.3 seconds after starting Node. Neither is automatically the interval from opening a fresh browser page to a usable terminal.
Browser feature checks, download, compilation, memory allocation, image reads, storage opening and session restoration can add stages. Cache, network, CPU count, distribution and device affect the observation. A browser-startup test needs those conditions and its endpoint recorded.
We did not design a cold/warm benchmark and report no measured boot speed. Our base and Alpine checks each used one CPU and 128 MiB of guest memory. That establishes only the tested configuration, not browser process memory, peak RSS or a minimum requirement.
What ran inside real guests?
Mycelium Protocol used the downloaded SDK release to boot the base system and Alpine separately. Both executed shell commands through exec(), reported Linux 7.3.4+ and aarch64, wrote and read a /tmp file, completed a gzip/gunzip round trip, and powered off normally.
Alpine also returned its distro identity and an overlay root mount. We configured neither guest networking nor host directory mounts; /proc/net/dev showed only loopback. No extra packages were installed.
This was actual execution beyond reading documentation, with a narrow scope. We did not run the repository’s browser suite, browser storage, SMP, graphics, audio, Wisp or Debian tests, nor reproduce syscall/JIT performance tables. Two working boots do not validate the entire package archive.
Why can local execution still involve servers?
Kernel and user-program computation can stay on the device while downloads and networking use separate routes. Browsers cannot open arbitrary raw TCP sockets, so the public page generally uses a Wisp proxy. Node can use a direct host-socket backend.
A proxy sees destinations and wire bytes. TLS protects HTTPS application content; plain protocols lack that protection. The README also notes a default Lorem Picsum wallpaper request, avoided by choosing a built-in wallpaper. Local computation is therefore different from a completely offline page.
createKernel() has no network unless net is passed, whereas the CLI enables networking by default. Start controlled demonstrations without networking or host mounts, then add capabilities deliberately.
JSPI support, including WebAssembly.Suspending, is required. The current README lists Chrome/Edge 137+, Firefox 153+, macOS Safari 27+ and iOS/iPadOS 27. Multiple CPUs additionally require workers and cross-origin isolation. Generic Wasm support alone is insufficient.

Is it useful for agent sandboxes?
Potential uses include interactive documentation, resettable learning exercises, executing existing ARM64 tools for agents, and collecting structured stdout and exit codes through the SDK.
The embedding application defines authority. Host filesystem mounts, networking and host-command bridges expand what guests can reach. A Linux guest plus browser isolation is not, by itself, a complete multi-tenant security product.
The page can persist data in OPFS or IndexedDB; Node can attach disk files. Without a persistent disk, root changes remain in memory and disappear on exit. Browser quota, cleared site data and exports still matter. We did not test reload persistence or crash recovery.
Our assessment is that Unkernel packages real Linux behavior into an embeddable component. Pin the kernel/base/image combination and input/output contract, then validate your workload. File size alone cannot substitute for compatibility, performance and isolation checks.
Kernel build: https://github.com/pithings/unkernel/blob/6f3b27b94da3ed3b5012df40a06403394717762c/kernel/README.md Browser configuration: https://github.com/pithings/unkernel/blob/6f3b27b94da3ed3b5012df40a06403394717762c/web/src/config.ts Related agent runtime: https://blog.mushroom.cv/blog/exo-self-improving-harness-runtime-boundaries/
FAQ
Is the complete Linux distribution only 3.6 MB?
No such conclusion follows. Kernel files, a base-system bundle, SDK and distribution images are separate, as are raw and compressed bytes. This release’s raw single-CPU Wasm is 11.27 MiB; distro images are additional.
Does every Wasm-capable browser work?
No. JSPI and other features are required, with workers and cross-origin isolation for multiple CPUs. Check the current browser list and your actual target device.
Did we measure a browser boot below one second?
No. We booted two real Node guests and exercised commands, without a browser cold-start or performance benchmark. The authors’ 70 ms and 0.3-second figures also start at different points.
© 2026 Author: Mycelium Protocol. Licensed under CC BY 4.0 — free to share and adapt with attribution. You must credit the author and link to the original; removing attribution and republishing as original is not permitted.
关于本站 · 免责声明
🍄 Mushroom Research Blog 是非营利、免费公开的个人科技观察博客与公众号 XStack18,不接受商业合作、不代表任何企业或机构立场,也不谋求商业利益。我们以个人视角客观中立地记录和分析 AI、Web3 等领域的最新模型发布与技术动态——不止转述新闻标题或二手信息,而是给出有独立思考的深入分析,希望帮更多人获得有价值的一手科技认知。
⚠️ 文中介绍的开源代码与模型,仅供学习交流与技术借鉴。它们大多仍处于早期阶段,有待进一步研究和验证,请勿直接用于工作或生产环境;如需采用,请先自行充分测试,并核实其许可证与安全性。
Open-source code and models featured here are shared for learning and reference only. Most are early-stage and still need further study and verification — please don't use them directly in your work or in production. Test them thoroughly and check their licenses and security first.
- 本站文章均为作者基于公开信息的个人研究与观点整理,不代表文中提及的任何公司、产品、模型的官方立场,未与其构成商业关联或合作关系。
- 科技行业信息更新极快,我们尽力保证内容准确、及时,但不对完整性、实时性做绝对保证,具体请以相关企业/项目官方公告为准。
- 文中引用的第三方商标、产品名称、图片、数据等版权归原权利人所有,我们会尽量注明来源;如你认为存在版权疑问或侵权,请通过下方邮箱联系我们,收到通知后会尽快核实处理(更正、加注来源或删除)。
- 文章内容仅为技术科普与个人观点,不构成投资、法律或其他专业建议,据此进行任何决策的后果需自行判断和承担。
📮 侵权 / 勘误 / 合作咨询:[email protected]
💬 评论与讨论
使用 GitHub 账号登录后发表评论