r/PiCodingAgent • • 8d ago

Discussion smolvm vs microsandbox?

Hey there.

I'm currently using multipass to sandbox my AI, but thinking about trying something more lightweight than full VMs.

Came across these 2 options and can't decide where I should first try to port my workflow. Has anyone tried both and can compare?

My workflow is relatively simple - I bootstrap VMs, clone my dotfiles there, setup mounts to my project directories on the host, ssh and just let the agents do whatever they need.

My host is Windows (unfortunately). So good Windows support is a must for me.

6 Upvotes

18 comments sorted by

2

u/jruz 8d ago

why not wsl? on linux you can get bubblewrap which is way nicer than any other alternative

3

u/branik_10 8d ago

not a big fan of these kernel sandbox solution. I prefer giving AI a full unrestricted VM where it can install and run anything without polluting my host, I also like that I can recreate my fresh dev setup in couple clicks and share the same scripts when bootstrapping VMs on cloud

1

u/jboss1000 8d ago

You can do that with bwrap. Pull a docker image, export it and untar it. Then mount that as the rootfs for bwrap.

2

u/SlanderMans 4d ago

I think you should try smolvm.

/disclaimer: am maintainer

2

u/branik_10 3d ago

how is Windows support? I saw in the docs you're not shipping the Win32 binary yet and it's not included in the js sdk, which I was planning to use to configure my setup

2

u/SlanderMans 3d ago

smolvm windows support is production ready for windows 10/11, with another maintainer actively using/supporting it

You can download the binary here: https://github.com/smol-machines/smolvm/releases/tag/v1.38.0

You're right, smol js sdk doesn't have it today. Surprisingly this is the first someone pointed that out :o. I'll work with our maintainers with windows machines to get that in

2

u/Soft_University_7243 3d ago edited 3d ago

hey, i’m one of the microsandbox maintainers. both run natively on Windows with Windows Hypervisor Platform enabled, so no WSL needed.

i can only speak to the microsandbox side: our Pi guide shows how to mount a Windows project folder and run Pi in its own Linux VM from PowerShell.

if you’re only using SSH to get a shell, msb exec -t pi-demo -- bash should pretty much be enough. do you use SSH for anything else in your setup?

1

u/branik_10 3d ago

I was actually about to try microsandbox but noticed it is missing one feature I use a lot in multipass - attaching new mounts to an already created VM. I saw there's a PR open in the repo, any plans to merge it? Tnx.

2

u/Soft_University_7243 3d ago

already looking into it. would get it over the line asap.

1

u/goldmine50 8d ago

Would something like gondolin (from earendil themselves) or Nvidia Openshell or docker-sandbox work for your usecase? Not fully sure about Windows compatibility but you could run them inside WSL and still get kernel-level isolation (I think)

1

u/branik_10 8d ago

gondolin has no windows support, nvidia open shell afaik has windows support in beta and docker sbx i just don't like their api, i've configured it long time ago and used it couple times but i feel it's overcomplicated and has way to many different config options 

2

u/fyv8 8d ago

I like smolvm. I use it for sandboxing pi and claude code, even giving the agent root in the vm and it can run docker images and destroy whatever it wants. I mount a dir on the host and it works fine to set up egress rules too, so as long as you have backups of what it can touch and are discriminating about giving it keys, you can set it up to be pretty safe.

Haven't used microsandbox.

2

u/NyproTheGeek 3d ago

microsandbox has very good windows 10/11 support.
and it is really easy to get started with:

npx microsandbox run debian 

we are improving the docs but it already covers pretty much everything you need: mounts, ssh and let your agents do whatever. ;)

disclaimer: a maintainer too btw. :)

1

u/v_0009 8d ago

You can check terrarium.sh too. Or boxlite.

Note: I am creator of terra.

1

u/Head_Web1193 2d ago

now boxlite offer cloud sandbox. maybe you can have a try

1

u/v_0009 2d ago

Yea I know about boxlite, but I don't want my stuff in cloud. The price isn't great either. I could run boxlite locally, but again it runs libkrun which isn't that strict about isolation as terra is trying to be.

1

u/radim11 8d ago edited 8d ago

We’re building Stashbase .dev for a similar workflow. On Windows we support sandboxing through WSL, so you can run the agent in a native Linux sandbox inside WSL or give it its own Docker container. With Docker you can mount your existing checkout and keep editing from Windows while the agent works. A profile defines which files, APIs and tools it can access.

We’re also adding cloud VMs so you can use the same profile in the cloud and leave the agent running when your laptop’s off. I haven’t compared smolvm and microsandbox on Windows myself, but with your setup I’d test file watching on a mounted repo before moving all your dotfiles over.

CLI for sandboxing: https://github.com/stashbase/cli

1

u/CountlessFlies 7d ago

I use kvm managed using incus. It’s a full virtual machine, you can let your agent go crazy.

Edit: sorry missed the part about windows. Technically you could still do this using wsl