forked from leaningtech/webvm
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'leaningtech:main' into main
- Loading branch information
Showing
47 changed files
with
4,447 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
version: 2.1 | ||
|
||
jobs: | ||
deploy: | ||
docker: | ||
- image: cimg/node:22.9 | ||
resource_class: medium | ||
steps: | ||
- add_ssh_keys: | ||
fingerprints: | ||
- "86:3b:c9:a6:d1:b9:a8:dc:0e:00:db:99:8d:19:c4:3e" | ||
- run: | ||
name: Add known hosts | ||
command: | | ||
mkdir -p ~/.ssh | ||
echo $GH_HOST >> ~/.ssh/known_hosts | ||
echo $RPM_HOST >> ~/.ssh/known_hosts | ||
- run: | ||
name: Install NPM | ||
command: | | ||
sudo apt-get update && sudo apt-get install -y rsync npm | ||
- run: | ||
name: Clone WebVM | ||
command: | | ||
git clone --branch $CIRCLE_BRANCH --single-branch [email protected]:leaningtech/webvm.git | ||
- run: | ||
name: Build WebVM | ||
command: | | ||
cd webvm/ | ||
npm install | ||
npm run build | ||
- run: | ||
name: Deploy webvm | ||
command: | | ||
rsync -avz -e "ssh -p ${SSH_PORT}" webvm/build/ leaningtech@${SSH_HOST}:/srv/web/webvm/ | ||
workflows: | ||
deploy: | ||
when: | ||
equal: [ << pipeline.trigger_source >>, "api" ] | ||
jobs: | ||
- deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
engine-strict=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,16 +5,20 @@ | |
|
||
This repository hosts the source code for [https://webvm.io](https://webvm.io), a Linux virtual machine that runs in your browser. | ||
|
||
<img src="assets/welcome_to_WebVM_slim.png" width="95%"> | ||
<img src="/assets/welcome_to_WebVM_2024.png" width="70%"> | ||
|
||
WebVM is a server-less virtual environment running fully client-side in HTML5/WebAssembly. It's designed to be Linux ABI-compatible. It runs an unmodified Debian distribution including many native development toolchains. | ||
|
||
WebVM is powered by the CheerpX virtualization engine, and enables safe, sandboxed client-side execution of x86 binaries on any browser. CheerpX includes an x86-to-WebAssembly JIT compiler, a virtual block-based file system, and a Linux syscall emulator. | ||
|
||
# Enable networking | ||
|
||
- Click "Connect via Tailscale" in the page header. | ||
- Log in to Tailscale (create an account if you don't have one). | ||
Modern browsers do not provide APIs to directly use TCP or UDP. WebVM provides networking support by integrating with Tailscale, a VPN network that supports WebSockets as a transport layer. | ||
|
||
- Open the "Networking" panel from the side-bar | ||
- Click "Connect to Tailscale" from the panel | ||
- Log in to Tailscale (create an account if you don't have one) | ||
- Click "Connect" when prompted by Tailscale | ||
- If you are unfamiliar with Tailscale or would like additional information see [WebVM and Tailscale](/docs/Tailscale.md). | ||
|
||
# Fork, deploy, customize | ||
|
@@ -26,6 +30,7 @@ WebVM is powered by the CheerpX virtualization engine, and enables safe, sandbox | |
- Click on `Settings`. | ||
- Go to the `Pages` section. | ||
- Select `Github Actions` as the source. | ||
- If you are using a custom domain, ensure `Enforce HTTPS` is enabled. | ||
- Run the workflow. | ||
- Click on `Actions`. | ||
- Accept the prompt. This is required only once to enable Actions for your fork. | ||
|
@@ -42,15 +47,18 @@ You can now customize `dockerfiles/debian_mini` to suits your needs, or make a n | |
|
||
From a local `git clone` | ||
|
||
- Download the `debian_mini` Ext2 image from [https://github.com/leaningtech/webvm/releases/](https://github.com/leaningtech/webvm/releases/). | ||
- You can also build your own by selecting the "Upload GitHub release" workflow option. | ||
- Place the image in the repository root folder. | ||
- Edit `index.html`. | ||
- Uncomment the default values for `CMD`, `ARGS`, `ENV` and `CWD`. | ||
- Replace `DEVICE_TYPE` with `"bytes"`. | ||
- Replace `IMAGE_URL` with the name of the Ext2 image. For example `"debian_mini_20230519_5022088024.ext2"`. | ||
- Start a local HTTP server. | ||
- Enjoy your local WebVM. | ||
- Download the `debian_mini` Ext2 image from [https://github.com/leaningtech/webvm/releases/](https://github.com/leaningtech/webvm/releases/) | ||
- You can also build your own by selecting the "Upload GitHub release" workflow option | ||
- Place the image in the repository root folder | ||
- Edit `config_github_terminal.js` | ||
- Uncomment the default values for `CMD`, `ARGS`, `ENV` and `CWD` | ||
- Replace `IMAGE_URL` with the URL (absolute or relative) for the Ext2 image. For example `"/debian_mini_20230519_5022088024.ext2"` | ||
- Build WebVM using `npm`, output will be placed in the `build` directory | ||
- `npm install` | ||
- `npm run build` | ||
- Start NGINX, it automatically points to the `build` directory just created | ||
- `nginx -p . -c nginx.conf` | ||
- Visit `http://127.0.0.1:8081` and enjoy your local WebVM | ||
|
||
# Example customization: Python3 REPL | ||
|
||
|
@@ -84,25 +92,27 @@ Or come to say hello / share your feedback on [Discord](https://discord.gg/yTNZg | |
|
||
# Thanks to... | ||
This project depends on: | ||
- [CheerpX](https://labs.leaningtech.com/cheerpx), made by [Leaning Technologies](https://leaningtech.com) for x86 virtualization and Linux emulation | ||
- [CheerpX](https://cheerpx.io/), made by [Leaning Technologies](https://leaningtech.com/) for x86 virtualization and Linux emulation | ||
- xterm.js, [https://xtermjs.org/](https://xtermjs.org/), for providing the Web-based terminal emulator | ||
- [Tailscale](https://tailscale.com/), for the networking component | ||
- [lwIP](https://savannah.nongnu.org/projects/lwip/), for the TCP/IP stack, compiled for the Web via [Cheerp](https://github.com/leaningtech/cheerp-meta) | ||
- [lwIP](https://savannah.nongnu.org/projects/lwip/), for the TCP/IP stack, compiled for the Web via [Cheerp](https://github.com/leaningtech/cheerp-meta/) | ||
|
||
# Versioning | ||
|
||
WebVM depends on the CheerpX x86-to-WebAssembly virtualization technology. A link to the current latest build is always available at [https://cheerpxdemos.leaningtech.com/publicdeploy/LATEST.txt](https://cheerpxdemos.leaningtech.com/publicdeploy/LATEST.txt). Builds of CheerpX are immutable and uniquely versioned. An example link would be: | ||
WebVM depends on the CheerpX x86-to-WebAssembly virtualization technology, which is included in the project via [NPM](https://www.npmjs.com/package/@leaningtech/cheerpx). | ||
|
||
`https://cheerpxdemos.leaningtech.com/publicdeploy/20230517_94/cx.js` | ||
The NPM package is updated on every release. | ||
|
||
We strongly encourage users _not_ to use the latest build. Please directly use a specific build to avoid unexpected regressions. Since builds are immutable, if they work for you now they will keep working forever. | ||
Every build is immutable, if a specific version works well for you today, it will keep working forever. | ||
|
||
# License | ||
|
||
WebVM is released under the Apache License, Version 2.0. | ||
|
||
You are welcome to use, modify, and redistribute the contents of this repository. | ||
|
||
The public CheerpX deployment is provided **as-is** and is **free to use** for technological exploration, testing and non-commercial uses. Downloading a CheerpX build for the purpose of hosting it elsewhere is not permitted. | ||
The public CheerpX deployment is provided **as-is** and is **free to use** for technological exploration, testing and use by individuals. Any other use by organizations, including non-profit, academia and the public sector, requires a license. Downloading a CheerpX build for the purpose of hosting it elsewhere is not permitted without a commercial license. | ||
|
||
Read more about [CheerpX licensing](https://cheerpx.io/docs/licensing) | ||
|
||
If you want to build a product on top of CheerpX/WebVM, please get in touch: [email protected] |
Oops, something went wrong.