Live data from Hacker News

Windows Subsystem for Linux: The lost potential

jmmv.dev

161–170 of 250 posts

Re: Windows Subsystem for Linux: The lost potential

#161
post #53

I too was really sad to see WSL 1 be replaced by what seems to be just a built-in VM. One of the great things about WSL 1 is that I can run Linux tools on my laptop without the memory overhead of a VM. My laptop only has 8GB of ram which is not enough for Windows and a Linux VM to comfortably share, but plenty to run the Linux tooling I want under WSL 1. On my desktop with 16GB of ram I can just run Virtualbox. WSL 2…

While still being a VM, WSL2 works much better than a Virtualbox VM: boots in 1 second (!) on my machine, as attested by uptime and dmesg, has dynamic memory reclamation, out of the box file sharing through \\wsl$, VSCode integration. Same technology, yeah, but much more ergonomic.

My Linux VM in Hyper-V also boots in 1 second (well, 1.5 seconds actually but that includes networking, docker, samba and various other services):

    $ systemd-analyze
    Startup finished in 76ms (firmware) + 38ms (loader) + 461ms (kernel) + 967ms (userspace) = 1.544s
So 1 second by default is impressive, but not really special for those who can already run a VM.

Dynamic memory reclamation is turned on by default for any modern Linux distributions running in Hyper-V. Last I checked the performance of \\wsl$ is terrible (certainly not on par with NFS).

I can see it might be slightly more ergonomic for casual users though, but certainly not to the point WSL 1 has already been at.

Re: Windows Subsystem for Linux: The lost potential

#162
Can somebody explain why he doesn't get the best of all worlds just running Wine on bare-metal Linux? Sure, he's obliged to run those programs, but that's table stakes. Other than those, it's Linux from here to the bank, and those processes show up in ps output with right numbers even.

Re: Windows Subsystem for Linux: The lost potential

#163
post #22

Earlier quoted context omitted.

The original POSIX subsystem was not very useful -- a minimal set of system calls, plus a Microsoft re-branded MKS Toolkit to provide shells and utilities. Microsoft ended up buying Interix, who offered a much more pleasant UNIX-on-Windows setup. That was supported for many years as "SFU" and later "SUA" SUA was still a pretty weird UNIX though. PE-COFF binaries, and a linker that wasn't 100% GNU compatible, and a lo…

> SUA was still a pretty weird UNIX though. PE-COFF binaries PE-COFF comes from UNIX originally – COFF was the executable format introduced by AT&T in Unix System V, up to and including SVR3 – in SVR4, it was replaced with ELF. PE-COFF is simply Microsoft's variant of COFF. There are other variants, such as IBM's XCOFF (used on AIX). Given that COFF originated on UNIX and has a long history of use there, should we re…

SVR4 was released in 1990, before win32 or NT even existed. By the time Interix came along, the whole world was ELF — there was even an Intel standard that unified all x86 UNIX ABIs, iBCS.

AIX is the only Unix to retain COFF.

It’s deeply weird, unsupported by standard tools, and shipped with a not quite 100% compatible shim for the gnu linker.

Trust me when I say it is not a fun combination.

Re: Windows Subsystem for Linux: The lost potential

#164
Conway's law means were going to end up with quasi-microkernels.

- See google doing networking and other stuff in userspace to work around lazy phone manufacturers for Android. (And also for servers for entirely different reasons.)

- Imagine vendor lock-in^2 where my app only runs with Linux and Windows via WSL!

- NT and XNU are already that way, probably in-part due to Conway's law

- Various "serverless" cloud gambits will chop things up in different ways

- Maybe the Fuschias of the world will want a WSL too

Re: Windows Subsystem for Linux: The lost potential

#165

Earlier quoted context omitted.

Now I want screen or tmux. Otherwise you can't really run anything on a remote Windows machine over SSH on spotty connections.

well, this thing sometimes works https://docs.microsoft.com/en-us/windows/terminal/panes

No, the issue is about SSH sessions.

  ssh user@windows-pc run long job
If you do this, and your connection is interrupted, `run long job` command will be terminated.

Re: Windows Subsystem for Linux: The lost potential

#166
post #162

Can somebody explain why he doesn't get the best of all worlds just running Wine on bare-metal Linux? Sure, he's obliged to run those programs, but that's table stakes. Other than those , it's Linux from here to the bank, and those processes show up in ps output with right numbers even.

Because his job is to ship software that runs on Windows. You can only do that on actual Windows.

Re: Windows Subsystem for Linux: The lost potential

#167
post #22
post #11

I remember NT was to have an OS/2 subsystem, probably because it started out as OS/2 3.0, with a New Technology (NT) kernel. I know there was a POSIX system, but I never saw or interacted with it and, legend says, it was only used to check a box in government contracts.

The original POSIX subsystem was not very useful -- a minimal set of system calls, plus a Microsoft re-branded MKS Toolkit to provide shells and utilities. Microsoft ended up buying Interix, who offered a much more pleasant UNIX-on-Windows setup. That was supported for many years as "SFU" and later "SUA" SUA was still a pretty weird UNIX though. PE-COFF binaries, and a linker that wasn't 100% GNU compatible, and a lo…

Gentoo-prefix on SUA was my daily driver for years. I had all the “could you imagine” stuff mentioned in the article - dealing with the random build errors now an then did get old though. I always wondered why more people didn’t use it especially seeing how popular WSL is now. Maybe SUA was just ahead of its time?

Re: Windows Subsystem for Linux: The lost potential

#168
post #24
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…

I agree with the sentiment but, some scenarios have become orders of magnitude more complicated on WSL2 like connecting to a daemon on Windows or vice versa. I understand clear cut security boundaries and separate network interfaces, but it's extremely hard to get them running smoothly now. Everything was on localhost on WSL1. Memory usage has also gone bonkers with the VM approach, causing unnecessary overhead for c…

Memory and cpu limits are configurable for wsl. You can cap your vm to whatever portion of your machine that you want.

Re: Windows Subsystem for Linux: The lost potential

#169
post #24

Earlier quoted context omitted.

I agree with the sentiment but, some scenarios have become orders of magnitude more complicated on WSL2 like connecting to a daemon on Windows or vice versa. I understand clear cut security boundaries and separate network interfaces, but it's extremely hard to get them running smoothly now. Everything was on localhost on WSL1. Memory usage has also gone bonkers with the VM approach, causing unnecessary overhead for c…

FYI to any WSL2 users, in it's migrated configuration the WSL VM can request as much RAM as it needs, but has no means to free this back. There's an option to use .wslconfig to specify a limit. https://github.com/microsoft/WSL/issues/4166

Does "wsl --shutdown" work?

Re: Windows Subsystem for Linux: The lost potential

#170

Earlier quoted context omitted.

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

Is that an upper bound? My Ubuntu 20.04 console sessions on WSL2 consume a couple tens of Mb.

The individual process inside the vm might not consume much, but the vm itself might reserve some GBs of memory. Try looking at how much memory `vmmem` process used in task manager.
Post reply on HN