r/linux • • 10h ago

Kernel Unkernel : A real Linux kernel, compiled to WebAssembly

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

18 comments sorted by

61

u/modimoo 9h ago

Install browser on it

32

u/narmkhang 8h ago

then open this in that browser?

25

u/MatchingTurret 8h ago

Turtles all the way down

51

u/NormalAppearance2851 7h ago

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

5

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 7h ago

only single core cpu? can we adjust?

3

u/cu-pa 7h ago

nvm, found it

4

u/Lenticularis19 3h ago

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

4

u/vip17 3h 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

•

u/ldn-ldn 17m ago

The kernel should just be rewritten in JavaScript and run directly in V8, skipping all C/Rust/Assembly nonsense.

2

u/cat_dev_null_sync 3h ago

How is it different from the one from last year?

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

•

u/busterbcook 3m ago

It describes the differences in the readme between it and prior projects: this one has an MMU, that one does not:

https://github.com/pithings/unkernel#-how-it-works

•

u/RelaxedFlame311 4m ago

install sl on it

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

0

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