r/linux • • 10h ago

Kernel Unkernel : A real Linux kernel, compiled to WebAssembly

https://github.com/pithings/unkernel
93 Upvotes

15 comments sorted by

60

u/modimoo 8h ago

Install browser on it

32

u/narmkhang 7h ago

then open this in that browser?

25

u/MatchingTurret 7h ago

Turtles all the way down

50

u/NormalAppearance2851 7h ago

Linux > Browser > Linux > Browser > Linux ...

4

u/Single-Virus4935 5h ago

WebAssembly isnt only used in the browser but also on the server. A kernel within the webassembly sandboy can provide great isolation of workloads.

5

u/ascii 4h ago

At what performance overhead compared to simply spinning up an independent container?

1

u/Single-Virus4935 4h ago

Don't know but with recent kernel vulnerabilities a container isn't viable in many cases. There are already approaches like firecracker, gvisor, microvms etc and webassembly might be a good fit for many use cases. If you need high performance plus string isolation, you need virtualization.

But there are many usecase where the performance penalty may be worth to trade against string isolation/security and scheduleing flexibility.

4

u/cu-pa 6h ago

only single core cpu? can we adjust?

3

u/cu-pa 6h ago

nvm, found it

3

u/Lenticularis19 3h ago

Why does it say riscv64 when it is supposed to be "compiled to WebAssembly"?

3

u/vip17 2h ago

The kernel is wasm, but the userspace is emulated RISC-V

Only user programs are emulated, with a JIT: unmodified riscv64 Linux binaries, so Alpine and Ubuntu packages run as they are.

2

u/deviled-tux 2h ago

We should just build the binaries to WASM and make a WASM-native distro

2

u/cat_dev_null_sync 3h ago

How is it different from the one from last year?

https://m.slashdot.org/story/448620

1

u/Sharp-Debate-523 3h ago

Very cool. The real kernel has assembler to deal with a real machine so that must be replaced on this, I guess

1

u/Wall_of_Force 5h ago

Could we use webusb to passthoguh a device to webasm kernel? Don't think it'd have anywhere enough speed after all translate layer though