
How WSL2 Works - rjzzleep
https://thenewstack.io/windows-subsystem-for-linux-brings-the-full-4-19-kernel-to-windows/
======
wmf
New technical details for the impatient:

 _WSL 2 runs a very lightweight Hyper-V VM (the same type we use for Hyper-V
isolated containers) with a full Linux kernel so there is no syscall
translation occurring.

The lightweight Hyper-V VM, the 9P filesystem bridge and even the kernel is
heavily borrowed from the kernel we use with LCOW in Azure.

these VMs use virtually allocated memory, start up in under a second and stop
even faster

the Linux filesystem is now just using EXT4 directly over a virtual pmem
device

sharing files/folders is fully maintained by use of a filesystem bridge using
the 9P protocol, so WSL 2 sees all your Windows files and folders and you can
see your Linux mounts from Windows

there is now a NIC in WSL 2. We used our NAT network mode so that NIC is fully
managed and coordinated by the host, but it does have its own IP_

------
ncmncm
The key question is, why would you give Windows control over your computer?
(It makes me queasy just thinking about it.) Instead, boot into something
trustworthy, and run Windows bottled in a VM if you still need it.

Windows actually runs faster in a VM than natively, because a host system can
be overwhelmingly better at managing a file system than Windows is. The
article suggests that Windows is better with big files, but the truth is that
it is just better with them than with small files, not better than something
else.

Microsoft could make things better for users by enabling Windows to boot
without the host being obliged to emulate real hardware. Maybe that comes with
this new thing.

