WSL2 Sucks in Ways People Ignore. Use Git-Bash Instead [20210324163411]

Поділитися
Вставка
  • Опубліковано 15 вер 2024
  • Git-Bash (Git-SCM) is still Windows. WSL2 is not. You might initially think WSL2 not being Windows is a good thing but there are specific reasons it is not: 1) your Windows VPN won't work, 2) file permissions between the two will be bork in mysterious, dangerous ways with no warnings, 3) env/system variables do not convey, 4) you need Git on Windows anyway.
    Of course, some of these can be remedied, but why bother. Git-Bash just works from the start and is much easier to install and configure, even when combined with Alacritty (a kick-ass fast, clean, easy to configure terminal written in Rust).
    Don't cross the streams. Use a real Linux system either by ssh-ing into one or running one locally with Docker. (You do use Docker, right?) I only use Git-Bash for basic things (mostly git, ssh, find, and an occasional vi). I don't bother with anything else, not even tmux. All that goes on another actual Linux system that Git-Bash helps me get to. In a sense, Git-Bash is just a much better Putty.
    The worst part about this is that Microsoft has blogs and open issues about all this and such but never says anything about it when talking up how amazing WSL2 is. It's just not. Hiding these annoying, critical facts from beginners just to get them hooked only later to have to explain why they screwed up is irresponsible.

КОМЕНТАРІ • 59

  • @KirillKovalevskiy
    @KirillKovalevskiy 3 роки тому +36

    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.

    • @rwxrob
      @rwxrob  3 роки тому +10

      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.

    • @CL-rm6sb
      @CL-rm6sb 2 роки тому +3

      @@rwxrob IMO: Hands down best setup is still Cygwin. WSL2 is basically a light VM.

    • @megasuperlexa2
      @megasuperlexa2 Рік тому +2

      @@rwxrob lol it somehow contradicts the whole point of the video ))

    • @megasuperlexa2
      @megasuperlexa2 Рік тому +1

      @CL-rm6sb what are the pros of the cygwin over gitbash?

    • @shashankkr1008
      @shashankkr1008 9 місяців тому +1

      I really would love work with wsl2, but a simple "npm start" or "npm install" command takes such a long time, :(

  • @Anon0nline
    @Anon0nline 2 роки тому +6

    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.

    • @omdave1008
      @omdave1008 11 місяців тому

      I have Win Home I can't connect to internet in wsl, it sucks!

  • @nabx19
    @nabx19 3 роки тому +7

    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.

    • @rwxrob
      @rwxrob  3 роки тому

      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).

  • @AlexPaluzzi
    @AlexPaluzzi 3 роки тому +26

    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.

    • @rwxrob
      @rwxrob  3 роки тому +2

      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.

    • @bettycooper5029
      @bettycooper5029 3 роки тому +1

      try pip in wsl It just takes forever...

    • @alefnull
      @alefnull 2 роки тому +2

      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.

  • @Trooperos90
    @Trooperos90 3 місяці тому

    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

  • @omgnowairly
    @omgnowairly 3 роки тому +9

    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.

    • @rwxrob
      @rwxrob  3 роки тому +1

      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.

  • @mariocosta6968
    @mariocosta6968 Рік тому +1

    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!

    • @mariocosta6968
      @mariocosta6968 Рік тому

      BTW, is it possible to run tmux on gitbash? That would be really nice!

  • @lev5821
    @lev5821 2 роки тому +2

    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.

  • @himanshushukla6451
    @himanshushukla6451 3 роки тому +1

    This permission issue is also there if you connect a harddrive with NTFS file system and you copy files to your linux ext4 system

  • @ewrietz
    @ewrietz 3 роки тому +3

    I have used windows for 2 weeks and I have had literally all of these problems......

  • @LukeAvedon
    @LukeAvedon 3 місяці тому

    Does chmod still not work on wsl2?

  • @vapornate
    @vapornate 3 роки тому +1

    Been waiting for someone to have a hot take on wsl2 on UA-cam for a while. Just subscribed.

  • @SchioAlves
    @SchioAlves Рік тому

    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

  • @MatthewDeVore
    @MatthewDeVore 3 роки тому +1

    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.

  • @peterjansen4826
    @peterjansen4826 3 роки тому +2

    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.

    • @rwxrob
      @rwxrob  3 роки тому

      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.

    • @ryanleemartin7758
      @ryanleemartin7758 3 роки тому +3

      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.

    • @peterjansen4826
      @peterjansen4826 3 роки тому +4

      @@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.

  • @BattousaiHBr
    @BattousaiHBr 3 роки тому +1

    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.

    • @sunnymishra5678
      @sunnymishra5678 Рік тому +1

      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.

    • @BattousaiHBr
      @BattousaiHBr Рік тому +1

      @@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.

  • @ltnlabs
    @ltnlabs 3 роки тому +1

    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.

    • @peterjansen4826
      @peterjansen4826 3 роки тому +3

      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.

    • @ltnlabs
      @ltnlabs 3 роки тому

      @@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.

    • @peterjansen4826
      @peterjansen4826 3 роки тому +1

      ​@@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.

    • @ltnlabs
      @ltnlabs 3 роки тому

      @@peterjansen4826 I appreciate your perspective as well.

  • @saturdaysequalsyouth
    @saturdaysequalsyouth 2 роки тому +1

    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.

    • @jaybiddy955
      @jaybiddy955 9 місяців тому

      Your right as a student in cybersecurity I accepted that it was just shit not knowing better

  • @vernongrant4710
    @vernongrant4710 Рік тому +1

    I've been dealing with WSL2 mounting issues all day, might jump back to Linux.

  • @jimmyvanveen1960
    @jimmyvanveen1960 2 роки тому +4

    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.

  • @danial_amini
    @danial_amini 10 місяців тому

    wsl2 file exchange with windows is so broken I can't even

  • @scottmiller2591
    @scottmiller2591 Рік тому

    Thanks for this video. If the people who watched this took it to heart, you've saved easily 100k manhours.

  • @SamLinMaxisam
    @SamLinMaxisam 2 роки тому

    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?

    • @mathewsjoy8464
      @mathewsjoy8464 2 роки тому

      Idk tbh wsl2 now works perfectly fine it’s had a lot of fixes and updates probabaly a salty Linux boomer

    • @SamLinMaxisam
      @SamLinMaxisam 2 роки тому

      @@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.

    • @rwxrob
      @rwxrob  2 роки тому

      Pfffhahaha. I'm talking about Anyconnect VPN and no it hasn't been fixed. Also, not a boomer, but very salty.

  • @garvigujju1275
    @garvigujju1275 3 роки тому +1

    Thanks for saving my time

  • @dhruvmeena96
    @dhruvmeena96 2 роки тому

    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 :(

  • @Trooperos90
    @Trooperos90 3 місяці тому

    I love everytime he pisses off cause ik the same

  • @rahulxcr
    @rahulxcr Рік тому

    Agreed wasted so much time on fixing simple things. Could have used the time creating something useful.

  • @Kenbomp
    @Kenbomp Місяць тому

    But wsl is faster

  • @GibbaBites
    @GibbaBites 3 роки тому

    I was waiting for this video haha

  • @seoexperimentations6933
    @seoexperimentations6933 3 роки тому

    absolutely WSL2 crashed when installing minikube, dual botting is much more practical

    • @kamikaze9785
      @kamikaze9785 3 роки тому

      I got rid of windows now only ubuntu and peace