3 ms·
One downside there is the constantly huge RAM consumption of such a setup. EDIT: At least compared to WSL1. However WSL2 also has some advantages in that it ca
by shawnz 6y ago
One downside there is the constantly huge RAM consumption of such a setup.
EDIT: At least compared to WSL1. However WSL2 also has some advantages in that it can reclaim unused memory and suspend the VM when not in use.
- AshamedCaptain 6y agoWhy would VM-based WSL2 use any less RAM?
- freeone3000 6y agoWSL VMs are gen2 (fully paravirtual) hyper-v VMs, so use dynamic memory allocation. VirtualBox, even with Hyper-V as its engine, doesn't do this. I don't think any standalone Linux distros offer a standalone Hyper-V paravirtual image that is not a WSL2 image.
- Cu3PO42 6y agoThe Ubuntu image you can select in the "New VM" dialog in the Hyper-V management tool (or whatever it's called) absolutely does work with dynamic memory allocation and I seem to recall getting it to work on an Arch VM as well. I believe the "Linux Integration Services" for Hyper-V are actually mainlined at this point so I would expect most things to work. Setting up RDP for enhanced desktop sessions is the only painful thing I remember.
- AshamedCaptain 6y agoYou don't need paravirtualization to do dynamic memory allocation -- all VMs do this.
- freeone3000 6y agoNo. Gen1 images use a fixed allocation pool instead of an oversubscription model. You need a gen2 image with a cooperative memory allocator on the guest in order for this to work properly.
- AshamedCaptain 6y agoWell, so barring ancient HyperV versions, all VMs do it. This is more of a guest thing than hypervisor thing, anyway. All the VM needs to support is balloning and this is completely unrelated to paravirtualization.