6 ms·
> Those pain points were solved in WSL 2 by embedding a whole first-party Linux VM inside Windows Wait so now it's just a regular Linux virtual machine? I tho
by VWWHFSfQ 7y ago
> Those pain points were solved in WSL 2 by embedding a whole first-party Linux VM inside Windows
Wait so now it's just a regular Linux virtual machine? I thought it was a thin translation layer between the kernels? Kinda not as impressive now.
- mehrdadn 7y agoYeah don't get too excited, it's just a VM. The disk usage doesn't automatically shrink with usage, and I'm not sure if RAM does either (interested in knowing if they've done anything related to that), which were what I found most useful about WSL1. I wish they'd instead put all their effort from this into legitimately fixing the issues in WSL1 instead.
- mtzet 7y agoThe disk issue was probably going to be difficult to solve even with the WSL1 model if they wanted good IO performance. Using a proper Linux filesystem underneath is a decent compromise IMO. The RAM issue is a clear setback, and makes it annoying trying to do large compile jobs on the Linux side, though it's been a while since I've tried it. In theory it could be possible to handle coorporation between the Linux and Windows RAM usage patterns since they're running a very heavily modified kernel. I'd be very interrested in knowing if anything is hapenning on that front.
- gmueckl 7y agoIsn't Linux already capable of handing unused memory back to an underlying hypervisor? I vaguely remember that MS contributed code to support that kind of interaction with HyperV. Am I wrong?
- sz4kerto 7y agoThey do adjust memory reservation dynamically if I'm correct. It's very nice overall.
- patentatt 7y agoI think hyper-v does dynamically scale ram usage of vms, so it’s at least plausible that wsl2 does as well
- cesarb 7y ago> it's just a VM. The disk usage doesn't automatically shrink with usage That's possible in theory, I've done it with libvirt/KVM. You have to enable discard on all filesystems and swap on the guest, use a virtual disk interface which can pass the discard requests to the host, and configure the host to release the corresponding blocks on a discard request. I don't know if WSL2 comes configured to do all that, but if not, it shouldn't be too hard for them to add this functionality.
- mehrdadn 7y agoI imagine that could cause some awful fragmentation?
- Tomte 7y agoIt's not quite a regular VM, like what users themselves can create, but deeply integrated. But it's based upon Hyper-V, that's correct. It is technically less impressive, but much easier to maintain and stay compatible for Microsoft.
- judge2020 7y agoHere's the diagram - https://i.redd.it/po98dksksjx21.png https://i.redd.it/po98dksksjx21.png It's only running alongside Windows in the sense that it's running in Hyper-V, which Windows itself effectively does when you have Hyper-V enabled. What is special about this Linux build is that it's specifically made for running alongside Windows since it needs to integrate with the Explorer and other Windows components[0]. 0: https://devblogs.microsoft.com/commandline/shipping-a-linux-kernel-with-windows/ https://devblogs.microsoft.com/commandline/shipping-a-linux-...
- mehrdadn 7y ago"Alongside" is such marketing nonsense that as a user it almost gets me angry to keep reading it at this point. If it was really running "alongside" Windows then I'd be able to switch to Linux, shut down Windows, and now work in Linux while it's still running. And back. That's what it means to a user when you say they run "alongside" each other. But it's obviously not that. Not even on the same planet as that. It's just a damn VM running inside Windows as far as it concerns a user. Nobody cares if it's running in ring 0 or -1 or NaN, or under a hypervisor or over a supervisor, or whatever terms get thrown around. If it's still going to quack to the user like every other duck, it's a duck.
- scarface74 7y agoSo how many users are in the set of people that care about running Linux using the WSL, don’t understand the technical underpinning, and that care?
- close04 7y ago> as far as it concerns a user The users who aren't concerned with making the distinction you just brushed aside don't know or care what a VM is so for them Linux is just an app running in Windows. You're making your point the same way they would. https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/hyper-v-architecture https://docs.microsoft.com/en-us/virtualization/hyper-v-on-w...
- happytoexplain 7y ago
- munchbunny 7y agoYup it’s not as impressive technically, but it’s a huge improvement for what developers have actually been using it for.
- Tuna-Fish 7y ago> I thought it was a thin translation layer between the kernels? WSL1 was like that, but it was severely handicapped by NT filesystem performance, especially for small files or metadata operations. There are a lot of small operations that are more than 2 orders of magnitude slower on Windows than on Linux, and a lot of Linux software just expects them to be fast, so WSL1 is not a great experience for a lot of stuff.
- mehrdadn 7y agoNote that the performance didn't really have anything to do with NTFS. This is trivial to prove if you just try a different filesystem.
- close04 7y agoWSL 1 and WSL 2 can coexist and be used according to what needs one's scenarios present. I imagine MS collected enough requirements to also justify a full Linux VM. There will be some slowness somewhere, the 2 versions now let you choose on which side of the boundary to place it. https://docs.microsoft.com/en-us/windows/wsl/wsl2-faq https://docs.microsoft.com/en-us/windows/wsl/wsl2-faq
- mehrdadn 7y agoThey could've instead worked on speeding up the I/O subsystem and sped up Windows altogether. I refuse to believe it's impossible. The more plausible reasons to me seem to be (a) they have to work independently from the I/O subsystem team(s) for whatever reason (maybe they didn't care enough to cooperate), or (b) it's too tricky to get right and prone to bugs, so they preferred not to have to deal with it and risk breaking I/O.
- close04 7y agoI/O subsystem performance is just one aspect. WSL 1 is missing a lot of other stuff probably because the effort to implement it all was to great. MS would have to duplicate a lot of the effort already put in by Linux developers. So they went the route of a full Linux VM. And no matter how much MS improves WSL 1 there would always be something missing that enough users want/need. For example I care more about the network related stuff that wasn't implemented (NETLINK_ROUTE\RTM_GETROUTE, AF_PACKET family) because this excluded nmap.