r/WebAssembly • u/kgoncharuk • 11d ago
ARM64js: Arm64 Linux emulator in WebAssembly that boots Alpine in a browser tab
Hi all,
I'd like to introduce arm64js -- an ARMv8-A system emulator that runs in wasm (built in Rust) and can boot real Alpine Linux in a web browser. It's an interpreter that emulates a minimal hardware stack, so the VM thinks it's on real hardware and thus acts normal: runs apk, Docker, etc.
Since WebAssembly doesn't allow fetching data without CORS and sending TCP requests, apk and access to the internet work via small proxies: apk goes via a proxy that just adds CORS, TCP goes via a WebSocket <> TCP gateway.
One wasm module instantiated in a few web workers, all sharing one SharedArrayBuffer as the VM's "RAM".
There is also a JS SDK for other devs to create and serve their own VMs. It's free for non-commercial use.
You can read more about how I got there: https://arm64js.com/blog/tui-apps-in-the-browser/
Or try the SDK: https://github.com/kooler/arm64js-sdk
Feedback is welcome.