
JSLinux – Run Linux or other Operating Systems in your browser - begoon
https://bellard.org/jslinux/
======
christophilus
It takes less time to boot Linux in Chrome on my laptop than it takes Reddit
to load a discussion on my phone. That's pretty amazing. Not sure which is
more amazing: How slow Reddit mobile is or how fast Linux boots in JS.

~~~
chii
The old Reddit .compact page loads very fast :
[https://reddit.com/r/.compact](https://reddit.com/r/.compact)

Don't use the mobile web view! It sucks!

~~~
FractalNerve
wow, this is really insanely fast, great share!

I currently use Joey for Reddit and OpenGur for Imgur.

------
jason_slack
I feel like Bellard is a super hero. I wonder if he has a day job and just
takes on these interesting (and large?) projects during his off time.

~~~
masklinn
He's the co-founder and CTO of Amarisoft, an LTE/4G hardware and software
company:
[https://www.amarisoft.com/company/](https://www.amarisoft.com/company/)

~~~
jameskegel
Companies with this type of leadership are the ones I'm interested in giving
my money to, long-term, as a consumer. Not because of any sort of principled
decision based on his skills, but because I feel these types of workers would
stay sharp and be quicker to solve problems correctly should they appear.

------
coreyp_1
I just played Pinball in Windows 2000 in Chrome on Windows 10. I lost, but
winning was not the point. Playing was. :)

I think that that sentiment encapsulates my CS experience.

~~~
SubiculumCode
Just want to say that Windows Pinball may be MS's best software ever. The
gameplay is pretty deep and well balanced.

~~~
gattilorenz
This sounds a bit sarcastic, considering it's not by Microsoft:
[https://en.wikipedia.org/wiki/Full_Tilt!_Pinball](https://en.wikipedia.org/wiki/Full_Tilt!_Pinball)

------
m_sahaf
Oddly, no one here linked to Gary Bernhardt's talk: The Birth & Death of
JavaScript (YavaScript)

[1] [https://www.destroyallsoftware.com/talks/the-birth-and-
death...](https://www.destroyallsoftware.com/talks/the-birth-and-death-of-
javascript)

------
jeffmcmahan
It hung at the boot screen for me, which really took me back.

~~~
naikrovek
Disable your ad blocker.

~~~
jonathanstrange
Works fine for me with uBlock Origin enabled.

~~~
ehsankia
Took a few minutes on my Chromebook, but it eventually loaded.

------
ericfrederich
What a great nostalgic color. I think I'll change my Windows 10 desktop to it.

[http://www.colorhexa.com/3a6ea5](http://www.colorhexa.com/3a6ea5)

~~~
florinutz
better get rid of Windows10

~~~
marksomnian
Please don't reddit on HN.

~~~
axonic
Well put.

------
lxe
Fabrice Bellard's jsLinux and Jeff Parsons's
[https://www.pcjs.org/](https://www.pcjs.org/) are pretty fascinating.

I think Bellard uses emscripten (transpiled machine and device emulator code
from C to JS), while pcjs is hand-coded JS (which is neat:
[https://github.com/jeffpar/pcjs/blob/master/modules/pcx86/li...](https://github.com/jeffpar/pcjs/blob/master/modules/pcx86/lib/x86cpu.js)).

Also is the source for jslinux available anywhere? The emscriptified file at
[https://bellard.org/jslinux/x86emu.js](https://bellard.org/jslinux/x86emu.js)
is quite compex.

~~~
tbodt
It doesn't look like emscripten to me

~~~
duskwuff
Bellard wrote JSLinux in 2011, well before Emscripten was a thing.

------
3pt14159
How does it do wget, etc. without violating CORS? I was able to download from
a couple different websites.

~~~
s-macke
It uses a proxy. JSLinux emulates a network device and sends ethernet frames
to a proxy via websockets. The proxy sends these frames to a Linux TAP device.
The rest is a decent firewall configuration.

You might even be able to connect to another emulated JSLinux machine if you
know that IP address.

More information here:

[http://www.benjamincburns.com/2013/11/10/jor1k-ethmac-
suppor...](http://www.benjamincburns.com/2013/11/10/jor1k-ethmac-support.html)

------
singularity2001
ad blockers here translate nicely to boot errors: Boot failed: could not read
the boot disk ntoskrnl.exe missing or corrupt

------
NuSkooler
Any relation to [https://github.com/copy/v86](https://github.com/copy/v86)?

~~~
s-macke
These are 2 independent developers. However the emulators have some
technologies in common like the 9p virtio filesystem under Linux.

------
zapperdapper
Wow, that's impressive! I tried FreeDOS and it booted very quickly. Nice to
play around with DOS again - it's even got tab completion on the command line
these days - fancy!

p.s. By the way archive.org were doing something very similar. You could load
up a DOS box from their web site and have the old disk mags and demos running
in your browser. All very cool stuff!

------
ben174

        rm -rf / 
    

It just feels so wrong. I know it's doing exactly zero damage but I still feel
guilty running it.

------
iso-8859-1
Interesting with the VFSync site, nice to see some standardization on this. I
used to work on on-demand file systems in Emscripten, but it never worked
well, especially because you can't have binary XHR outside webworkers.

[https://github.com/kripken/emscripten/commit/e2046bb8ce2b2cc...](https://github.com/kripken/emscripten/commit/e2046bb8ce2b2ccaaca5328f21a79c6efe15f336)

But I don't understand, why is VFSync superior to something like NFS?

It seems that Bellard is trying to set up a hosting site for VFSync, so that
people can easily share images. I dreamt about having something like that,
combined with copy-on-write, which would make it possible to make small
changes to a big filesystem and share them, without having to upload the full
system. Kind of like with Docker. I wonder if that would be compatible with
the VFSync model.

------
1_800_UNICORN
I couldn't get the Windows 2000 VM to connect to the internet, otherwise I
wanted to try and get at least a 1-level recursive reference going... Windows
2000 running in Firefox running in Windows 2000 running in Chrome running on a
Macbook Pro.

If anyone has gotten Windows 2000 to connect to the internet, would love to
take a stab at it.

~~~
peonicles
I was a little disappointed to see there wasn't any internet connection on
Windows 2000.

All I wanted to do was to open Firefox, goto
[https://bellard.org/jslinux/](https://bellard.org/jslinux/) , and fire up the
Linux emulator ...

~~~
marpstar
I had working internet in IE5. You have to walk through the internet
connection setup for LAN, but it works.

------
veganjay
Cool stuff! GCC works - I thought it was broken, but it just takes a long
time.

[root@localhost tmp]# time gcc hello.c -o hello

real 0m 24.43s

user 0m 2.63s

sys 0m 2.17s

[root@localhost tmp]# ./hello

Hello, World!

~~~
ORioN63
TCC is faster. It's on the comments of hello.c

------
skytreader
Windows 2000 plays wonky with my keyboard. Any idea why?

For instance, I open Pinball and, after getting a new game with F2, pressing
space (to launch the ball) does nothing except open that menu that pops up
when you right click a window.

I open Notepad and I can't type words. If I press "o" it opens the "Format"
menu. Which strikes me as odd.

(But really, just let me play Pinball. :D)

~~~
wolfgang42
My psychic debugging skills tell me that the Alt key has gotten stuck down in
the emulated machine. Try focusing on the emulator and hitting Alt a couple of
times. (This can happen e.g. if you alt-tab away from the window: the emulator
sees alt-down, but the alt-up happens in another window and the key stays
stuck down in the emulator.)

~~~
skytreader
That sounds like a reasonable explanation, thank you. And it works!

Now behold all the work I will not be doing today. :v

~~~
wolfgang42
Yay, glad I could help!

------
jvandonsel
Is there a practical use case for this other than "ain't it cool"?

~~~
vanderZwan
Checking for bugs in Emscripten perhaps? A project as complex as an OS is
probably good for finding edge-cases.

~~~
mark-r
Doesn't this work by emulating the processor instruction set along with a few
key drivers? The complexity of the OS itself wouldn't be directly hitting the
emulator.

------
hzhou321
How do I install vim?

PS: It has git, but no network.

PS: Upload non-zipped tar balls works. How to access the image (downloading)?

PS: Well, it is way too slow and hangs easily. I guess it is only an interest
at this point.

~~~
0x0
Browsers won't let javascript that's running on a webpage access random TCP
ports, at the very least you'd need a server component that could act as an IP
proxy for you, perhaps tunneling over websockets.

------
faragon
Wow, now includes graphics!!! Fabrice Bellard is amazing.

------
akmittal
Is it using WebAssembly?

~~~
sp332
According to
[https://bellard.org/jslinux/tech.html](https://bellard.org/jslinux/tech.html)
it's using asm.js since 2015. But at the bottom of the page it mentions wasm,
so it's not clear.

~~~
n-gauge
I thought it's just a vm?

~~~
sp332
The virtual machine host itself has been compiled to asm.js (or maybe wasm)
and runs in the browser.

------
reboog711
Super slow, but pretty cool....

Finally I can play Solitaire without Ads again.

~~~
efreak
There's a way to get the old windows 7 games working in Windows 8/10, you can
find it on the winaero forums.

Personally I just have windows 3.1 installed under dosbox, as it gives me the
entire WEP and Crystal Caves. If you decide to do this, I recommend dosbox-x,
or other unofficial release, as official releases are old.

------
agumonkey
oh !

\- linux kernel 4.12

\- freedos image \- windows 2000 image (!!!)

and riscv32 emulation for the above listed

~~~
s-macke
Not sure about the true meaning of your comment. But if you search for a
32-Bit RISC-V emulator, you can find it here:

[http://s-macke.github.io/jor1k/demos/riscv.html](http://s-macke.github.io/jor1k/demos/riscv.html)

------
ljosa
Has anyone gotten uploading to FreeDOS to work?

------
plix71
One step closer to GNU Hurd hegemony!

------
jugg1es
Was windows 2000 open-sourced?

~~~
DoctorOW
No, see the disclaimer:
[https://bellard.org/jslinux/disclaimer.html](https://bellard.org/jslinux/disclaimer.html)

