6 ms·
WebVM 2.0: A complete Linux Desktop Environment in the browser via WebAssembly
- apignotti 2y agoHello HN! Lead dev of WebVM and CTO of Leaning Technologies here. Happy to answer any question.
- ranguna 2y agoAmazing work! How's performance? Can I run any distros on WebVM?
- apignotti 2y agoPerformance is expected to be between 3x-10x slowdown depending on the workload, which for this class of systems is quite good. The gap, especially on the high end, will further shrink as the virtualization engine improves. Not all parts of the ISA are as well optimized currently. The codegen for integer operations (the most common by far) is very sophisticated. Floating point and vector operations still have a pretty basic implementation. WebVM can run any distro, barring bugs in our syscall layer of course :-) You can add your own Dockerfile and deploy a custom version on GitHub: https://github.com/leaningtech/webvm/?tab=readme-ov-file#fork-deploy-customize https://github.com/leaningtech/webvm/?tab=readme-ov-file#for...
- ranguna 2y agoNice, thanks for the info!
- nxobject 2y agoI’m glad that y’all are collaborating with GOG to get games running in the browser - I hope being able to ship fully emulated environments helps give some older games, that might have compatibility issues, a larger audience! Do you have any other industries in mind that you think might be interested in CheerpX?
- apignotti 2y agoI want to clarify that we are not officially collaborating with GOG at this time, although we would love to do so. We think CheerpX would be very useful in education, to provide ready-made environments for students that can be wiped out on demand. We also envision it to be an alternative to remote virtualization (e.g. Citrix) in the enterprise sector.
- ezequiel-garzon 2y agoThis looks amazing, congratulations! I can see that it seems to run offline (curl says "# requires networking"), but if I launch it on airplane mode on an iPhone it halts. Is this the expected behavior? Also, is it possible to install packages? These two things could address some of the shortcomings of iSH. Thanks!!
- apignotti 2y agoThe disk blocks are streamed on demand, so a connection is required. The virtual disk is quite large (1.5GB) which is necessary to run a full distro but makes pre-downloading for offline mode not possible. It _could_ work if you let your workload run once and then disconnect, but there is no guarantee. Installing packages is supported both in the Debian terminal and Alpine desktop.
- modeless 2y agoIt is certainly possible to download and store 1.5 GB in browsers these days.
- a2code 2y agoWhat are some other applications of WebAssembly that you find promising?
- apignotti 2y agoThe promise of WebAssembly is bringing actual large scale applications to the browser. To be clear, it is possible to build large apps with technologies like TypeScript, with VSCode being probably the standard bearer of this approach, but at Leaning Technologies we don't believe this solution to be viable for everybody. We strongly believe that more "traditional" languages are required instead to work at scale, especially C++ and Java, and we offer products dedicated to these languages as well: Cheerp and CheerpJ respectively. Although these languages might not be the most exciting ones, they have a proven track record for delivering large scale applications used by millions of people. Billions of people if the Operating Systems we all use are taken into account. Thanks to WebAssembly these robust and scalable languages can be used to build Web apps. My own personal metric for the success of WebAssembly is seeing AAA games delivering playable demos as Web apps by cross-compiling (a portion of) the game to the browser.
- aidanhs 2y agoAll the emulation of desktop machines in WASM I've seen so far have been for x86 - do you think there are significant additional hurdles for x86_64? Or is it just a matter of time? Separately, one bit of feedback - it's cool that webvm is open source, but I think it's fair to ask you to be upfront that cheerpx itself is not (which is fine!) in the blog post itself where you talk about webvm licensing. If I wasn't already familiar with the wasm emulation space I would have felt rather misled.
- apignotti 2y agoI cannot speak for other VMs, in the case of CheerpX there is nothing fundamental preventing emulation/JIT-ting of 64-bit platforms, but it is an inefficient choice due to the current limitations of Wasm, in particular on the front of how much memory can be used in total. In the best case scenario it would be 4GB, but it's unlikely this can be achieved on all devices in the real world. 64-bit code by its nature consume more memory, each pointer is twice the size, which makes the memory limitation even more pressing for no advantage. Please note, that this is unrelated to the work on WebAssembly Memory64. The issue is not the lack of address space, but rather on the actual memory that can be allocated in practice. For this public deployment of WebVM we have chosen to limit the maximum memory to 700MBs, which makes the demo work fine on the vast majority of devices, including mobile ones. This said, we do plan to support the 64-bit ISA in the future with the main use case of supporting all the existing docker images available on Docker Hub and similar platforms. Appreciate your feedback on licensing and we will take it into account, but please notice that this article is specifically about WebVM, that is indeed FOSS. A separate article dedicated to the CheerpX 1.0 release will be published soon, and it will of course be very clear that the latter is proprietary.
- aidanhs 2y agoInteresting, that's helpful, thanks - so with the eventual arrival of memory64 and assuming I only wanted to target desktop systems and assuming browser implementations permit large allocations (e.g. 8GB) - large 64bit apps could work fine. I have a use case for this I've been poking at for a bit, but implementing my own version of cheerpx would be a lot of work, maybe I'll just wait! On open source - I can only give you feedback as an outside fresh pair of eyes :) I incorrectly interpreted that it was full stack OSS based on the overall blog post 'vibe' and had to deliberately double check because I was aware of cheerpx beforehand. Perhaps it's just me. I look forward to the cheerpx blog post!
- znpy 2y agowe've made it full circle ?
- sharpshadow 2y agoCan it run WebVM inside WebVM?
- znpy 2y agoit would seem that yes, you can? If you can run an (allegedly) complete linux desktop environments that implies you can also run google chrome or firefox, and hence run WebVM.
- mamidon 2y agoSounds like cool tech, but why would I want to run Linux in my browser? What use cases does this enable? Thanks
- amelius 2y agoMaybe to quickly try out new things? Or to run software that you'd rather not install?
- ranguna 2y agoHaving full blown Linux on my mobile phone would be great.
- diegocg 2y agoIf only there was a mobile operating system based on the Linux kernel
- grougnax 2y agoBecause everything should be in the browser now. The actual question would be "why would you want to run something out of the browser?"
- diegocg 2y agoThis is obviously sarcastic, because I don't think there is anyone out there who still believes the old fantasy about browsers/JS becoming the "universal platform"?
- James_K 2y agoSurely it already is a universal platform. Almost all major software runs on the web / electron.
- ChocolateGod 2y agoSo I can control it's deployment, updates and not be at mercy if the website shuts down.
- smusamashah 2y agoSome other VMs that run in browser https://copy.sh/v86/ https://copy.sh/v86/ https://bellard.org/jslinux/ https://bellard.org/jslinux/ https://jamesfriend.com.au/pce-js/ https://jamesfriend.com.au/pce-js/ (https://github.com/jsdf/pce https://github.com/jsdf/pce) https://www.pcjs.org/ https://www.pcjs.org/ (lots of hardware and OSes) (https://github.com/jeffpar/pcjs https://github.com/jeffpar/pcjs) https://infinitemac.org/ https://infinitemac.org/ (https://blog.persistent.info/2023/03/infinitemac-dot-org.html https://blog.persistent.info/2023/03/infinitemac-dot-org.htm...) https://jamesfriend.com.au/projects/basiliskii/BasiliskII-worker.html https://jamesfriend.com.au/projects/basiliskii/BasiliskII-wo... https://jamesfriend.com.au/pce-js/pce-js-apps/ https://jamesfriend.com.au/pce-js/pce-js-apps/
- apignotti 2y agoWhat makes WebVM (and CheerpX, the underlying virtualization engine) different is the level of performance that we have achieved. Although CheerpX is not yet perfect and additional optimizations are required on its floating point and vector pipelines, it's already fast enough to be practically useful on many use cases, especially when legacy/older binaries are virtualized.
- niutech 2y agoWhich WASM features does CheerpX use? GC, BMO, Branch Hinting, Relaxed SIMD, Threads, Memory64?
- apignotti 2y agoCheerpX uses SharedArrayBuffer, which is associated to threads, and can optionally use Branch Hinting if available. The latter is fully standardized, but not yet enabled by default in Chrome.
- anonymous344 2y agodoes the curl command work from inside that?
- yuri91 2y agoit does if you log in with Tailscale (networking tab in the side bar). The terminal-based https://webvm.io https://webvm.io has it pre-installed but the graphical demo running Alpine does not. Luckily, the package manager also works so you can install it with `apk add curl`
- benob 2y agoFirefox support is not great. Typing through the terminal eats some keystrokes.
- apignotti 2y agoThanks for reporting this, the approach to keyboard input is quite convoluted to integrate mobile input well. No "keydown"/"keyup" events on mobile. Any specific key or character that is not working for you? Or this is a widespread problem?
- Jemm 2y agoAlso having trouble typing in terminal using firefox. Seems like keys are doubled or missing. I gave up after ten attempts to ping cnn.com
- haspok 2y ago+1 Simply typing `ls -la` + Enter in the terminal window was a significant challenge, even if I typed slowly. And then I had to press Enter about 5 times until it registered it.
- usemycomputer 2y agoI clicked and see the operating system screen, but how can I use a console?, there are only ads at the sides.
- singularity2001 2y agoapp -> terminal
- apignotti 2y agoI am not sure what 'ads' you are referring to, we don't have ads anywhere on our websites and demos. Anyway, click on the "Apps" button on the top menu, then click on "Terminal". An xterm session will open for you. You could be interested in the terminal-only version of WebVM, based on Debian: https://webvm.io https://webvm.io
- deleted 2y ago[deleted]
- sharpshadow 2y agoCan one not run a VPN locally instead of using the service?
- ycombinatrix 2y agoDo you have another VPN service in mind that allows websocket connections?
- sharpshadow 2y agoWould it not be feasible to run a VPN/Proxy locally on the same machine but not in the browser and websocket the connection to WebVM? I don’t mean that WebVM should implement it, just asking if that would be an option if one doesn’t want to use the VPN service to connect to the internet.
- ycombinatrix 2y agoJust change the tailscale IP to 127.0.0.1? Maybe I'm missing something.