\

JSLinux Now Supports x86_64

210 points - today at 4:43 PM

Source
  • simonw

    today at 7:27 PM

    The thing I most want to use this (or some other WASM Linux engine) for is running a coding agent against a virtual operating system directly in my browser.

    Claude Code / Codex CLI / etc are all great because they know how to drive Bash and other Linux tools.

    The browser is probably the best sandbox we have. Being able to run an agent loop against a WebAssembly Linux would be a very cool trick.

    I had a play with v86 a few months ago but didn't quite get to the point where I hooked up the agent to it - here's my WIP: https://tools.simonwillison.net/v86 - it has a text input you can use to send commands to the Linux machine, which is pretty much what you'd need to wire in an agent too.

    In that demo try running "cat test.lua" and then "lua test.lua".

      • the_mitsuhiko

        today at 8:42 PM

        > The thing I most want to use this (or some other WASM Linux engine) for is running a coding agent against a virtual operating system directly in my browser.

        That exists: https://github.com/container2wasm/container2wasm

        Unfortunately I found the performance to be enough of an issue that I did not look much further into it.

        • jraph

          today at 8:24 PM

          Simon, this HN post didn't need to be about Gen AI.

          This thing is really inescapable those days.

            • simonw

              today at 8:28 PM

              Parallel thread: https://news.ycombinator.com/item?id=47311484#47312829 - "I've always been fascinated by this, but I have never known what it would be useful for."

              I should have replied there instead, my mistake.

                • stavros

                  today at 11:03 PM

                  I don't know man, I didn't see anyone say "this post didn't need to be about <random topic>", HN has just become allergic to LLMs lately.

                  I'm excited about them and I think discussion on how to combine two exciting technologies are exactly what I'd like to see here.

                  • darig

                    today at 10:38 PM

                    [dead]

            • d_philla

              today at 8:53 PM

              Check out Jeff Lindsay's Apptron (https://github.com/tractordev/apptron), comes very close to this, and is some great tech all on its own.

                • progrium

                  today at 9:31 PM

                  It's getting there. Among other things, it's probably the quickest way to author a Linux environment to embed on the web: https://www.youtube.com/watch?v=aGOHvWArOOE

                  Apptron uses v86 because its fast. Would love it for somebody to add 64-bit support to v86. However, Apptron is not tied to v86. We could add Bochs like c2w or even JSLinux for 64-bit, I just don't think it will be fast enough to be useful for most.

                  Apptron is built on Wanix, which is sort of like a Plan9-inspired ... micro hypervisor? Looking forward to a future where it ties different environments/OS's together. https://www.youtube.com/watch?v=kGBeT8lwbo0

              • kantord

                today at 10:37 PM

                This is not the technical solution you want, but I think it provides the result that you want: https://github.com/devcontainers

                tldr; devcontainers let you completely containerize your development environment. You can run them on Linux natively, or you can run them on rented computers (there are some providers, such as GitHub Codespaces) or you can also run them in a VM (which is what you will be stuck with on a Mac anyways - but reportedly performance is still great).

                All CLI dev tools (including things like Neovim) work out of the box, but also many/most GUI IDEs support working with devcontainers (in this case, the GUI is usually not containerized, or at least does not live in the same container. Although on Linux you can do that also with Flatpak. And for instance GitHub Codespaces runs a VsCode fully in the browser for you which is another way to sandbox it on both ends).

                  • stavros

                    today at 10:52 PM

                    This is interesting (and I've seen it mentioned in some editors), but how do I use it? It would be great if it had bubblewrap support, so I don't have to use Docker.

                    Do you know if there's a cli or something that would make this easier? The GitHub org seems to be more focused on the spec.

                • apignotti

                  today at 8:27 PM

                  We are working on exactly this: https://browserpod.io

                  For a full-stack demo see: https://vitedemo.browserpod.io/

                  To get an idea of our previous work: https://webvm.io

                  • bakugo

                    today at 10:51 PM

                    Can I PLEASE click on ONE post on the front page of HN without immediately being met by some grifter trying to derail it to promote their AI product?

                    Please? I'm begging here.

                • blackhaz

                  today at 7:08 PM

                  Sorry for the off-topic, but what a bliss to see Windows 2000 interface. And what an absolute abomination from hell pretty much all the modern UIs are.

                    • stavros

                      today at 10:55 PM

                      My god that interface feels like home.

                      • diabllicseagull

                        today at 10:32 PM

                        win2000 brings back so many good memories.

                        • shevy-java

                          today at 8:05 PM

                          Yeah. Microsoft really went downhill UI-wise.

                          • cheema33

                            today at 8:09 PM

                            Is that even remotely relevant to JSLinux?

                              • nout

                                today at 8:16 PM

                                Yes, it's one of the available emulated systems on JSLinux.

                                • dmd

                                  today at 9:20 PM

                                  If you'd clicked the link, instead of just reading the title, you'd have known it was.

                          • maxloh

                            today at 6:06 PM

                            Unfortunately, he didn't attach the source code for the 64-bit x86 emulation layer, or the config used to compile the hosted image.

                            For a more open-source version, check out container2wasm (which supports x86_64, riscv64, and AArch64 architectures): https://github.com/container2wasm/container2wasm

                              • zamadatix

                                today at 6:19 PM

                                https://github.com/copy/v86 might be a more 1:1 fully open sourced alternative.

                                  • maxloh

                                    today at 6:25 PM

                                    Not really. x86_64 is not supported yet: https://github.com/copy/v86/issues/133

                                      • zamadatix

                                        today at 9:00 PM

                                        Sure, and there are probably some other things lacking, but JSLinux supports a lot more than CLI Linux userspace on x86-64 too. E.g. compare to lack of graphical interface https://github.com/container2wasm/container2wasm/issues/196

                                        It looks like container2wasm uses a forked version of Bochs to get the x86-64 kernel emulation to work. If one pulled that out separately and patched it a bit more to have the remaining feature support it'd probably be the closest overall. Of course one could say the same about patching anything with enough enthusiasm :).

                                        • today at 8:31 PM

                                          • today at 8:27 PM

                                • stjo

                                  today at 10:35 PM

                                  I love how nonchalantly demonstrates his custom terminal emulator and javascript engine.

                                  • AlecMurphy

                                    today at 8:10 PM

                                    If anyone is interested, I made some modifications last month to get TempleOS running on the x86_64 JSLinux: https://ring0.holyc.xyz/

                                  • notorandit

                                    today at 6:36 PM

                                    Incredible guy!

                                    • wolttam

                                      today at 6:32 PM

                                      I can launch this thing and start making arbitrary connections out to port 25 on the internet from some random IP? Hmm.

                                        • maxloh

                                          today at 6:37 PM

                                          From the "Technical notes" page:

                                          > Access to Internet is possible inside the emulator. It uses the websocket VPN offered by Benjamin Burns (see his blog). The bandwidth is capped to 40 kB/s and at most two connections are allowed per public IP address. Please don't abuse the service.

                                          https://bellard.org/jslinux/tech.html

                                          • today at 6:36 PM

                                        • petcat

                                          today at 6:02 PM

                                          I've always been fascinated by this, but I have never known what it would be useful for. Does anyone know of any practical use cases?

                                            • shirro

                                              today at 10:13 PM

                                              We are a playful species. People enjoy play. If we didn't have to work for a living but still enjoyed food security that is all most of us would do. But we are also a very exploitative species, some more than others. Companies have made billions of dollars on top of Fabrice Bellard's works, qemu, ffmpeg etc.

                                              These companies don't have any imagination. Their management has no vision. They could not create anything new and wonderful if they tried. People like Fabrice do and we are all richer for it. If your asking about the practical use you are likely in the exploitative mindset which is understandable on HN. The hacker/geek mindset enjoys this for what it is.

                                              • omoikane

                                                today at 6:15 PM

                                                I use bellard.org/jslinux to test compilation of strange code sometimes[1], since it came with compilers that are different versions from what I have installed locally, and it's easier to open up a browser than starting a VM.

                                                [1] For example:

                                                https://www.ioccc.org/2020/yang/index.html#:~:text=tcc%200.9...

                                                https://www.ioccc.org/2018/yang/index.html#:~:text=tcc%200.9...

                                                • toast0

                                                  today at 6:35 PM

                                                  I use a similar emulator (v86) as a way to share my hobby OS. Approximately zero people, even my friends, are going to boot my hobby OS on real hardware; I did manage to convince some of them to run it in qemu, but it's difficult. A browser environment shows the thing quite well; and easy networking is cool too.

                                                  My hobby OS itself is not very useful, but it's fun if you're in the right mood.

                                                  • postalrat

                                                    today at 9:17 PM

                                                    Some sort of web based archive of applications/etc where you can boot them up in your browser.

                                                      • peterburkimsher

                                                        today at 9:39 PM

                                                        That’s what I’d like to use it for as well, but it’s difficult to do so because there’s no way to edit the disk image.

                                                        Any advice on how to create a JSLinux clone with a specific file pre-installed and auto-launching would be much appreciated!

                                                          • progrium

                                                            today at 10:50 PM

                                                            Working with VMs always felt difficult because of this. So authoring was built-in to Docker. Now you can use Apptron to author and embed a Linux system on a web page. This aspect is usable, but it's only going to get better.

                                                    • s-macke

                                                      today at 6:19 PM

                                                      Most such emulators have Internet access on the IP level. Therefore, this is a very cheap way to test anything on the Internet.

                                                          apk add nmap
                                                          nmap your.domain.com
                                                      
                                                      However, the speed is heavily throttled. You can even use ssh and login to your own server.

                                                      It can also be used as a very cheap way to provide a complete build environment on a single website, for example to teach C/C++. Or to learn the shell. You don't have to install anything.

                                                        • Onavo

                                                          today at 10:06 PM

                                                          You need backend proxies, the browser doesn't allow ignoring CORS by default.

                                                      • redleader55

                                                        today at 7:05 PM

                                                        Agentic workloads create and then run code. You don't want to just run that code in a "normal" environment like a container, or even a very well protected VM. There are other options, ofc - eg. gvisor, crossvm, firecracker, etc, but this one is uncommon enough to have a small number of attackers trying to hack it.

                                                          • srdjanr

                                                            today at 7:45 PM

                                                            What's wrong with a well protected VM? Especially compared to something where the security selling point is "no one uses it" (according to your argument; I don't know how secure this actually is)

                                                              • g947o

                                                                today at 8:51 PM

                                                                Nothing, but "there are already working options" does not necessarily mean we shouldn't try new (and sometimes weird) things

                                                                  • cloudfudge

                                                                    today at 10:44 PM

                                                                    GP says "You don't want to just run that code in ... even a very well protected VM." Why?

                                                                    • TacticalCoder

                                                                      today at 10:40 PM

                                                                      Yeah but GP was answering to a comment saying "you don't want to run code in a well protected VM". Which is of course complete non sense to say and GP was right to question it.

                                                          • varun_ch

                                                            today at 6:10 PM

                                                            Maybe if you’ve got some ancient software that’s missing source code and only runs with X Y and Z conditions, you could continue to offer it on the web and build around it like that? Not sure if that would be practical at all, but could be interesting

                                                            • maxloh

                                                              today at 6:12 PM

                                                              My college professor used it to teach us the Linux command line

                                                              We have Windows PCs in the classroom.

                                                                • jgtrosh

                                                                  today at 9:33 PM

                                                                  Similarly I've used it for technical interviews.

                                                          • westurner

                                                            today at 7:00 PM

                                                            How do TinyEmu and JSLinux compare to linux-wasm?

                                                            From "Show HN: Amla Sandbox – WASM bash shell sandbox for AI agents" (2026) https://news.ycombinator.com/item?id=46825119 :

                                                            >>> How to run vscode-container-wasm-gcc-example with c2w, with joelseverin/linux-wasm?

                                                            >> linux-wasm is apparently faster than c2w

                                                            From "Ghostty compiled to WASM with xterm.js API compatibility" https://news.ycombinator.com/item?id=46118267 :

                                                            > From joelseverin/linux-wasm: https://github.com/joelseverin/linux-wasm :

                                                            >> Hint: Wasm lacks an MMU, meaning that Linux needs to be built in a NOMMU configuration

                                                            From https://news.ycombinator.com/item?id=46229385 :

                                                            >> There's a pypi:SystemdUnitParser.

                                                            • shevy-java

                                                              today at 8:05 PM

                                                              He builds epicness.

                                                              • westurner

                                                                today at 7:04 PM

                                                                UBY: touchscreen: How to scroll the scrollback

                                                                • jccx70

                                                                  today at 9:55 PM

                                                                  [dead]

                                                                  • jccx70

                                                                    today at 9:51 PM

                                                                    [dead]