Live data from Hacker News

Windows Subsystem for Linux: The lost potential

jmmv.dev

131–140 of 250 posts

Re: Windows Subsystem for Linux: The lost potential

#131
post #35

Earlier quoted context omitted.

The actual advantage of working on something like WSL1 is that it would ensure that the NT kernel is as capable as the Linux kernel (Linux is of course the best designed and implemented among the non-realtime, not provably correct and not secure kernels). For instance, the complaints about I/O performance are because the NT kernel has a worse implementation, so they should have improved it for both Win32 and Linux ap…

I find IO on windows is fine, the problem with WSL1 was that the standard windows model doesn't line up well with Linux (fairly fundamental things like in Linux you can delete open files, which you can't do in Windows). You couldn't switch Windows to a more linux-like model, it would break all existing windows programs.

You can delete open files on Windows, but you need the right option (FILE_SHARE_DELETE).

Re: Windows Subsystem for Linux: The lost potential

#132
post #14

If you want a Linux-like environment on Windows that can see and be seen from the Windows side, there is Cygwin. It's not as deeply integrated as WSL1, nor has binary compatibility (you'll have to get binaries compiled for it or compile them yourself) but last time I checked (Windows 7, IIRC) it did the job.

I used Cygwin for a long time and the main issue was fairly poor performance. WSL-1 is a significant step up in that sense, and WSL-2 blows them both out of the water. There are trade-offs, they all still seem to have their place.

Re: Windows Subsystem for Linux: The lost potential

#133

> And the reason I can imagine this is because macOS gives you this model (albeit cheating because macOS is essentially Unix). What is the cheat there? That MacOS X is a single operating system, where both, command line tools the blog author knows and GUI tools, life in the same world, with da process model and same devices on a single kernel, unlike WSL? How is that cheating? Is my Linux desktop cheating as well?

Well, cheating in that it’s a totally different system, which makes it not a good apples to apples comparison. MacOS is UNIX. Unix and Linux are similar in many ways and plenty of Linux utilities have been ported over or packaged for macOS, the same as any other BSD, but as you say, it’s one kernel and one system with different interface options. It’s not as if you’re having to deal with different file systems or share the same hardware across kernels.

A better comparison would be Docker for Mac, which has had several approaches over the years. Originally, Docker Desktop for Mac used VirtualBox in the background to spin up a VM that was then used for containers. It then moved to using HyperKit, which is the more “native” soliton but has downsides, largely around I/O and CPU usage, many of the same problems facing WSL1 and some of the edge cases with WSL2.

Re: Windows Subsystem for Linux: The lost potential

#134
post #7

Earlier quoted context omitted.

cheating as in they have much less work to do to implement unix-like linux on the hood because it was already there, and Microsoft actually has to build a port.

Where is MacOS implementing Linux? At it's core it is a Unix system (not sure whether they have any recent certification, but doesn't matter) tltonlarge parts following POSIX with a fancy GUI.

Exactly.

Re: Windows Subsystem for Linux: The lost potential

#135
post #14

If you want a Linux-like environment on Windows that can see and be seen from the Windows side, there is Cygwin. It's not as deeply integrated as WSL1, nor has binary compatibility (you'll have to get binaries compiled for it or compile them yourself) but last time I checked (Windows 7, IIRC) it did the job.

Cygwin was always a lot more cumbersome. Building programs for it is a pain and doesn't always work. It's better than nothing, but WSL1 (and SFU/Interix before it) is a lot better.

Re: Windows Subsystem for Linux: The lost potential

#136

Earlier quoted context omitted.

I apologize if I'm missing something here, but if casual users don't care about performance, what's the overhead here?

Example: on WSL1 I could cheaply run Linux CS labwork including valgrind checks etc. - with less resources and much snappier than with VirtualBox VMs I'm not confident about diving into WSL2.

I've had surprisingly good results running that sort of thing under WSL2. Pure CPU workloads actually work pretty well, and in my experience valgrind has mostly been CPU intensive?

Re: Windows Subsystem for Linux: The lost potential

#138
post #9

Contra opinion: the VM option reduced the service interface between Windows and Linux to a single kernel implementation and a few drivers, rather than every possible userspace program ever written. It's an amazing and obvious trade off. My inner architecture astronaut appreciates all the ideas in this post, but I've been trying to kill that guy for over a decade now. The bottom line is WSLv1 design SUCKED precisely b…

Good points; in addition, I can only imagine the headache of trying to support the latest eBPF, io_uring, WireGuard, and other advanced kernel features in WSL1. I imagine a lot of newer features would return ENOSUPP from the kernel, so WSL1 basically becomes a weird fork of an old Linux kernel. (Weird because it lacks a large community, and old because the ENOSUPP's downgrade what's available.)

In WSL2 everything should work (depending on the CONFIG options and how much Microsoft has changed).

Re: Windows Subsystem for Linux: The lost potential

#140

Earlier quoted context omitted.

I apologize if I'm missing something here, but if casual users don't care about performance, what's the overhead here?

IIRC WSL 2 use 50% of your memory in Windows, or 8GB (whichever is smaller) by default.

This hasn't been my experience, but sure, even if memory consumption is higher, for most applications where Windows users are going to use WSL, additional memory is incredibly cheap compared to the dev overhead of trying to boot into a Linux environment and switching back and forth.
Post reply on HN