DEV Community

weppami
weppami

Posted on

WSL2, who is it for ?

What is a developer scenario where it would be more productive/efficient using WSL2 rather than vanilla Win10 ?

Top comments (6)

Collapse
 
habereder profile image
Raphael Habereder • Edited

Pretty much anything that requires Linux.
Sure, you could fire up Hyper-V and install a VM, but who wants to do that?

I've been working with WSL 1 for a few years now and can't wait for WSL2 to go GA.
I can't go without it anymore.
Most of the time, I need windows for some stupid business-apps that don't seem to know linux even exists or that cross-compiling is a thing.

But I do prefer to develop on linux, since the cli is so much faster than any shiny UI and their stupidly long mouse-paths.
Not to mention that most tools on linux simply work better/faster/more reliably.

So I guess it's for weirdos like me, that don't want to dual-boot/waste resources for VMs, must have most of both worlds on hand at any time and somehow want to shoehorn linux into their windows-workflow.

Or in short, people that actually want a fully fledged Linux, but are bound to windows for any stupid reason :D

Collapse
 
derkoe profile image
Christian Köberl

Agree! One of the top reasons is performance - a npm install on a typical fronted app will be at least twice as fast on Linux. See my article on WSL 2 on some reasons and how to setup a dev environment

Collapse
 
weppami profile image
weppami

Thanks, I was not thinking about cross-compiling, that's a good point.

Collapse
 
ahferroin7 profile image
Austin S. Hemmelgarn

It's not even just cross-compiling. I use WSL1 semi-regularly just for the ability to use sensible command-line tools when working with text files. There are no easy to use equivalents to grep or sed on Windows unless you're dealing with a full-fledged IDE, and quite often that's well beyond overkill for what I'm doing.

On a slightly separate note though, Docker for Windows is pivoting to utilize WSL2 instead of a custom VM as the environment for running containers so that it can leverage a number of the features WSL2 provides (like dynamic memory allocation) to improve upon the ability to run Linux containers on Windows.

Thread Thread
 
weppami profile image
weppami • Edited

Thanks Austin.
Actually gitbash on windows has all the common linux commands like grep or sed or awk, etc and with just 5 minutes tweaks its terminal can be more than decent and you can add it to the new windows terminal.
Gitbash terminal
Docker and WSL2 are now working well together but I experienced some hiccups with vscode integration.
What kind of containers are you normally deploying for your dev workflow ?

Thread Thread
 
ahferroin7 profile image
Austin S. Hemmelgarn

Actually gitbash on windows has all the common linux commands like grep or sed or awk, etc and with just 5 minutes tweaks its terminal can be more than decent and you can add it to the new windows terminal.

While true, it's still less flexible than WSL in that you can run most distros in WSL and have access to almost all of the packages in their repositories. That level of flexibility is huge in some cases when compared to the Git for Windows environment.

Docker and WSL2 are now working well together but I experienced some hiccups with vscode integration.

Well, it is still listed as experimental last I saw. I can't comment on VSCode integration though as I just don't use VSCode (I much prefer Vim).

What kind of containers are you normally deploying for your dev workflow ?

Directly in Docker for Windows? None actually. All of the stuff I do with any regularity development-wise needs a Linux environment to work from (in almost all cases, I'm using Docker for a reproducible build environment and nothing more, and my build systems are generally Linux dependent). On the rare occasions I can't reboot into Linux on my laptop to work on such things, I use WSL and run any containers I need to run on my home-server system.