4 ms·
Hyper-V does support memory ballooning (dynamic memory allocation from host to VM) - is that what you mean, or do I misunderstand? This does need support in th
by GordonS 4y ago
Hyper-V does support memory ballooning (dynamic memory allocation from host to VM) - is that what you mean, or do I misunderstand?
This does need support in the guest VM, but I've only ever had issues with really old Linux distros.
- easton 4y agoMy comment was really kind of inaccurate, the difference isn't the memory ballooning, it's the special way WSL2 is able to interact with the host. It frees memory much better than normal Hyper-V VMs, and boots way faster than a regular Ubuntu VM. Microsoft implemented a Firecracker style microVM (they call it "Krypton") for Hyper-V, which is used for WSL2, Edge Application Guard (run Edge in a VM), and Windows Sandbox. There aren't any real good docs on how to create one yourself using the Host Compute Service.
- GordonS 4y agoThat makes sense, thanks for explaining!
- kritr 4y agoTo add to this a little bit. There is deeper host side integration for these applications and the VM’s are virtual address backed (the guest vm’s memory is represented as a process on the host), which adds more opportunities to free up physical memory. The windows sandbox architecture page covers some of this. https://learn.microsoft.com/en-us/windows/security/threat-protection/windows-sandbox/windows-sandbox-architecture https://learn.microsoft.com/en-us/windows/security/threat-pr... Also WSL2, if I recall correctly, has a relatively minimal base OS with a custom init binary. I would say if you’re looking to use Host Compute Service, your best option would be to look at the way https://github.com/microsoft/hcsshim https://github.com/microsoft/hcsshim initializes containers.