I've been using WSL2 for over a year every day. I do game development on Windows and web development on WSL2. I use it for big production apps and various setups including Docker. Although WSL2 has some rough corners and bugs it's been a miracle tool in terms of unifying my workflow with a single computer.
I agree and use it now. Git-Bash was just too slow. Also I found using a workspace container (docker run -it --rm rwxrob/workspace) did not have the OpenConnect firewall bug issues.
This was fixed as of January 2022, along with several other issues. The big issue now is how IPs are assigned from Win Home to Win Pro, with Pro using Hyper-V and allowing for default network addressing (192.X), while Home versions default to 172.X addresses for "security measures". They suggest not trying to change it in Home, as it might break networking capability within the WSL2 framework; both versions allow for communication with the wider LAN, but there's definitely some tomfoolery afoot concerning ARP with WSL2 on Win Home Editions.
Disagree with "the whole point" is being able to exchange files between systems, but I respect the opinion and totally understand how WSL2 doesn't work for your case. WSL2 works amazingly well for me for having a fast development area where I need native Linux tools that integrate nicely with my host. You might think "integrate nicely" means sharing files and I wouldn't blame anyone for assuming that too, but I mean stuff like VS Code (remote plugin), Docker Desktop, Windows Terminal, etc. Could I just spin up my own box in a VM or something or just keep a container running? Sure. If I absolutely had to map drives between them then I would do that. But if you don't, then the trade-offs aren't worth it. I like my Windows machine because of all of its raw power and the ability to play some games every once in a while. If I was able to actually do real iOS development I would be 100% happy with Windows+WSL2. Again - not a counterpoint to your argument. WSL2 is clearly not good for your use-case (I'm particularly clueless on how the VPN stuff would work) -- but for me, oh man, it's perfect and I love it. I do mostly Go and Node development.
Good points. But with WSL2 you cannot `docker commit` your setup and back it up and use it elsewhere. Also, pure docker containers are confirmed to *not* have the firewall bug. I use one every day now. We did discover, unfortunately, that you cannot really install Docker on Windows *without* WSL2 now (even if you never use it). It's a prereq. I keep hoping I'm wrong, but everyone is reporting this.
same honestly. i've had 95% good experiences with WSL2, and the 5% bad have been fairly easy enough to solve. granted, i don't use a VPN or anything like that, and i'm mainly just a hobbyist who likes to tinker with anything and everything, so installing linux on top of windows in such a 'native' way was a no-brainer for me.
Hey! Great talk Rob! Congrats! As a Unix and infrastructure sysadmin trapped in my company's Windows laptop, I found myself struggling how to get bash running. I settle with Cygwin but then I ear some other people talking about WSL2. I asked management for a special temporary (about 2 days) permission to get admin privileges and installed WSL2. It *sucks* as you very well mention! VPN is a huge pain and never solved. File permissions is nightmare too! I then return to Cygwin. Sometimes Cygwin lags while doing a simple 'ls -l' and I'm now switching to gitbash that I didn't know it was so nice! Hope it won't lag :) Installed podman on WSL2 but can't install it on Windows as it requires admin :( Happy vimming!
I guess i have just become very used to the windows file permissions incompatibility from all those years of cross mounting windows crated files in linux and vice versa, that I didnt even think wsl could provide an improvement here.
Docker will end up using the WSL2 anyway. You would have had a better experience if you stored the shared files in the linux files system, rather than the windows file system. Performance, permissions, etc. Let the windows file system handle windows files, linux handle linux. You can then access them with both.
Yep, I've accepted that you just have to have WSL2 even with the firewall bug. I get around that by running my rwxrob/workspace container from work, which uses network settings of host system (not WSL2) even though it leverages WSL2 for performance.
WTF are you talking about? sounds look you are using Windows wrong. You dont need additional VPN on your WSL if windows host has VPN connected. All outgoing traffic from WSL is automatically NATed with host machine IP.
There is a known bug with OpenConnect that has firewall issues and a workaround. It has a issue thread if you care to find it. Ironically, running a linux container from wsl2 (mounting /var/run/docker.sock) does *not* have the issues for the reasons you submit (using the host VPN).
I also wasn't so fond of WSL2 so I instead use Clink (for vi-mode line editing) + cmd.exe + Windows Terminal. With this setup, most of my muscle memory is still useful and I also get a native-feeling Windows experience without any impedance mismatch.
The risk here is that since there's probably at least an order of magnitude more Windows users than Linux users, people might start to think the brokeness of WSL2 is just the way things should be.
Do u use cmer or git bash? I still come with issues setting up eg my windows ide with cmder. Some programks like mkdir are slightly different, and eg webstorm uses cmd.exe if u use ide runner and no way to change it
I have heard of some people having dumped Linux because of WSL(2). Sadly, it is false competition, Linux is not legally allowed to embed the necessary Windows-code but MS can put everything of Linux on Windows.
Dumping Linux because of WSL2 is tragic. Makes you wonder how Apple got away with it, until you realize "oh yeah, BSD" The great news is you never have to use WSL2. Docker containers that can be committed and backed up and don't have the firewall bug work fine even if they require WSL2 to be installed.
Really? I understand using WSL 2 because it's convenient in certain circumstances but dumping Linux? I would argue that anyone that dumped Linux for WSL was never really invested in Linux. Also, I'm hoping Eric Raymond's prediction comes true where Linux consumes Windows from the inside out.
@@ryanleemartin7758 I can see it happen with developers who use Linux for development (it just is better for it, Linux and FreeBSD) but also are addicted to certain Windows-only software. Dual-booting is not a great thing. I myself only use Linux on my desktop, Windows on a laptop when I really have to. Linux just is the better OS, it does not get in your way, it gives control to the user and it is better customizable. But there is this problem that some programs work better on Windows because they were developed for Windows. For example, for some reason I still have a horrible input-lag for the keyboard in the Steam-client (just the client, not the games), probably because they package it weird because it is not a problem on my system.
i love having wsl as a production tool without having to invest too many resources on a dedicated setup, but i completely agree about the files permission part, actually a complete clusterfuck. the worst part is that it's not even microsoft's fault, windows and linux file permissions are just incompatible. anyone that has had to setup a SMB server on linux has had to deal with this problem. and ironically, file permissions is maybe one of the very few designs where i'd say linux has it worse than windows, when you think about it if linux permissions were windows-like there might not even be a reason to have to run security features like SELinux.
Every OS on planet (except windows) are following those file permissions. Those aren't specific to linux, those are standards (en.wikipedia.org/wiki/POSIX) that every OS on planet (except windows) is trying to follow.
@@sunnymishra5678 every OS on the planet is using legacy file permissions from half a century ago. these are not standards, these are just a bad way to do permissions someone came up with a long, long time ago, which just happened to be copied by every other UNIX OS a long, long time ago. windows uses proper ACL rules. every other OS doesn't, which is why we have the nightmare that is SElinux. imagine a world without needing to have SElinux, that's windows file permissions.
Ever since they announced the switch from WSL1 to 2 I was bother... because now it's just a worse VM. I gave up on using it after all distros I tried in a setup would have internet connection and there was simply no way to troubleshot it
Love this conversation! Microsoft’s aggressive licensing in the early days cemented their place in the enterprise for the Ops side of the house. Most end users are using Windows and the IT department spends much of their time administering those systems, its relatively easy to admin and monitor. This aggressive licensing also made it so many companies that build software for enterprise use build an application that runs on Windows. Truthfully Linux distros put more control in the users hands so if you are a developer thats the system you should use or even if you are in Ops or a courageous (willing to learn new things) end user. Personally I don’t think variants of Ransomware would wreak as much havoc in organizations if more organizations ran Linux distros. How many are truly exploring this possibility? Probably not as many that should.
It was not only the aggressive licensing, MS also made a deal with OEM's to bundle Windows and MS Office wiht the laptops (that should not be allowed, this is coupled sales) and MS pushed schools to have MS Office on the computers by making that cheap for them, but not for individual licenses. I don't know if it still is true that Windows is easier to administer given how many problems people get with updates, security-patching, stuff breaking on Windows. It is not up to me to judge that, only experienced administrators who also master Linux and maintain both can judge this, but I do raise that question.
@@peterjansen4826 sure there are always bugs security patch role outs and more complicated issues that stem from proprietary applications that need to be pushed out. In general most industries are powering their computers on Windows OSs joined to a Domain (Active Directory) with the exception of big web-based tech companies who build their products on Linux distros and manage a custom built service like Google or Amazon. I agree with you in that I may be overgeneralizing by saying Windows Administration is easier but it is a whole lot easier to find Windows Administrators than it is to find skilled Linux administrators. This is why in most cases a Linux Administrator gets paid more from the start. Does this mean Windows is easier to learn? Please know that this doesn't mean I think Windows is better it's just what I've seen in my experience as a System/Network admin.
@@ltnlabs "but it is a whole lot easier to find Windows Administrators than it is to find skilled Linux administrators." That was exactly my point, to which extend is it about which is easier and to which extend is it about which is more admin-friendly? In theory with the file-permission and ownership system on Linux you have the tools which you need. But how many people are out there who are experienced with managing systems for Linux? I appreciate your input coming from that background.
this entire rant is extremely disingenuous - nothing that WSL2 does is worse than running two discrete PC's, one with Linux, the other with Windows. Saying WSL2 sucks because there are constraints you do not want to deal with is disingenuous. I think it's totally fair to say "these constraints are deal breakers for me" but I don't think it's fair to say the entire tool is fundamentally broken, bad, or sucks as a consequence. It sounds like the message "you can use WSL2 and Windows interchangeably" is a projection, and an unfair one. A lot of your points though are solid - if you treat WSL2 as essentially a super-powered virtual machine with some amazingly great integration with the host machine (Windows) then it will treat you well back in return. It's when you try to treat it as an extension of the host machine, interoperable through it all that your expectations will fail. I don't see how it's fair to expect WSL2 to be both Windows and Linux at the exact same time. I think it's a perfectly fair tradeoff to expect WSL2 to behave like a discrete PC with these super powers to enhance a workflow that involves both Linux-based and Windows-based workloads.
I had the same issue. I basically used WSL2 seperate and whenever I needed ssh I started the cmd with a widnows command line redirect using the windows ssh invoking it from linux shell. I hate it and will never like it.
WSL 1 is a Linux barebone compatibility layer whereas WSL2 is Linux Application compatibility layer as far my experience goes, but then I liked WSL2 over 1 for my usecase but I can understand why WSL2 is a pain in the ass...... though , linux is only good for a computer engineer in enterprises or someone doing programming, once you go into scientific workflow, simulations etc, then,,,,,,,,,,,,,, have to stick with windows :(
@@mathewsjoy8464 I think he did mention a real problem, which is VPN doesn't work without workaround. However, other than that, I think everything is great.
I've been using WSL2 for over a year every day. I do game development on Windows and web development on WSL2. I use it for big production apps and various setups including Docker. Although WSL2 has some rough corners and bugs it's been a miracle tool in terms of unifying my workflow with a single computer.
I agree and use it now. Git-Bash was just too slow. Also I found using a workspace container (docker run -it --rm rwxrob/workspace) did not have the OpenConnect firewall bug issues.
@@rwxrob IMO: Hands down best setup is still Cygwin. WSL2 is basically a light VM.
@@rwxrob lol it somehow contradicts the whole point of the video ))
@CL-rm6sb what are the pros of the cygwin over gitbash?
I really would love work with wsl2, but a simple "npm start" or "npm install" command takes such a long time, :(
This was fixed as of January 2022, along with several other issues. The big issue now is how IPs are assigned from Win Home to Win Pro, with Pro using Hyper-V and allowing for default network addressing (192.X), while Home versions default to 172.X addresses for "security measures". They suggest not trying to change it in Home, as it might break networking capability within the WSL2 framework; both versions allow for communication with the wider LAN, but there's definitely some tomfoolery afoot concerning ARP with WSL2 on Win Home Editions.
I have Win Home I can't connect to internet in wsl, it sucks!
Disagree with "the whole point" is being able to exchange files between systems, but I respect the opinion and totally understand how WSL2 doesn't work for your case. WSL2 works amazingly well for me for having a fast development area where I need native Linux tools that integrate nicely with my host. You might think "integrate nicely" means sharing files and I wouldn't blame anyone for assuming that too, but I mean stuff like VS Code (remote plugin), Docker Desktop, Windows Terminal, etc.
Could I just spin up my own box in a VM or something or just keep a container running? Sure. If I absolutely had to map drives between them then I would do that. But if you don't, then the trade-offs aren't worth it.
I like my Windows machine because of all of its raw power and the ability to play some games every once in a while. If I was able to actually do real iOS development I would be 100% happy with Windows+WSL2.
Again - not a counterpoint to your argument. WSL2 is clearly not good for your use-case (I'm particularly clueless on how the VPN stuff would work) -- but for me, oh man, it's perfect and I love it. I do mostly Go and Node development.
Good points. But with WSL2 you cannot `docker commit` your setup and back it up and use it elsewhere. Also, pure docker containers are confirmed to *not* have the firewall bug. I use one every day now. We did discover, unfortunately, that you cannot really install Docker on Windows *without* WSL2 now (even if you never use it). It's a prereq. I keep hoping I'm wrong, but everyone is reporting this.
try pip in wsl It just takes forever...
same honestly. i've had 95% good experiences with WSL2, and the 5% bad have been fairly easy enough to solve. granted, i don't use a VPN or anything like that, and i'm mainly just a hobbyist who likes to tinker with anything and everything, so installing linux on top of windows in such a 'native' way was a no-brainer for me.
Hey! Great talk Rob! Congrats! As a Unix and infrastructure sysadmin trapped in my company's Windows laptop, I found myself struggling how to get bash running. I settle with Cygwin but then I ear some other people talking about WSL2. I asked management for a special temporary (about 2 days) permission to get admin privileges and installed WSL2. It *sucks* as you very well mention! VPN is a huge pain and never solved. File permissions is nightmare too! I then return to Cygwin. Sometimes Cygwin lags while doing a simple 'ls -l' and I'm now switching to gitbash that I didn't know it was so nice! Hope it won't lag :) Installed podman on WSL2 but can't install it on Windows as it requires admin :( Happy vimming!
BTW, is it possible to run tmux on gitbash? That would be really nice!
I guess i have just become very used to the windows file permissions incompatibility from all those years of cross mounting windows crated files in linux and vice versa, that I didnt even think wsl could provide an improvement here.
Docker will end up using the WSL2 anyway. You would have had a better experience if you stored the shared files in the linux files system, rather than the windows file system. Performance, permissions, etc. Let the windows file system handle windows files, linux handle linux. You can then access them with both.
Yep, I've accepted that you just have to have WSL2 even with the firewall bug. I get around that by running my rwxrob/workspace container from work, which uses network settings of host system (not WSL2) even though it leverages WSL2 for performance.
This permission issue is also there if you connect a harddrive with NTFS file system and you copy files to your linux ext4 system
WTF are you talking about? sounds look you are using Windows wrong. You dont need additional VPN on your WSL if windows host has VPN connected. All outgoing traffic from WSL is automatically NATed with host machine IP.
There is a known bug with OpenConnect that has firewall issues and a workaround. It has a issue thread if you care to find it. Ironically, running a linux container from wsl2 (mounting /var/run/docker.sock) does *not* have the issues for the reasons you submit (using the host VPN).
I also wasn't so fond of WSL2 so I instead use Clink (for vi-mode line editing) + cmd.exe + Windows Terminal.
With this setup, most of my muscle memory is still useful and I also get a native-feeling Windows experience without any impedance mismatch.
The risk here is that since there's probably at least an order of magnitude more Windows users than Linux users, people might start to think the brokeness of WSL2 is just the way things should be.
Your right as a student in cybersecurity I accepted that it was just shit not knowing better
I have used windows for 2 weeks and I have had literally all of these problems......
Do u use cmer or git bash? I still come with issues setting up eg my windows ide with cmder. Some programks like mkdir are slightly different, and eg webstorm uses cmd.exe if u use ide runner and no way to change it
I have heard of some people having dumped Linux because of WSL(2). Sadly, it is false competition, Linux is not legally allowed to embed the necessary Windows-code but MS can put everything of Linux on Windows.
Dumping Linux because of WSL2 is tragic. Makes you wonder how Apple got away with it, until you realize "oh yeah, BSD" The great news is you never have to use WSL2. Docker containers that can be committed and backed up and don't have the firewall bug work fine even if they require WSL2 to be installed.
Really? I understand using WSL 2 because it's convenient in certain circumstances but dumping Linux? I would argue that anyone that dumped Linux for WSL was never really invested in Linux. Also, I'm hoping Eric Raymond's prediction comes true where Linux consumes Windows from the inside out.
@@ryanleemartin7758 I can see it happen with developers who use Linux for development (it just is better for it, Linux and FreeBSD) but also are addicted to certain Windows-only software. Dual-booting is not a great thing. I myself only use Linux on my desktop, Windows on a laptop when I really have to. Linux just is the better OS, it does not get in your way, it gives control to the user and it is better customizable. But there is this problem that some programs work better on Windows because they were developed for Windows. For example, for some reason I still have a horrible input-lag for the keyboard in the Steam-client (just the client, not the games), probably because they package it weird because it is not a problem on my system.
i love having wsl as a production tool without having to invest too many resources on a dedicated setup, but i completely agree about the files permission part, actually a complete clusterfuck.
the worst part is that it's not even microsoft's fault, windows and linux file permissions are just incompatible. anyone that has had to setup a SMB server on linux has had to deal with this problem. and ironically, file permissions is maybe one of the very few designs where i'd say linux has it worse than windows, when you think about it if linux permissions were windows-like there might not even be a reason to have to run security features like SELinux.
Every OS on planet (except windows) are following those file permissions. Those aren't specific to linux, those are standards (en.wikipedia.org/wiki/POSIX) that every OS on planet (except windows) is trying to follow.
@@sunnymishra5678 every OS on the planet is using legacy file permissions from half a century ago. these are not standards, these are just a bad way to do permissions someone came up with a long, long time ago, which just happened to be copied by every other UNIX OS a long, long time ago.
windows uses proper ACL rules. every other OS doesn't, which is why we have the nightmare that is SElinux.
imagine a world without needing to have SElinux, that's windows file permissions.
Been waiting for someone to have a hot take on wsl2 on TH-cam for a while. Just subscribed.
I've been dealing with WSL2 mounting issues all day, might jump back to Linux.
Ever since they announced the switch from WSL1 to 2 I was bother... because now it's just a worse VM. I gave up on using it after all distros I tried in a setup would have internet connection and there was simply no way to troubleshot it
Love this conversation!
Microsoft’s aggressive licensing in the early days cemented their place in the enterprise for the Ops side of the house. Most end users are using Windows and the IT department spends much of their time administering those systems, its relatively easy to admin and monitor. This aggressive licensing also made it so many companies that build software for enterprise use build an application that runs on Windows. Truthfully Linux distros put more control in the users hands so if you are a developer thats the system you should use or even if you are in Ops or a courageous (willing to learn new things) end user.
Personally I don’t think variants of Ransomware would wreak as much havoc in organizations if more organizations ran Linux distros. How many are truly exploring this possibility? Probably not as many that should.
It was not only the aggressive licensing, MS also made a deal with OEM's to bundle Windows and MS Office wiht the laptops (that should not be allowed, this is coupled sales) and MS pushed schools to have MS Office on the computers by making that cheap for them, but not for individual licenses. I don't know if it still is true that Windows is easier to administer given how many problems people get with updates, security-patching, stuff breaking on Windows. It is not up to me to judge that, only experienced administrators who also master Linux and maintain both can judge this, but I do raise that question.
@@peterjansen4826 sure there are always bugs security patch role outs and more complicated issues that stem from proprietary applications that need to be pushed out. In general most industries are powering their computers on Windows OSs joined to a Domain (Active Directory) with the exception of big web-based tech companies who build their products on Linux distros and manage a custom built service like Google or Amazon. I agree with you in that I may be overgeneralizing by saying Windows Administration is easier but it is a whole lot easier to find Windows Administrators than it is to find skilled Linux administrators. This is why in most cases a Linux Administrator gets paid more from the start. Does this mean Windows is easier to learn? Please know that this doesn't mean I think Windows is better it's just what I've seen in my experience as a System/Network admin.
@@ltnlabs "but it is a whole lot easier to find Windows Administrators than it is to find skilled Linux administrators." That was exactly my point, to which extend is it about which is easier and to which extend is it about which is more admin-friendly? In theory with the file-permission and ownership system on Linux you have the tools which you need. But how many people are out there who are experienced with managing systems for Linux? I appreciate your input coming from that background.
@@peterjansen4826 I appreciate your perspective as well.
Does chmod still not work on wsl2?
this entire rant is extremely disingenuous - nothing that WSL2 does is worse than running two discrete PC's, one with Linux, the other with Windows.
Saying WSL2 sucks because there are constraints you do not want to deal with is disingenuous. I think it's totally fair to say "these constraints are deal breakers for me" but I don't think it's fair to say the entire tool is fundamentally broken, bad, or sucks as a consequence.
It sounds like the message "you can use WSL2 and Windows interchangeably" is a projection, and an unfair one.
A lot of your points though are solid - if you treat WSL2 as essentially a super-powered virtual machine with some amazingly great integration with the host machine (Windows) then it will treat you well back in return. It's when you try to treat it as an extension of the host machine, interoperable through it all that your expectations will fail.
I don't see how it's fair to expect WSL2 to be both Windows and Linux at the exact same time. I think it's a perfectly fair tradeoff to expect WSL2 to behave like a discrete PC with these super powers to enhance a workflow that involves both Linux-based and Windows-based workloads.
I had the same issue. I basically used WSL2 seperate and whenever I needed ssh I started the cmd with a widnows command line redirect using the windows ssh invoking it from linux shell. I hate it and will never like it.
wsl2 file exchange with windows is so broken I can't even
Thanks for this video. If the people who watched this took it to heart, you've saved easily 100k manhours.
WSL 1 is a Linux barebone compatibility layer whereas WSL2 is Linux Application compatibility layer as far my experience goes, but then I liked WSL2 over 1 for my usecase
but I can understand why WSL2 is a pain in the ass......
though , linux is only good for a computer engineer in enterprises or someone doing programming, once you go into scientific workflow, simulations etc, then,,,,,,,,,,,,,, have to stick with windows :(
Thanks for saving my time
and i don't get it, you don't have the same file permission in windows or git bash, why do you complain you lose it in wsl2?
Idk tbh wsl2 now works perfectly fine it’s had a lot of fixes and updates probabaly a salty Linux boomer
@@mathewsjoy8464 I think he did mention a real problem, which is VPN doesn't work without workaround. However, other than that, I think everything is great.
Pfffhahaha. I'm talking about Anyconnect VPN and no it hasn't been fixed. Also, not a boomer, but very salty.
I love everytime he pisses off cause ik the same
Agreed wasted so much time on fixing simple things. Could have used the time creating something useful.
But wsl is faster
I was waiting for this video haha
absolutely WSL2 crashed when installing minikube, dual botting is much more practical
I got rid of windows now only ubuntu and peace