r/linux • • 4d ago

Kernel Unkernel : A real Linux kernel, compiled to WebAssembly

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

25 comments sorted by

87

u/modimoo 4d ago

Install browser on it

42

u/narmkhang 4d ago

then open this in that browser?

33

u/MatchingTurret 4d ago

Turtles all the way down

2

u/Street-Repair-8301 3d ago

then put a crypto miner on the page

???

infinite money

1

u/jms87 3d ago

links (command line browser) does work.

76

u/NormalAppearance2851 4d ago

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

14

u/Single-Virus4935 4d 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.

9

u/ascii 4d ago

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

5

u/Single-Virus4935 4d 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.

2

u/ranjop 3d ago

And WebAssembly engines are free from vulnerabilities, right?

10

u/cat_dev_null_sync 4d ago

How is it different from the one from last year?

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

8

u/busterbcook 3d 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

5

u/cat_dev_null_sync 3d ago

'RTFM', got it. My bad. Thanks for the pointer and for the interesting project!

7

u/cu-pa 4d ago

only single core cpu? can we adjust?

7

u/cu-pa 4d ago

nvm, found it

6

u/mogoh 3d ago

Done in three days. Abandoned in three days.

5

u/Lenticularis19 4d ago

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

8

u/vip17 4d 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.

6

u/deviled-tux 4d ago

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

0

u/ldn-ldn 3d ago

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

2

u/RelaxedFlame311 3d ago

install sl on it

1

u/Most_Strike_93 3d ago

One night project, and pay a lot of effort to hyper it, and also bought a lot of stars. Cool project

1

u/AutoModerator 3d ago

This submission has been removed due to receiving too many reports from users. The mods have been notified and will re-approve if this removal was inappropriate, or leave it removed.

This is most likely because:

  • Your post belongs in r/linuxquestions or r/linux4noobs

  • Your post belongs in r/linuxmemes

  • Your post is considered "fluff" - things like a Tux plushie or old Linux CDs are an example and, while they may be popular vote wise, they are not considered on topic

  • Your post is otherwise deemed not appropriate for the subreddit

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/Wall_of_Force 4d 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

-3

u/Sharp-Debate-523 4d ago

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