It would be nice if there was a way to persist this. There are instances where you want to have either a clean environment to work in or you want to isolate something from your primary machine but you also don't want it to just get destroyed when you are done. Maybe this is a feature of this and I'm just not understanding it properly.
For instances were I want to have a more persisted state I would create a Sandbox file (with file extension .wsb) which just runs a setup script when the environment starts.
So basically what you would do with a provisioning script when using VM's.
The sandbox persists through a restart (to allow for the installation of software that requires a reboot) but never persists after Windows Sandbox is closed.
That’s the big distinction from Hyper-V or other virtualization products; otherwise, it’s just a Hyper-V VM with a prebaked Windows image and fewer options.
Not completely, it uses the Krypton microVM part of Hyper-V that is used for WSL2, Application Guard, and nothing else. I wish I could arbitrarily run Windows microVMs outside of sandbox.
That's not how I'd interpret it, it makes sense that if you restart the sandbox from inside the sandbox it doesn't get destroyed, but it doesn't seem to change anything else. If you shutdown the sandbox from outside it would still be destroyed.
It is a Hyper-V backed VA backed VM.
It shared memory with the host in the same fashion that WSL does, as opposed to carving out physical memory.
We have some additional optimizations to make it snappier than running a full vm.