container2wasm icon indicating copy to clipboard operation
container2wasm copied to clipboard

[Question] How can I keep the data stored and use it again?

Open ClarissaGazalaEvanthe opened this issue 6 months ago • 7 comments

I tried running Linux using wazero.

https://github.com/container2wasm/container2wasm/tree/main/tests/wazero

It works, but can I install packages from apt?

What if I want to keep it and reuse it?

ClarissaGazalaEvanthe avatar Aug 16 '25 11:08 ClarissaGazalaEvanthe

apt

You'll need to setup the networking support: https://github.com/container2wasm/container2wasm/tree/ca381a0482f7b6b1cdefdacdeba63a19fbe935c8/examples/networking

keep it and reuse it?

I think there are two ways:

Option A: Bake them to Dockerfile so that the container image be reused Option B: Use the directory mapping feature (--mapdir in the wazero example) to persistently store them on the host

ktock avatar Aug 17 '25 04:08 ktock

Sometimes why does it take a long time to connect to the network? So when you want to run using the network you have to wait for the connection, sometimes you don't know how long it will take

Image

I got this issue when mounting a directory with a network host but if not mounted it can run

ClarissaGazalaEvanthe avatar Aug 20 '25 14:08 ClarissaGazalaEvanthe

and how to solve this?

I created my own container image.

753M /workspaces/container2wasm/container2wasm-demo/out/amd64-ubuntu-wasi-container.wasm

I wanted to install it, but this error appeared.

failed to write (No space left on device)

Image

I plan to use this linux on native os (android, linux) instead of browser, is it possible?

ClarissaGazalaEvanthe avatar Aug 20 '25 16:08 ClarissaGazalaEvanthe

My codespaces has 16gb of ram but when running the wasm container why is the ram only this much?

Image

how to adjust the size of RAM and disk?

ClarissaGazalaEvanthe avatar Aug 20 '25 17:08 ClarissaGazalaEvanthe

how to adjust the size of RAM and disk?

You can change the guest memory size by specifying --build-arg VM_MEMORY_SIZE_MB=<size-in-mb> to c2w and the default is 128MB. As of now there is no external storage unless you use --mapdir. The data written to the rootfs in the guest go to the tmpfs so the memory size needs to be increased to enlarge the capacity.

ktock avatar Aug 22 '25 01:08 ktock

Have you tested it on Android?

I tried running x64_ubuntu-25.04.wasm on Android ARM, and it was very laggy, meaning the process took a long time.

Is it because of the different architecture? It's fast on my laptop.

ClarissaGazalaEvanthe avatar Aug 22 '25 02:08 ClarissaGazalaEvanthe

how to adjust the size of RAM and disk?

You can change the guest memory size by specifying --build-arg VM_MEMORY_SIZE_MB=<size-in-mb> to c2w and the default is 128MB. As of now there is no external storage unless you use --mapdir. The data written to the rootfs in the guest go to the tmpfs so the memory size needs to be increased to enlarge the capacity.

Can't it be made a feature so that it can be set via script so that there is no need to rebuild just to set RAM and disk?

ClarissaGazalaEvanthe avatar Aug 22 '25 02:08 ClarissaGazalaEvanthe