News for hackers. Stuff that matters.
Re:Windows Subsystem for Linux 2.0 release by timost on Tuesday September 19, 2023 @12:25AM (#37565595)
This release improves memory management (automatic reclaim) and network compatibility.
Re:Windows Subsystem for Linux 2.0 release by jw_cook on Tuesday September 19, 2023 @12:52AM (#37565723)
Fantastic! Lack of memory reclaim is one of my main gripes with WSL, so I'm really pleased to see this.
Re:Windows Subsystem for Linux 2.0 release by nikau on Tuesday September 19, 2023 @01:22AM (#37565876)
You can dump caches in current wsl2, you just have to dump a value into a /proc file to trigger it
Re:Windows Subsystem for Linux 2.0 release by dataflow on Tuesday September 19, 2023 @12:58AM (#37565753)
So this is WSL2 2.0?
Re:Windows Subsystem for Linux 2.0 release by kraig911 on Tuesday September 19, 2023 @01:40AM (#37565962)
I'm confused on this as well. (I almost said I'm confused on this 2)

Joke aside... I am still confused.

Re:Windows Subsystem for Linux 2.0 release by dataflow on Tuesday September 19, 2023 @01:43AM (#37565980)
I feel like they're competing with USB version numbers.
Re:Windows Subsystem for Linux 2.0 release by kyriakos on Tuesday September 19, 2023 @12:58AM (#37565756)
And disk reclaim with sparse vhd
Re:Windows Subsystem for Linux 2.0 release by threatripper on Tuesday September 19, 2023 @12:58AM (#37565758)
The naming causes some confusion to me. I thought there was WSL and then they released WSL2 quite some time ago. Is this WSL1 version 2 or WSL2 version 2?
Re:Windows Subsystem for Linux 2.0 release by Reubend on Tuesday September 19, 2023 @01:04AM (#37565792)
Seems to be WSL 2 v2.0 if I'm understanding correctly. I agree that it's very badly named.
Re:Windows Subsystem for Linux 2.0 release by corbezzoli on Tuesday September 19, 2023 @01:07AM (#37565805)
Taking inspiration from USB
Re:Windows Subsystem for Linux 2.0 release by Semaphor on Tuesday September 19, 2023 @01:26AM (#37565902)
Microsoft being bad with naming/versioning things? Wow.

Totally made up conversations about choosing Entity Framework version numbers: https://blog.oneunicorn.com/2020/03/26/numbersarehard/

Re:Windows Subsystem for Linux 2.0 release by DiabloD3 on Tuesday September 19, 2023 @01:21AM (#37565864)
Its both, WSL1 and 2 are both part of WSL.

Think of this as, kinda, the userland tools for WSL.

Re:Windows Subsystem for Linux 2.0 release by deaddodo on Tuesday September 19, 2023 @01:05AM (#37565797)
WSL2 supplanted WSL. It's a different (but similar) technology with the same (albeit, confusing) name, not a version bump.

This release refers to WSL2 version 2.0.

Re:Windows Subsystem for Linux 2.0 release by creakingstairs on Tuesday September 19, 2023 @01:10AM (#37565820)
Does MS have an internal memo or something that directs teams to make versions/names not go up linearly?

E.g. .net framework/core, xbox, windows and now WSL

Re:Windows Subsystem for Linux 2.0 release by sverhagen on Tuesday September 19, 2023 @12:59AM (#37565762)
Following it from a distance, I think WSL has been a very exciting development on Windows. It's really something I would probably have enjoyed more upclose, had I not, you know... moved to Ubuntu altogether :)
Re:Windows Subsystem for Linux 2.0 release by wtallis on Tuesday September 19, 2023 @01:03AM (#37565787)
... Not to be confused with WSL 2, the VM-based successor to WSL 1's tighter integration of Linux binary compatibility into NT. Both WSL 1 and WSL 2 seem to still be delivered as part of the package that has just reached version 2.0.0, though it doesn't seem WSL 1 is getting much (if any) work these days as it's considered a technological dead-end.

(And in case anyone's interested, it appears WSL 2 was added before this package reached 1.0)

Re:Windows Subsystem for Linux 2.0 release by winternewt on Tuesday September 19, 2023 @01:47AM (#37566000)
I'm confused. Is this WSL1 version 2.0? Or WSL2 version 2.0?
Re:Windows Subsystem for Linux 2.0 release by tapoxi on Tuesday September 19, 2023 @01:53AM (#37566035)
This is WSL version 2.0 which contains WSL 1 and WSL 2, and though it's a Windows Subsystem for Linux it's actually a Linux Subsystem for Windows.

How are they so bad at naming things?

Re:Windows Subsystem for Linux 2.0 release by oktoberpaard on Tuesday September 19, 2023 @02:24AM (#37566252)
With WSL 1 there is no Linux involved, it’s a Windows subsystem to handle Linux system calls with the NT kernel. I sort of get the name in that regard.

WSL 2 is just a tightly integrated VM running a real Linux kernel, and the name makes no sense there.

Re:Windows Subsystem for Linux 2.0 release by thefz on Tuesday September 19, 2023 @05:50AM (#37567546)
> This is WSL version 2.0 which contains WSL 1 and WSL 2, and though it's a Windows Subsystem for Linux it's actually a Linux Subsystem for Windows.

100% agree; I explain the current name to myself as "Windows offering a subsystem to run Linux into".

> How are they so bad at naming things?

See the whole .NET Core

Re:Windows Subsystem for Linux 2.0 release by hx8 on Tuesday September 19, 2023 @01:52AM (#37566031)
Or is WSL 1 and WSL2 shipped in a package called "WSL" that just reached version 2.0
Re:Windows Subsystem for Linux 2.0 release by wtallis on Tuesday September 19, 2023 @01:52AM (#37566028)
The answer is either no, or both.
Re:Windows Subsystem for Linux 2.0 release by cloudking on Tuesday September 19, 2023 @01:09AM (#37565815)
Developing code in the same OS you play Baldur's Gate 3 in is the real win. Thanks Microsoft
Re:Windows Subsystem for Linux 2.0 release by satvikpendem on Tuesday September 19, 2023 @01:37AM (#37565951)
I wonder which is better, WSL with native gaming, or native Linux with virtualized gaming via WINE and Proton. I suspect both solutions will reach parity in the next ten years.

Now if only I could run macOS with full GPU acceleration on Windows or Linux without needing a separate GPU, then I wouldn't need a Mac for the few times I develop and build for iOS.

Re:Windows Subsystem for Linux 2.0 release by CoolCold on Tuesday September 19, 2023 @05:56AM (#37567590)
Some people afair run hackintosh inside KVM in WSL2, may be that's what you need
Re:Windows Subsystem for Linux 2.0 release by satvikpendem on Tuesday September 19, 2023 @09:15AM (#37569506)
No GPU acceleration through that, unless something recently changed.
Re:Windows Subsystem for Linux 2.0 release by pynappo on Tuesday September 19, 2023 @01:12AM (#37565828)
bg3 runs very well on Linux for me through proton, fwiw. Definitely a great feature though, especially if you can't be bothered to dual boot.
Re:Windows Subsystem for Linux 2.0 release by Zardoz84 on Tuesday September 19, 2023 @01:29AM (#37565922)
I'm doing exactly that on Debian. And I have a better experience. That it'¡s the real win
Re:Windows Subsystem for Linux 2.0 release by tomohelix on Tuesday September 19, 2023 @01:09AM (#37565819)
Honestly, whoever convinced Microsoft to make Linux run in windows was a genius. I would have seriously considered a Mac had they not done this. It just opens so many possibilities in Windows for me and all of it is so easy and simple to setup.
Re:Windows Subsystem for Linux 2.0 release by dboreham on Tuesday September 19, 2023 @01:21AM (#37565868)
Yes, although that person probably retired long ago since the idea dates back to 1990 or so (NT Posix subsystem). The difference in modern times is someone convinced them to make it usable.
Re:Windows Subsystem for Linux 2.0 release by smackeyacky on Tuesday September 19, 2023 @03:46AM (#37566755)
I might be remembering this wrong, but the posix additions to NT were done to fulfill a US defence department condition for bidding on systems[0]. They were never really useful in the same way that WSL is.

[0] https://en.wikipedia.org/wiki/Microsoft_POSIX_subsystem

Re:Windows Subsystem for Linux 2.0 release by byteCoder on Tuesday September 19, 2023 @03:01PM (#37574682)
At the time NT came out, it wasn't 100% POSIX compliant, but close enough for government work.

One stipulation in NT's subsystem at the time was that fork() needed to be followed by exec().

Re:Windows Subsystem for Linux 2.0 release by holri on Tuesday September 19, 2023 @01:15AM (#37565839)
https://www.cygwin.com/ is available since 1995
Re:Windows Subsystem for Linux 2.0 release by CJefferson on Tuesday September 19, 2023 @01:17AM (#37565846)
Cygwin was a great tool, and I've released some software which used cygwin, but almost all large programs ended up needing cygwin-specific patches (I maintained quite a few myself), while WSL2 (which is just a fancy VM), in my experience offers 100% linux compatibility, I've never had any issues with it except some VPN-related internet problems.
Re:Windows Subsystem for Linux 2.0 release by rstuart4133 on Tuesday September 19, 2023 @01:44AM (#37565984)
> I've never had any issues with it except some VPN-related internet problems.

I've had to support a development environment that ran on WSL2, among other things. I regularly had developers attempt to start work in the morning only to find an overnight WSL2 update from Microsoft rendered their WSL2 instance unusable. It typically took a few hours of uninstalling / reinstalling to fix it. But in at least one case after a series of these incidents that cumulated in them spending a day trying to get it going they gave up and switched to Ubuntu.

The only reason I'd use WSL2 over a real Linux install for Linux development is because of ISO 27001 / SOC 2 restrictions pushed from above. I don't have a clue why people would do it voluntarily. It's not only a fragile and incomplete implementation (especially on the networking side), it's also noticeably slower.

Re:Windows Subsystem for Linux 2.0 release by Falmarri on Tuesday September 19, 2023 @02:06AM (#37566115)
Absolutely this. It's usable, but just barely, and not even close to a replacement for a real linux system
Re:Windows Subsystem for Linux 2.0 release by CoolCold on Tuesday September 19, 2023 @05:34AM (#37567473)
While my observation is mostly limited to my laptop and couple of friends, I must day that both of those laptops are on Windows Insider, not even stable branch and I probably can remember couple of minor issues over last 3 years with WSL2, nothing like you described
Re:Windows Subsystem for Linux 2.0 release by redox99 on Tuesday September 19, 2023 @01:47AM (#37565996)
Cygwin isn't remotely comparable in terms of compatibility. With WSL2 I can train stuff with PyTorch with GPU acceleration without configuring anything. Try doing that with cygwin.
Re:Windows Subsystem for Linux 2.0 release by prirun on Tuesday September 19, 2023 @12:18PM (#37572199)
> Honestly, whoever convinced Microsoft to make Linux run in windows was a genius.

Embrace.

Re:Windows Subsystem for Linux 2.0 release by CJefferson on Tuesday September 19, 2023 @01:11AM (#37565824)
I'm going to wait a while to see how the new VPN stuff works out. Previously WSL2 didn't work with a Windows VPN without an extra tool ( https://github.com/sakai135/wsl-vpnkit ), hopefully this might fix things, but not going to risk trying it in case it breaks everything.
Re:Windows Subsystem for Linux 2.0 release by bafe on Tuesday September 19, 2023 @01:24AM (#37565895)
This is the most painful aspect of WSL2: if your org forces you to use a VPN your WSL2 is almost totally isolated from the network. Interestingly we have the same problem with our VPN and docker
Re:Windows Subsystem for Linux 2.0 release by CJefferson on Tuesday September 19, 2023 @01:26AM (#37565906)
If you haven't looked at it, look at the wsl-vpnkit (I mentioend above). Your org might not like it of course, but I found it fixed all my VPN-related issues (it's just another linux install you run as part of WSL2, which somehow connects everything together and by magic lets me get on the internet fine).
Re:Windows Subsystem for Linux 2.0 release by bafe on Tuesday September 19, 2023 @03:44PM (#37575368)
I do use it and it works. Luckily I also got a full Linux PC for when I work from home, therefore I only need WSl the few times I am going to the office. The main issue now is the VPN messing up with routing and making containers inside WSL inaccessible from outside. Unfortunately wsl-vpnkit couldn't help there...
Re:Windows Subsystem for Linux 2.0 release by hackandthink on Tuesday September 19, 2023 @01:50AM (#37566015)
Podman user mode networking may help.

--user-mode-networking

https://docs.podman.io/en/latest/markdown/podman-machine-ini...

Re:Windows Subsystem for Linux 2.0 release by AndrewDavis on Tuesday September 19, 2023 @01:24AM (#37565892)
Please correct me if I'm wrong. This isn't a release but a "re-release" right? So only available to those on Windows insider update train?

Putting that aside. I am quite excited about the mirror network change. My big annoyance when I moved from WSL1 to WSL2 was that a service run inside WSL wasn't available to the my LAN. It made sense why it didn't, WSL2 is a hardware VM so you weren't binding on the hosts networking stack like WSL1, but it was still annoying.

Re:Windows Subsystem for Linux 2.0 release by bakugo on Tuesday September 19, 2023 @01:27AM (#37565908)
Let me guess, they still haven't fixed the sleep/hibernation bug that has been present for many years?
Re:Windows Subsystem for Linux 2.0 release by grumpyprole on Tuesday September 19, 2023 @01:41AM (#37565969)
This bug makes WSL a pain to use on laptops. I hope it's fixed!
Re:Windows Subsystem for Linux 2.0 release by ssdspoimdsjvv on Tuesday September 19, 2023 @01:49AM (#37566009)
Which bug is that?
Re:Windows Subsystem for Linux 2.0 release by timost on Tuesday September 19, 2023 @01:55AM (#37566045)
I think it's this bug https://github.com/microsoft/WSL/issues/8696

A real nightmare.

Re:Windows Subsystem for Linux 2.0 release by bakugo on Wednesday September 20, 2023 @01:47AM (#37580782)
There are several issues in the repo related this bug, here's another one with over 500 comments:

https://github.com/microsoft/WSL/issues/6982

Almost 1000 total comments between both of these and basically no acknowledgement from microsoft.

Re:Windows Subsystem for Linux 2.0 release by idatum on Tuesday September 19, 2023 @01:30AM (#37565926)
Biggest potential I see with this update is IPv6 support.
Re:Windows Subsystem for Linux 2.0 release by baq on Tuesday September 19, 2023 @01:41AM (#37565968)
> experimental.networkingMode - A new networking mode for WSL that adds new features and improves network compatibility

> experimental.dnsTunneling- Changes how WSL resolves DNS requests to improve network compatibility

> experimental.firewall- Applies Windows firewall rules to WSL, and allows for advanced firewall controls for the WSL VM

> experimental.autoProxy- Makes WSL automatically use the proxy information from Windows to improve network compatibility

Had to work around these back in 2020-ish… finally a way to run WSL2 with Cisco VPN without horrible hacks? Fantastic!

Re:Windows Subsystem for Linux 2.0 release by WirelessGigabit on Tuesday September 19, 2023 @02:22AM (#37566237)
If the only VPN that has issues is Cisco's VPN, then Cisco is the problem, not WSL2.
Re:Windows Subsystem for Linux 2.0 release by baq on Tuesday September 19, 2023 @02:33AM (#37566326)
Maybe. Cisco VPN predates wsl by a couple millennia, so it’s hard to say who’s at fault here.

Not sure about other corporate VPN providers, haven’t used them. I wouldn’t be surprised if others have similar issues.

Re:Windows Subsystem for Linux 2.0 release by smackeyacky on Tuesday September 19, 2023 @03:54AM (#37566805)
Wsl-vpnkit is what we use so we can work with horrible proxy setups. It works well.
Re:Windows Subsystem for Linux 2.0 release by baq on Tuesday September 19, 2023 @05:10AM (#37567292)
Guess that makes me a dinosaur, I had to parse the WPAD in shell/awk to get anything working and haven't looked after that ;)
Re:Windows Subsystem for Linux 2.0 release by fabian2k on Tuesday September 19, 2023 @01:43AM (#37565978)
The ability to release memory could be very useful. WSL2 works very well for me in general, but on a Notebook without excessive RAM it can be problematic for some use cases. Anything that has large spikes in memory usage can be seriously annoying as that memory won't be released in the current WSL2.
Re:Windows Subsystem for Linux 2.0 release by smokel on Tuesday September 19, 2023 @01:46AM (#37565991)
As others mention, the versioning scheme is confusing. I'd like to add that I found even the name confusing, as I initially thought that this would allow some parts of Windows to run on Linux.

"Linux Subsystem for Windows" would have made a lot more sense to me.

Re:Windows Subsystem for Linux 2.0 release by threatripper on Tuesday September 19, 2023 @01:54AM (#37566039)
Actually WSL doesn't contain any Linux at all because "Linux" originally refers to the Linux Kernel and usually GNU/Linux refers to a system using Linux as a kernel but GNU software for the userspace. So, the Name should rather have been something like "Windows Subsystem for Posix Programs" which doesn't quite sound so good.
Re:Windows Subsystem for Linux 2.0 release by smokel on Tuesday September 19, 2023 @02:06AM (#37566116)
This was true for WSL1, but WSL2 does contain a Linux kernel. The source code for it is available at:

https://github.com/microsoft/WSL2-Linux-Kernel

Re:Windows Subsystem for Linux 2.0 release by Falmarri on Tuesday September 19, 2023 @02:06AM (#37566111)
Ok, how do I actually install this? `wsl --update` says I'm up to date, but wsl --version` shows `WSL version: 1.2.5.0`.
Re:Windows Subsystem for Linux 2.0 release by TheSmiddy on Tuesday September 19, 2023 @07:50PM (#37578696)
I also had this same issue and found this on the official microsoft blog which also contains info on how to actually enable the new features.

wsl --update; wsl --update --pre-release

https://devblogs.microsoft.com/commandline/windows-subsystem...

Re:Windows Subsystem for Linux 2.0 release by mythz on Tuesday September 19, 2023 @02:32AM (#37566320)
I've been a big fan of WSL, which has kept me on Windows for years more than I otherwise would have. But I'm not a fan of the trend of Windows turning into an adware hosting platform so intend to move to macOS for my primary Desktop after Apple release their next M3 hardware.

As a .NET Developer I bought a new M2 Macbook Air to test the feasibility of moving to ARM/Apple Silicon and was pleasantly surprised that all the software I used daily had native builds that worked OOB [1]. I was also able to run Windows 11, Ubuntu and Fedora ARM OS's with UTM [2], which lets me access Windows should I ever need to.

As nice as WSL is, it's not as nice as having a native Unix terminal as it still feels like your living in 2 different worlds. It's always going to be uncanny valley where you need to install software tools twice per OS (and upgraded in-sync) and the cross-OS file system performance is so unusably slow that it may as well not exist as you're basically forced to check out repos in each filesystem. Also ran into a number of situations where building and using WSL tools isn't as well supported as Linux/macOS.

By contrast everything I tried to install seemed to work on macOS, where I was able to build and try out LadyBird Browser's new native macOS UI [3] and install all the tools I needed run and test out local AI workflows [4], e.g. this command below uses ffmpeg to capture 5s of microphone recording, uses OpenAI's whisper to transcribe the audio to text, uses curl to send it to a remote API to generate an LLM prompt, that gets executed with a local install of Llama2 7B:

    ffmpeg -f avfoundation -i ":1" -t 5 order.mp3 \
    && whisper --language=en --fp16 False --output_format txt order.mp3 \
    && curl --get --data-urlencode "userMessage=$(cat order.txt)" \
    https://coffeeshop.netcore.io/coffeeshop/prompt | llm -m l2c
Maybe you can achieve similar functionality in Windows/WSL, but it's nicer when all the tools you want to use just works natively.

[1] https://servicestack.net/posts/postgres-mysql-sqlserver-on-a...

[2] https://mac.getutm.app

[3] https://twitter.com/awesomekling/status/1694954938395202031

[4] https://servicestack.net/posts/building-typechat-coffeeshop-...

Re:Windows Subsystem for Linux 2.0 release by throwaway798214 on Tuesday September 19, 2023 @04:54AM (#37567180)
WSL1 is what keeps me on Windows - but I don't understand why they keep calling WSL2 "WSL" as it has nothing to do with the traditional "Windows service for XXX" model. For better or worse WSL2 is just a virtual machine, nothing else, while WSL1 actually integrates with the underlying Windows with a single network stack etc.
Re:Windows Subsystem for Linux 2.0 release by kyriakos on Tuesday September 19, 2023 @04:57AM (#37567205)
Been using wsl2 for development for a long time I don't see how it's not integrated enough with windows. For my use case it seems completely transparent to the fact that it's running in a vm.
Re:Windows Subsystem for Linux 2.0 release by throwaway798214 on Tuesday September 19, 2023 @05:12AM (#37567314)
Separate network stacks? Separate filesystems? Separate processes and memory allocation? With WSL1 processes started from WSL console appear on Windows Task manager and starting a network daemon on WSL1 uses the Windows network stack and firewall. There's no NAT, no bridging and no VPN problems as you truly are running just a single operating system. WSL2 using but not releasing memory? Not a problem with WSL1 as it doesn't allocate any memory, it just runs processes on top of Windows kernel.

Of course WSL1 has it's limitations as it's not Linux but Windows with Linux userland - anything that touches the Linux kernel directly pretty much doesn't work (like loop mounts etc).

Re:Windows Subsystem for Linux 2.0 release by hs86 on Tuesday September 19, 2023 @05:17AM (#37567362)