container2wasm icon indicating copy to clipboard operation
container2wasm copied to clipboard

How can I enable networking while sharing a directory?

Open lanbomo opened this issue 7 months ago • 2 comments

The container2wasm project is truly outstanding. Recently, I encountered a challenging issue while using it. When I run it via c2w-net (which essentially executes wasmtime), I observed that if I do not use preview2=n and remove tcplisten, the --dir flag works correctly for directory sharing. However, if I enable networking (by setting preview2=n and configuring tcplisten), networking functions normally, but directory sharing fails.

I have spent several days investigating this issue without resolution. Any guidance would be greatly appreciated!

Expected behavior: Networking and directory sharing should work simultaneously.

Thank you very much!

lanbomo avatar Jul 03 '25 04:07 lanbomo

This looks like a known issue in wasmtime, please see https://github.com/bytecodealliance/wasmtime/issues/3936 . This issue seems a duplicate of https://github.com/container2wasm/container2wasm/issues/291 .

ktock avatar Jul 04 '25 14:07 ktock

@ktock Thank you for your response. I noticed that directory sharing works normally when not using preview1 , so is it possible to enable networking without relying on preview1 ? I also observed that preview2 has a TCP-related option "-S tcp=y" could this feature be leveraged to achieve simultaneous networking and directory sharing?

Once again, thank you for your guidance and exceptional work!

lanbomo avatar Jul 05 '25 03:07 lanbomo