News for hackers. Stuff that matters.

Run Linux in your Browser JSLinux (Update)

Have you noticed the update?

  - There is clipboard support (bi-directional)
  - It runs on Chromium 13
  - It runs on iPad!! 
    (If it does not take your input, set the focus to the
     clipboard edit box)
http://bellard.org/jslinux/

And as a side-note, Tom has ported JSLinux to node.js

https://groups.google.com/d/topic/nodejs/B0OUf_Bd15E/discussion

( 33 comments | 109 points | on HN )
Re:Run Linux in your Browser JSLinux (Update) by cstross on Sunday May 22, 2011 @07:55AM (#2573113)
I am a demanding luser. My javascript coding skills are non-existent, and I recognize that I'm asking for the moon on a stick here, and HN isn't the right place to make feature requests anyway.

But I'd love to see some extra features ...

What I'd like to see?

1. Support for loading and mounting additional read-only filesystem images embedded within the web page (presumably serialized and encoded in Base64 or something).

2. Support for a translucent FS, to allow writes to a ramdisk to show up on top of the aforementioned read-only FS images.

3. Support for writing out an updated copy of the JSLinux HTML file, with a saved copy of the read-only filesystem, including changes merged in from a translucent mount.

(In other words: you can edit files on a designated filesystem, then "save" the VM webpage and get a new copy of JSLinux with your edits added to the external filesystem so they're there next time you fire it up..)

4. For added fun (but arguably this is an entirely different requirement), I'd like to see a version of JSLinux merged with TiddlyWiki, so you'd have a combined TiddlyWiki (for documentation) with a virtual Linux environment (terminal only) embedded in it, and the ability to save changes.

You'd then have a single file containing (a) a hypertext documentation system and (b) a command line Linux environment.

I would ... well, "killing" is too strong a word; but I'd probably move into it for good, using vi and MultiMarkDown for book production and small-scale programming projects and TiddlyWiki to keep track of ideas and notes.

Re:Run Linux in your Browser JSLinux (Update) by tzury on Sunday May 22, 2011 @06:07AM (#2572993)
A complete list:

    added support for more browsers including Opera 11.11 and __Internet Explorer 9__
    reduced VM RAM size from 32 MB to 16 MB.
    Source code release of the Linux starter utility.
    added a clipboard to exchange data between the VM and the host
    added FAQ and News pages
    fixed monospace font for some browsers.
    fixed binary XHR for Firefox nightly builds
    fixed terminal height for the less command
    fixed ampersand output in the terminal.
Re:Run Linux in your Browser JSLinux (Update) by antirez on Sunday May 22, 2011 @06:04AM (#2572986)
This running on the iPad is the win of the hacking, curiosity and intelligence over the closeness. As without any good reason (IMHO) such a project would never be approved as an app by Apple.
Re:Run Linux in your Browser JSLinux (Update) by js4all on Sunday May 22, 2011 @06:12AM (#2573000)
I felt the same seeing this running on the iPad. Fantastic.
Re:Run Linux in your Browser JSLinux (Update) by arzvi on Sunday May 22, 2011 @09:10AM (#2573187)
I have a feeling the 'Fruit's hands are going to stretch and block this app by some idiotic reasoning. If they can claim 'app store' they can do anything. urgh..
Re:Run Linux in your Browser JSLinux (Update) by chmike on Sunday May 22, 2011 @06:21AM (#2573012)
Re:Run Linux in your Browser JSLinux (Update) by NSMeta on Sunday May 22, 2011 @06:07AM (#2572992)
It still doesn't work on my Chrome v13.0.767.1 dev on OSX. Nevertheless, I'm glad to see the project is moving fast forward.
Re:Run Linux in your Browser JSLinux (Update) by beaumartinez on Sunday May 22, 2011 @06:14AM (#2573001)
Neither does it on Chrome 13.0.767.1 (Official Build 85531) dev Linux (much like the previous version; it gets stuck on "Freeing unused kernel memory").
Re:Run Linux in your Browser JSLinux (Update) by darklajid on Sunday May 22, 2011 @07:27AM (#2573079)
Re:Run Linux in your Browser JSLinux (Update) by dexen on Sunday May 22, 2011 @06:49AM (#2573036)
Neither on Konqueror 4.5.5 -- hangs, then crashes the browser after a while. I wonder if 4.6.3 (current) is any better.
Re:Run Linux in your Browser JSLinux (Update) by axman6 on Sunday May 22, 2011 @07:57AM (#2573116)
Seems to work fine in Safari however.
Re:Run Linux in your Browser JSLinux (Update) by Typhon on Sunday May 22, 2011 @05:35AM (#2572963)
It still doesn't make coffee, but I expect it won't be long now. My mind is still blown.
Re:Run Linux in your Browser JSLinux (Update) by argy on Sunday May 22, 2011 @06:19AM (#2573007)
It works on Android stock browser (Nexus One with Gingerbread), but it's very slow, especially on boot.
Re:Run Linux in your Browser JSLinux (Update) by rimantas on Sunday May 22, 2011 @07:47AM (#2573103)
I've tried to compile http://bellard.org/mersenne.html, alas not enough memory. Pity, that would be full win.
Re:Run Linux in your Browser JSLinux (Update) by martinrame on Sunday May 22, 2011 @10:51AM (#2573363)
Amazing, this guy is impressive.

BTW. It would be really nice to include an SSH client to JSLinux.

Re:Run Linux in your Browser JSLinux (Update) by NatW on Sunday May 22, 2011 @01:52PM (#2573772)
I agree with you, however.. you'll notice that it currently only has a loopback device (try "ifconfig"). It would help if there were network adapters, first :).
Re:Run Linux in your Browser JSLinux (Update) by balakk on Sunday May 22, 2011 @10:28AM (#2573312)
In Opera 11.11, I seem to get a max of 8 instances going, but not more. Is there a technical limitation, or a deliberate restriction?

Memory seems to be OK, the browser is just past a Gig. Although this is a 32-bit OS, I don't see a memory issue.

Re:Run Linux in your Browser JSLinux (Update) by sp332 on Sunday May 22, 2011 @10:57PM (#2574846)
Virtual memory usage might be at 2 gigs?
[deleted]
Re:Run Linux in your Browser JSLinux (Update) by eliben on Sunday May 22, 2011 @06:26AM (#2573015)
Interesting how many different interpretations the same phrase have in different languages. In Hebrew, "turning green" means being jealous.
Re:Run Linux in your Browser JSLinux (Update) by chmike on Sunday May 22, 2011 @06:29AM (#2573017)
Sorry, I mistakenly deleted my comment. Here it is.

"... Linux on the iPad ? This is becoming really interesting. I bet Steve Jobs is turning green now... (French expression meaning it makes him sick, not vegetarian... !).

Edit: just tried it on my iPad and it doesn't work. ..." Edit2: retried it once more and now it is booting ! Sad that network is not reachable (ping 8.8.8.8 failed).

Re:Run Linux in your Browser JSLinux (Update) by blasdel on Tuesday May 31, 2011 @04:11PM (#2604273)
In American English "turning green" means to become envious
Re:Run Linux in your Browser JSLinux (Update) by cstrouse on Monday May 23, 2011 @03:57PM (#2577333)
Works great on Chrome 11.0.696.68 running on OS X 10.6.7. I'll be keeping an eye on this project. Great work.
Re:Run Linux in your Browser JSLinux (Update) by sebastianavina on Sunday May 22, 2011 @02:49PM (#2573920)
Damn, that page (bellard.org) is full of awesomeness... Pardon for my ignorance, but who is this guy?
Re:Run Linux in your Browser JSLinux (Update) by mahrain on Sunday May 22, 2011 @06:01AM (#2572983)
In addition to running on iPad, it also runs on Safari (5.0.5, snow leopard) now.
Re:Run Linux in your Browser JSLinux (Update) by eslaught on Sunday May 22, 2011 @06:45PM (#2574466)
Where's gcc? ;-)
Re:Run Linux in your Browser JSLinux (Update) by glimpse_c on Monday May 23, 2011 @07:41AM (#2575633)
no gcc but you can use tcc which is developed by Fabrice Bellard too :) http://en.wikipedia.org/wiki/Tiny_C_Compiler
Re:Run Linux in your Browser JSLinux (Update) by DrCatbox on Sunday May 22, 2011 @08:57AM (#2573172)
Whats the point of this? Is it useful?
Re:Run Linux in your Browser JSLinux (Update) by sp332 on Sunday May 22, 2011 @09:17AM (#2573197)
Why don't you try doing something cool with it and let us know?
Re:Run Linux in your Browser JSLinux (Update) by KonradKlause on Sunday May 22, 2011 @05:41AM (#2572967)
I'm wondering when he releases the clipboard source code. On the kernel side it's a custom character device. Currently he is violating the GPL. :-(
Re:Run Linux in your Browser JSLinux (Update) by steevdave on Sunday May 22, 2011 @06:26AM (#2573014)
Actually he isn't violating the GPL. The GPL states that you have to make it available when requested, and as a mechanism of your choosing. It doesn't say you have to put the source code on the web so that others can access it easily.

I'm tired of people screaming GPL violation because the source code isn't posted online for their perusal.

Edit to add:

Also of note, in the tarball that he provides is the patch to the Linux 2.6.20 sources that he uses. Which... is the sources for the clipboard. Did you even look to see if the sources were available?

Deleting the comment that this was in (the new iPhone app doesn't let me edit my comment unless I missed something)

Re:Run Linux in your Browser JSLinux (Update) by KonradKlause on Sunday May 22, 2011 @07:33AM (#2573087)
Ick, you’re right. I've looked at the tarball one or two days ago, and there was no source for the clipboard.
Re:Run Linux in your Browser JSLinux (Update) by js4all on Sunday May 22, 2011 @06:09AM (#2572995)
He released the linux starter (BIOS) though. There is still hope. BTW. the starter contains assembler code. It is amazing to see this running in the browser.
Re:Run Linux in your Browser JSLinux (Update) by elliottcarlson on Sunday May 22, 2011 @10:19AM (#2573290)
Not really (and please hear me out!). The last thread had a few amazed commenter's remarking that they were surprised that there was a C compiler, or that they could do various things within it. The amazing part is that an x86 emulator was made that could start up a linux image - everything else is kind of obvious that it should work at that point since the x86 emulator was written so well.

So the amazing part is the emulator - everything else including the assembly etc should just work because well - it's supposed to!