Linux Ported to WebAssembly, Boots in a Browser Tab (phoronix.com) 54
"During the past two years or so I have been slow-rolling an effort to port the Linux kernel to WebAssembly," reads a surprising post on the Linux kernel mailing list.
I'm now at the point where the kernel boots and I can run basic programs from a shell. As you will see if you play around with it for a bit, it's not very stable and will crash sooner or later, but I think this is a good first step.
Wasm is not necessarily only targeting the web, but that's how I have
been developing this project... This is Linux, booting in your browser tab, accelerated by Wasm.
Phoronix warns that "there are stability issues and it didn't take me long either to trigger crashes for this Linux kernel WASM port when running within Google Chrome."
Phoronix warns that "there are stability issues and it didn't take me long either to trigger crashes for this Linux kernel WASM port when running within Google Chrome."
What A Waste (Score:1, Troll)
What a waste of time.
But, the good news is that the work has been done and now bad actors can run a full Linux system in victim browsers and finally have more power than JavaScript allowed.
Yay!
Until they remove the Bloatware (Score:1)
Re: What A Waste (Score:1)
Just what I wanted to post. Anyway, let's get back to wasting some more watts on "ai" and get rid of our own jobs.
Re: (Score:2)
Not sure why the parent has been modded down - is modding now used to signal disagreement rather than genuinely bad posts?
I came to comments to say the same - such a sad waste of time and effort of clearly an intelligent engineer who could have used his time and skill to contribute a lot of good in other Open Source projects.
It's a bit like the Linux distro disaster. Clearly a lot of talented devs, who could be unified under an organisation which manages the resources properly, to build an amazing desktop e
Loads faster most ad ridden sites.. (Score:4, Informative)
Who wants this? (Score:1, Troll)
Re: (Score:1, Insightful)
Aren't bragging rights enough?
Re: Who wants this? (Score:5, Insightful)
Re: (Score:2, Interesting)
Once upon a time people understood irony. I can run linux on my toothbrush, this is nothing.
Re: (Score:1, Insightful)
It takes a troll to know a troll...
Only trolls care about Karma.
See, I'm posting as AC, so it will either be marked -1 Troll or +2 Informative depending on the grace of the moderators.
Irony, sir? No one cares about your toothbrush, this is a Wendy's.
Re: (Score:2)
Perhaps they mean WebAssembly?
Re: (Score:2)
So I have had a few scenarios where I really didn't have any business moving data between the browser and a backend service and I would have just as soon done an operation client-side, but the ecosystem that was equipped to do the task wasn't exactly trivial to get to work in-browser. I could imagine some such use cases easier to port if a Linux instance could live transiently in browser runtime.
I've spent a fair amount if time trying to wrangle specific use cases into this scenario, but could imagine a 'l
Re: (Score:2)
Am I 10 years behind on this? A. probably.
is the browser still supposed to be a sandbox?
Re: (Score:2)
You could, in theory, have a context that is entirely within the sandbox and useful. Hence my comment about getting things in and out of the environment potentially negating many of the scenarios I can think of. But broadly speaking, if you had some local processing to do, you feed the environment a blob and the environment can now pretend it's a normal file as far as it is concerned, and then you can pull the blob out when done. WASM can't touch real stuff but you can feed it stuff within the reach of j
Re: (Score:2)
Article subject says 'browser' but I'm thinking web-based IDE, such as VSCode.
Bootstrapping just enough operating system to get your work done, within the same web sandbox as the parent process.
It could be lighter-weight alternative for certain simple tasks than hyper-virtualization, containers and all that jazz...
Re: (Score:2)
Most things can. Python, perl... you generally don't need a full linux for it.
Of course, if your ecosystem was binary-only, a full linux could help you emulate that functionality.... but boyyyyyy the overhead, heh.
Re: (Score:2)
The same people who got Doom to run on a pregnancy test.
Re: (Score:2)
And this isn't?
Re: (Score:2)
This is getting user-mode linux to compile under wasm, and is indeed pretty fucking cool.
Swapping out the guts in some arbitrary thing and then saying, "arbitrary thing did X" is just bullshit.
Re:Who wants this? (Score:4, Insightful)
I think it's pretty damn cool. Mad bragging rights.
Re: (Score:2)
Re: (Score:2)
In what fucking world do you think peoples' cool personal projects need to conform to your fucking wants?
Re: (Score:2)
Paging Dr Ian Malcolm! (Score:1)
Re: (Score:1)
That is one big pile of shit.
Re: (Score:3)
Can it run DOOM? (Score:3)
Just asking for a friend.
Maybe (Score:3)
So I pondered this seriously and the demo displays using Xterm.js [xtermjs.org] which is pretty advanced for displaying a terminal.
Unfortunately, Xterm.js does not support the Kitty graphics protocol [github.com] which is used by Terminal Doom [github.com]. However, DOOM-ASCII [github.com] which uses colored ASCII art and lacks sound.
Caveats:
* if DOOM-ASCII adds anything to the original DOOM that requires an MMU then it can't run because there is no MMU support in the WASM Linux port.
* The WASM Linux port author wrote that, "The console freezes after 5 minute
Re: Maybe (Score:1)
Re: (Score:2)
Here's the GitHub project: https://github.com/cloudflare/... [github.com]
DOOM has also been ported to JS to run locally in a browser tab: https://dos.zone/doom-dec-1993 [dos.zone]
How about a web server? (Score:1)
Cool (Score:2, Insightful)
now run firefox in it!
Re:Cool (Score:4, Insightful)
... then boot Linux via WASM on Firefox running on Linux via WASM on Chrome!
Java legacy (Score:2)
Try it here: (Score:4, Informative)
https://joelseverin.github.io/... [github.io]
Finally it's the year of linux on the. (Score:3)
Kudos for pulling it off, I hope it can soon run doom; but this is what is wrong with web - um - 3.0? 4.0? what version does the inventor of the web say we are on now?
The web standard should have never included the ability to execute arbitrary code. Just interpreting markup tags was already too hard to do properly.
Re: (Score:2)
Already done... https://bellard.org/jslinux/ [bellard.org]
Interesting (Score:2)
Old news (Score:2)
https://bellard.org/jslinux/ [bellard.org] did this in 2011,originally in JS but later ported to wasm ( https://bellard.org/jslinux/te... [bellard.org] ). /. comments shouted this obvious fact.
The saddest part is that none of the 41 original
(At least the phoronix crowd knew this).
Re: (Score:2)
That's the first thing I thought of, but I think the approach is different. Fabrice Bellard created an x86 emulator in javascript, and ran linux on it (later risc64). Joel Severin complied the linux kernel directly to javascript. If you look at the web page, he describes some previous attempts and how his more direct approach was inspired by them, and some of the limitations (scheduling is offloaded to your host OS, because with the web assembly build, every task in the js linux is a web worker, which becau
Security Vulnerability waiting to be exploited (Score:2)
Re: (Score:2)
The good news is, as soon as the browser tab closes, the universe ends, and the vulnerability with it.
Re: (Score:2)
Re: (Score:2)
WASM can't do anything JavaScript can't already do. It's just a bytecoded version of JavaScript itself.
This needs to stop (Score:2)
If your browser can essentially run a binary-blob OS now, then this whole idea of webassembly really, REALLY needs to be stopped and erased.
Especially since the typical former-JavaScript npm monkies should never be given this kind of close-to-hardware access.
Re: (Score:2)
Linux has been running within the browser for years already. https://bellard.org/jslinux/ [bellard.org]
It's no closer to the hardware than JavaScript itself. It's just byte-coded JavaScript. https://blog.purestorage.com/p... [purestorage.com] It's kind of like how .NET, Java, Python, Ruby, PHP, Lisp, and Smalltalk aren't really compiled, they're byte-coded.