News for hackers. Stuff that matters.
Re:WSL2 corrupting Git repositories and shell history by icegreentea2 on Saturday January 02, 2021 @10:02AM (#25613232)
I use a mix of WSL2, and VMs. WSL2 has a few nice properties for some use cases:

a) It comes default with some network binding magic (ok, just configuration) that makes your WSL env almost actually behave like localhost. I know you can configure this yourself, but it's nice out of the box. (on the other hand, sometimes is this exactly the opposite of what you want...)

b) My main machine is a bit RAM constrained, and WSL2 will "magically" reclaim RAM when I close the consoles (unless I left something running...). Once again, not the biggest win, especially if you spec'd out your machine to run VMs, but still nice.

I think WSL2's biggest wins are not for 'full out development'. But it's nice when you need want to jump in and poke at something quickly in Linux land. The startup time for the console/VM is fast enough (~1-2 seconds), and the cleanup is good enough I can quickly jump between, without having a VM actually hanging around all the time.

I'm sure the file system integration is useful for some usecases... classic one would be if someone emails you data files or something. You download in your browser in Windows and then can access pretty seamlessly from WSL.

I think I would summarize WSL's advantages as being a bunch of little quality of life advantages that are very much suited for Windows dominant workflows that periodically jump into Linux.

There are all sorts of other disadvantages though - I would not recommend anyone who has a comfortable VM based workflow to ditch for WSL. An example of an uncomfortably stupid rough edge would be periodically time-desyncing: https://github.com/microsoft/WSL/issues/4149 . I shit you not, my workaround is to manually adjust my linux time forward and back with `sudo date --set "${INCREMENT} seconds" until it gets close enough that OAuth doesn't shit itself.

Re:WSL2 corrupting Git repositories and shell history by shawnz on Saturday January 02, 2021 @11:48AM (#25614048)
Have you tried WSL1? It sounds like it might fit your use cases better:

- WSL1 shares the same network interfaces and addresses as the host, no proxying like WSL2

- Significantly less RAM usage

- No time sync bug

Re:WSL2 corrupting Git repositories and shell history by icegreentea2 on Saturday January 02, 2021 @02:17PM (#25615517)
Oh, I use both =P

I use WSL2 for some docker based projects.

Re:WSL2 corrupting Git repositories and shell history by riku_iki on Saturday January 02, 2021 @12:58PM (#25614738)
Also, I think WSL2 is currently only way to access GPU through Cuda API from the guest linux.
Re:WSL2 corrupting Git repositories and shell history by freeone3000 on Saturday January 02, 2021 @01:30PM (#25615060)
Hyper-V can also do PCI pass-through if you have a compute card to assign to the guest. If you're just running the one card, though, you need WSL2 to handle the sharing.
Re:WSL2 corrupting Git repositories and shell history by riku_iki on Saturday January 02, 2021 @01:35PM (#25615103)
Additionally Win Pro is needed for Hyper-V, while WSL2 can be used in lower level Win versions.