webvm filesystem and headless

I was directed to Discord to learn more about using webvm with filesystem APIs. I hope this is the right place to ask. I want to run webvm headless, such that my Javascript executes shell commands but I display my own html/js frong end. I also want to be able to save files to the filesystem or at least as a stopgap serialize those files generated in my VM to Javascript to enable file downloads.
3 Replies
Invalid Name
Invalid Name4w ago
I think you'd need an IDB device to do that but not quite sure.
Leaning Technologies Developer Hub
Files and filesystems - CheerpX Documentation
Virtual filesystems and how to use them
apignotti
apignotti4w ago
Hi, thanks for getting in touch. WebVM is just a small layer on top of CheerpX which is the underlying virtualization engine. WebVM provides the full screen terminal, but that is completely optional and not required by CheerpX. The CheerpX API is designed to achieve exactly what you need, executing single commands from JavaScript. You can make then "shell command" by wrapping everything a bash -c ... around everything. This is short tutorial for how the CheerpX API works: https://cheerpx.io/docs/tutorials/simple-executable Full documentation for the run API is available here: https://cheerpx.io/docs/reference/CheerpX.Linux/run There is no support to directly safe files outside of the browser, but you can easily achieve downloading files from the IDBDevice, which is persistent storage backed by IndexedDB (sa mentioned by @Invalid Name ). There is a ready-made API to export files as JavaScript Blobs that you can then automatically download using standard HTML5 techniques: https://cheerpx.io/docs/guides/File-System-support#idbdevicereadfileasblob
Leaning Technologies Developer Hub
Simple Executable - CheerpX Documentation
Running a 32-bit Statically Linked Executable using CheerpX
Leaning Technologies Developer Hub
run - CheerpX Documentation
Executes a command within the CheerpX Linux environment.
Leaning Technologies Developer Hub
Files and filesystems - CheerpX Documentation
Virtual filesystems and how to use them
pescennius
pescenniusOP4w ago
this is really helpful thank you

Did you find this page helpful?