top | item 44562289

(no title)

zanecodes | 7 months ago

Docker on macOS also runs a Linux VM under the hood, just like WSL2 does, they're no different in that respect. WSL1 used the more exotic approach of translating Linux system calls to and from NT kernel system calls, but for various reasons (compatibility, performance, complexity) Microsoft abandoned that technique and adopted a Linux VM running under the Hyper-V hypervisor for WSL2.

discuss

order

WorldMaker|7 months ago

There is a difference in Hyper-V itself. The Windows hypervisor is underappreciated as one of the better VM hypervisors in some scenarios, and WSL2 uses a few Hyper-V tricks [0] to really shine if your machine's Hyper-V isn't interfered with by other hypervisors. (Sadly not uncommon given how many us have things like old VirtualBox VMs that still need Hyper-V to run in a compatibility mode with Oracle-maintained hypervisors of the past.)

(Also, WSL1 isn't as actively maintained as it was when WSA [Windows Subsystem for Android] was an active Windows 11 feature driving it, but it hasn't been entirely abandoned either and there is some community support ongoing [open source PRs].)

[0] Among other things, Windows likes to run itself at all times as a guest in Hyper-V when Hyper-V is active (and other ancient hypervisors aren't interfering), making Hyper-V VMs like WSL2 "peers" with Windows itself for Hyper-V resources/attention. (It's one of the funnier things about Hyper-V being a "Pro" feature still today because even consumer-focused Windows Home is often still running in Hyper-V [because it's also sometimes a defense-in-depth security/sandboxing in some consumer use cases], it just won't let you configure other VMs in it than your main Windows OS.)

zanecodes|7 months ago

I agree, Hyper-V is a pretty cool technology! I wasn't aware WSL1 was still supported at all, let alone receiving pull requests. Windows Subsystem for Android was a neat feature, but not something I used regularly, especially since it lacked Google Play Services which made many popular apps fail to function on it.