5 ms·
WSL 1 was supposed to be like "Windows on NT" where it emulated the Linux kernal to the NT one. they skipped a ton of features then dumped the whole thing for a
by hypercube33 1y ago
WSL 1 was supposed to be like "Windows on NT" where it emulated the Linux kernal to the NT one. they skipped a ton of features then dumped the whole thing for a containerized virtual machine thing for version 2. Wish the NT one worked out but I get it being complicated.
- snailscale 1y agoFor anyone curious (as I was) the basic difference is that WSL1 implemented the Linux syscall table directly whereas WSL2 actually runs Linux on top of some virtual drivers (hypervisor).
- mbilker 1y agoWSL 2 runs a full Linux kernel under Hyper-V. There are some out-of-tree or staging drivers included in Microsoft's Linux kernel derivative and they publish their kernel sources at https://github.com/microsoft/WSL2-Linux-Kernel https://github.com/microsoft/WSL2-Linux-Kernel.
- dangerboysteve 1y agoi routinely upgrade my WSL2 kernel. Now on 6.6.87.1. Personally, I love WSL2.
- marshray 1y agoNote that in recent versions of Windows, typically the bulk of Windows now runs under a hypervisor (i.e., "in a VM") as well: https://learn.microsoft.com/en-us/windows-hardware/design/device-experiences/oem-vbs https://learn.microsoft.com/en-us/windows-hardware/design/de...
- dbdoskey 1y agoIf the WSL 1 ended up working, it would have been one of the best historical coincidences in MS's history. A long forgotten feature in the NT kernel, unique to pretty much any other OS out there, used to push it's dominance in the 90's, is revived almost 30 years later, to fight for relevance with Unix based OS, once again. To quote Gorge Lucas, It's like poetry, it rhymes.
- f1shy 1y agoThat would not be unique, as is what BSD has done for Linux compatibility basically forever.
- TeMPOraL 1y agoBSD and Linux are in the same bucket, so that doesn't count, not any more than MacOS compatibility with Linux. Windows is the odd one out.
- mmx1 1y agoI don't think it is fair to brush it off under "same bucket; doesn't count." The syscalls are still different and there's quite a bit of nuance. I mean the lines you're drawing are out of superficial convenience and quite arbitrary. In fact, I'd argue macOS/Darwin/XNU are really Mach at their core (virtual memory subsystem, process management and IPC) and BSD syscalls are simply an emulated service on Mach, which is quite different from traditional UNIX. The fact that as a user you think of macOS much more similar to Linux is not really reflective of what happens under the hood. Likewise NT has very little to do with Win32 API in its fundamentals but Win2k feels the same to the user as WinME, but under your framing, you'd same-bucket those.
- TeMPOraL 1y ago> Likewise NT has very little to do with Win32 API in its fundamentals but Win2k feels the same to the user as WinME, but under your framing, you'd same-bucket those. I probably would, in this context. Well, maybe not WinME, because that was a dumpster fire. But any Windows coming down from NT line, which is what's relevant in the past 20 years, sure. Same bucket.
- pjmlp 1y agoSolaris did as well.
- tjoff 1y agoWSL 1 works fine. I much prefer it over 2 because I only run windows in a VM and nested virtualization support isn't all there. Also feels a lot less intrusive for light terminal work.
- rcleveng 1y agoI know -- I was super excited to see WSL1 and wished it worked. NT when started was the OS/2 personality and back at that time was excited to see NT as the OS to end all OSes (by running them all as a personality). But WSL2 is freaking incredible, I'm super excited to see this and just wish the rest of windows would move to a Linux kernel and support bash natively everywhere. I was never a fan of powershell, sh/dash/ash/bash seem fine
- reisse 1y agoWhy not just use Linux then? The whole point of Windows right now is having a kernel that a) does not shove GPL down the device manufacturer's throat and b) care about driver API stability so that drivers actually work without manufacturer or maintaner intervention every kernel upgrade.
- bayindirh 1y agoPeople like to talk like GPL is evil, but it's underpinning more of the world than many people see. And thanks to no ABI/API stability guarantees, Linux can innovate and doesn't care about what others might say. Considering Linux is developed mostly by companies today, the standard upkeep of a driver is not a burden unless you want to shove planned obsolescence down the throats of the consumers (cough Win11 TPM requirements cough).
- dabockster 1y agoI wouldn’t call the GPL “evil”, but I do think it’s more unrealistic given current western economics and mooching practices. Some copyright here and there does help keep food and water on the table.
- codeguro 1y agoNothing prevents one from selling GPL'd software. https://www.gnu.org/philosophy/selling.en.html https://www.gnu.org/philosophy/selling.en.html
- 1y ago
- pjc50 1y agoThe essential problem was that critical Windows APIs like CreateProcess and the NTFS file system were far too slow to be used in UNIX-like ways. If you tried to run git or build things in WSL1 - a key use case - it was way slower than doing so on native or VM Linux.
- whizzter 1y agoPerformance was one problem, but imho the biggest was that MMAP semantics were inherited from the NT side and made a lot of applications crash (mmap's created could only be as large as the file's current size as in Windows, while Linux/BSD semantics allows for a mmap larger than the file that's usable without constant remapping as the file grows). They didn't prioritize it until fixing at a late stage, barely before WSL 2 came out. Sometimes i do wonder if they made a premature decision to move to WSL2 since there was quite a lot of basic applications/runtimes that were crashing due to this fix lacking (Naturally a lot of other new Linux API's like io_uring probably would have made it an api chasing treadmill that they just wanted to circumvent).
- xeonmc 1y ago> (mmap's created could only be as large as the file's current size as in Windows, while Linux/BSD semantics allows for a mmap larger than the file that's usable without constant remapping as the file grows). I thought you could do it using ntdll functions, no? https://www.jeremyong.com/winapi/io/2024/11/03/windows-memory-mapped-file-io/ https://www.jeremyong.com/winapi/io/2024/11/03/windows-memor...
- whizzter 1y agoGood to know, still the obscureness of this function or semantics led WSL1 to be incompatible for a long time (Also skimming this article touches upon some 0-sized mappings being an issue?). Regardless this led WSL1 to have fatal incompatibilities for a long time, iirc basic stuff like the rpm system or something similarly fundamental for some distros/languages relied on it. And once WSL2 existed people just seems to have gone over.
- 1y ago