Live data from Hacker News

Unix in the Browser Tab

browsix.org

31–40 of 79 posts

Re: Unix in the Browser Tab

#31

Wow I'm literally implementing this right now!! I was stuck at parents for xmas and I picked Tannenbaum “distributed systems” and “Modern operating systems”, which gave me an idea of running a "kernel" on a browser. It was more of an academic exercise than anything else, but my intention was to have a the following: Being able to unload and reload javascript. The initial idea was to write the website inside the websi…

Have you looked at running Inferno in the browser? Granted the OS is heavily bit rotted though there are still people poking at it.

Join a plan 9 community. Tons of resources and people doing what you want to do. Check my profile for links and channels.

Re: Unix in the Browser Tab

#32

Wow I'm literally implementing this right now!! I was stuck at parents for xmas and I picked Tannenbaum “distributed systems” and “Modern operating systems”, which gave me an idea of running a "kernel" on a browser. It was more of an academic exercise than anything else, but my intention was to have a the following: Being able to unload and reload javascript. The initial idea was to write the website inside the websi…

Have you looked at running Inferno in the browser? Granted the OS is heavily bit rotted though there are still people poking at it. Join a plan 9 community. Tons of resources and people doing what you want to do. Check my profile for links and channels.

I will take a look for sure. I didn't knew they actually got inferno running on a browser. Probably some of you can help me understand better on how to implement certain parts of the OS.

Re: Unix in the Browser Tab

#34

Why not "stream" an image of an actual OS (say, linux) to the browser? Has anyone pulled that off yet? (Kind of like rendering services for example, the client is just for user interaction, everything else is streamed from server where all the computation happens)

Yes, I'm aware of this one, but it is using a cross-compiled TinyEMU, so it's a level of emulation away from what this is doing. https://bellard.org/jslinux/ [edit] Oh, I guess this isn't really what you were looking for. Whoops!

I really want to get this to work well, but haven't been able to. I have a small use case of customizing the image it presents and letting users be able to navigate/change/fix things on it. I've tried using containers and even VMs, but those are too heavy for what I need to do and I don't want to deal with snapshots to revert the image. Basically reloading the web page should do it.

Wish I could get jslinux to work for what I want with this!

Re: Unix in the Browser Tab

#35
post #2

Past discussion: https://news.ycombinator.com/item?id=13151566 (2016, 124 comments)

Interesting, I'm assuming Browsix must have been rewritten in Typescript significantly later; TS must have been much more niche in 2016 (though wikipedia tells me it may be as old as 2012)

(one of the authors here) it was written in Typescript from the start! Typescript eliminated a bunch of type confusion errors when developing the kernel, although the need to marshal data across a MessagePort means we have to do some casting and lose some safety.

Re: Unix in the Browser Tab

#36

Why not "stream" an image of an actual OS (say, linux) to the browser? Has anyone pulled that off yet? (Kind of like rendering services for example, the client is just for user interaction, everything else is streamed from server where all the computation happens)

gaikai was doing this in the early 2010s for zero-day game release demos. java in the browser, streaming video and audio from servers, relaying back game input events.

Re: Unix in the Browser Tab

#37

What is the use case this is solving?

(author here) Without something like Browsix you have to make a choice: find a JavaScript library or implement the functionality you want to run client side, or run existing Unix programs and libraries (that expect a filesystem, to be able to fork children, etc) server side. If you run software server side, now you have to worry about containerizing/security as well as horizontal scaling.

Browsix addresses this by letting you run Unix programs directly in the browser, taking advantage of the significant compute power on peoples laptops (and even phones nowadays!), eliminating a whole class of security issues (software explicitly will only have access to the current users data in the browser tab) and scaling concerns.

Re: Unix in the Browser Tab

#38

So emscripten is still the compiler, but this is an OS which can be targeted by emscripten? Am I understanding it right?

That's pretty right, with the addition that other things can target Browsix (like the gopherjs toolchain). Emscripten provides default implementations of a bunch of syscalls (and even a way to embed a file system), and we override those to instead do actual syscalls to a shared kernel (running in JS)

Re: Unix in the Browser Tab

#39

I'd like to see Node.js running on it. I know StackBlitz has "WebContainers" but I'm looking for something open source.

Also, StackBlitz reuses as much as possible the existing V8 runtime from the browser, rather than really running another node.js via WASM.

Re: Unix in the Browser Tab

#40
This is amazing.

I’m imagining all the ways I could use this for offensive security tools.

If I had a way to import a js library that enabled running web servers, invoking OS commands, or running a reverse http proxy I’d be able to do so much damage to any target client.

Post reply on HN