top | item 33625420

(no title)

laxis96 | 3 years ago

I have yet to find an use case for WSL, when you can't interact with hardware devices and working with the filesystem has its (performance) limitations.

Docker in WSL2? Yeah sure, but I'd rather install a VM or connect to a remote Docker host.

MinGW/MSYS2 have been around far longer and have none of those issues... Then again, MSYS2 does not have a Linux kernel running under it but that shouldn't be a problem unless you want to run containers.

discuss

order

spiffytech|3 years ago

I love WSL because it makes Windows just as nice to use for development as Linux / macOS. No weird janky "this is buggy on Windows" stuff, because as far as the app is concerned it's just a Linux VM.

djfobbz|3 years ago

I've never looked back since WSL came out...I'm not promoting Windows but growing up in a corp environment, Windows is where my comfort zone was...I tried switching to Textmate on Mac back in 2007 but really hated not having a direct map of various shortcut commands using CTRL key. The closest I got to this Win experience was on Linux Mint using XFCE...but again, it was pain anytime I was sent MS Office docs. Sublime/WSL has been my goto since it dropped! Slowly getting used to VSCode as well.

jefftime|3 years ago

I'm not sure why you're being down voted. This is my exact use case as well. For what I do (front end development) it's incredibly nice to have a Linux command line for most things. I'm stuck on Windows due to legacy .NET Framework apps, so when I have to dip back into Windows I can

veesahni|3 years ago

With WSL2 I got rid of VM's for local development.

Cross OS filesystem performance is poor. The solution is to keep everything within WSL. Code stored, built & edited in WSL.

VSCode + WSL extension makes it possible to "edit" from host without loosing performance.

coldacid|3 years ago

>With WSL2 I got rid of VM's for local development.

No you didn't, you just let Windows hide them from you. WSL2 is essentially a Hyper-V VM running Linux with some programs bridging between it and the Windows host -- or two such VMs with some additional bridging (for Wayland and audio) if WSLg is enabled.

CoolCold|3 years ago

Interop adds some value, i.e., from Windows side

    PS C:\Users\coolcold> netsh wlan show interfaces|wsl -- fgrep Mbps
        Receive rate (Mbps)    : 121.5
        Transmit rate (Mbps)   : 121.5
or, from WSL side, you can invoke Explorer for current folder via simple

    explorer.exe .
or notepad ..or..

Longhanks|3 years ago

Imagine spinning up a whole Linux VM to filter some text.

In all seriousness though, is there a reason ripgrep doesn’t suffice?

sz4kerto|3 years ago

> but I'd rather install a VM

WSL is a proper VM, just managed very efficiently by Hyper-V.

> the filesystem has its (performance) limitations

It's a normal Linux filesystem, there's no difference in performance vs. a full-fledged Linux VM. (which it is anyway)

Are you referring to WSL1?

pxc|3 years ago

> > the filesystem has its (performance) limitations

> It's a normal Linux filesystem, there's no difference in performance vs. a full-fledged Linux VM. (which it is anyway)

> Are you referring to WSL1?

WSL2 just exchanged the performance problems with the Linux guest environment's native filesystem for performance problems when the Linux guest accesses Windows' filesystem. Those are still there and they're still atrocious.

cowmix|3 years ago

I've done A LOT of performance tests of running ML tasks (via Docker) on WSL vs raw Ubuntu on the same hardware. The performance of WSL is about the same as native - some tasks are actually faster, some slower -- but net out to be the same. These tasks include: compiling a Docker image (1 hour), deinterlacing video with a NN, Open Whisper, etc.

matsemann|3 years ago

Filesystem things are faster in WSL+Docker than native Windows for me. At least npm stuff. I'd rather skip the hassle of VM, and why use a remote Docker host? And same with MinGW. I like being able to just do stuff out of the box as if it was an Ubuntu install. Much more ergonomic, and can just follow whatever official guide for the tool I'm trying to use, without depending on someone making it possible to use in MinGW/MSYS.

So I kinda disagree, for all things you mention I prefer WSL.

ziomek77|3 years ago

Same here, Docker for windows is slow, like VERY slow. After I moved Docker to WSL2 my app is starting and running at least 10 times faster. The difference is so huge that I wonder why it is even possible to use Docker natively on Windows file system. It's crazy. I'm talking 60-90 seconds to bootstrap and run each page each time under Windows filesystem to around 5s (yes the app is very slow) under WSL2

mfer|3 years ago

WSLv2 (which you need for Docker) is a VM. Windows just manages it for you.

rr888|3 years ago

Its crazy, I've gone in circles between WSL, dual boot win/linux, VMs, everything on windows, remote linux servers, containers in Docker Desktop. Right now I'm back to just using Windows and ignoring Linux altogether, which seems to work best with the exception of Python.

skrowl|3 years ago

Windows desktop with full linux servers via SSH is the sweet spot for me.

I don't EVER find that I need some kind of *nix command on my local machine when developing, but that's also because I'm not afraid of PowerShell / stuck on bash.

pram|3 years ago

I use WSL2 for pytorch and company because the newer (WSL) kernel has CUDA support oob if you have the nvidia drivers installed on the Windows side. It’s actually extremely convenient.

atseajournal|3 years ago

Dug up my login for this site to thank you for this bit of info -- I'd been idly wanting to try some GPU-powered python scripts, and the setup on Windows made it unappealing. Now I can use 'em!

pxc|3 years ago

Earlier this year, I started a job where I had to use a Windows desktop for the first time in a little over a decade. For a while, I did as little in WSL as possible, and leaned hard on PowerShell, MSYS2, and Scoop. After a few months, I abandoned the 'native' tools in favor of WSL due to performance and compatibility issues. I wish MSYS2 were the solution, because at least then there'd be one (WSL sucks too).

w4rh4wk5|3 years ago

I am still on WSL1 due to the filesystem performance with WSL2. I recently tried to move more of my workflow towards MSYS2 but various things keep breaking for me without obvious reasons.

Latest issue I encountered was that GNU parallel simple does not work. [1]

[1]: https://github.com/msys2/MSYS2-packages/issues/3289

anderspitman|3 years ago

What I'm excited about is the prospect of nontechnical people being able to use a GUI like Docker Desktop to install and manage apps in a nicely sandboxed environment. I think Docker is still too targeted towards developers, but Docker Desktop is already a huge step forward in usability for people who aren't comfortable on the command line.

pxc|3 years ago

Are you imagining something like Flatpak for Windows? Don't Microsoft Store apps have some sandboxing? What's the end goal with the non-developer use case you have in mind?

polyvisual|3 years ago

I can `tail -f` a file on windows. That's enough use case for me :D

layer8|3 years ago

For regular command-line stuff, Cygwin is very nice.

skrowl|3 years ago

In PowerShell:

Get-Content -Path Filepath -Tail <int>

rr888|3 years ago

wintail/baretail actually works great.

jxdxbx|3 years ago

I am not a developer but I find it useful to just be able to use rsync and a few other tools I am used to from Mac and Linux. Same reason I install Homebrew on Mac.

nailer|3 years ago

> Docker in WSL2? Yeah sure, but I'd rather install a VM

You just did.