Hacker News new | ask | show | jobs
by mauflows 2227 days ago
I've had trouble researching if WSL2 is in fact a hyper-v managed VM. I've seen some documentation referring to WSL2 as a tightly integrated Krypton (scaled down hyper-V) VM. It seems to imply the host overhead isn't as high as a guest on hyper-V
2 comments

WSL uses a Hyper-V derived virtual machine that is

* Sparse & light - they only allocate resources from the host when needed, and release them back to the host when freed * Fast - it can boot a WSL distro from cold in < 2s * Transitional - these lightweight VMs are designed to run for up to days-weeks at a time

Full Hyper-V VMs aim to (generally) grab all the resources they can and keep hold of those resources as long as possible in case they're needed. Full VMs are designed to run for months-years at a time.

WSL's VMs are MUCH less impactful on the host - FWIW, I run 2-3 WSL distros at a time on my 4 year old 16GB Surface Pro 4 and don't even notice that they're running.

But then you have this thread with people running Cron jobs to free cached memory: https://github.com/microsoft/WSL/issues/4166

I imagine this will be addressed, but claims of lightweight seem exaggerated?

But even more on my mind is the impact on the windows host. Is it running as a guest under hyper v? What's the overhead?

^ ms pm
AFAICT Krypton is stripped down in the sense that a lot of the management framework is gone, but as far as the guest is concerned, it's running on hyper-v.