WSL 2: Why you should use real Linux instead
medium.com
medium.com
I have a real Linux install with Hyper-V. Other than some Hyper-V guest integrations, there's no Windows specific customizations. No GPU access, but only very specific software needs that.
In my experience, WSL 2 with Node, Terminal and VSCode has felt like a first class experience. It's miles ahead of WSL 1, which was theoretically a great idea, but failed in practice.
Indeed. Do you know what technical factors made WSL1 undesirable in practice? Why were the disk performance issues insurmountable? Why was it so hard to maintain? The reverse, WINE, is arguably very successful.
I highly doubt things like mounting filesystems ( I do run BTRFS for LXD in my WSL2 system) or other just-slightly-beyond-posix things would work reliably or at all with such kind of emulation that WSL1 do. In other words - it would never be Linux enough as native Linux (with VM type of WSL2).
I.e. I still use both WSL1+WSL2, but WSL1 is basically a very small shim when I need some socat/grep/shell & where it needs to share networking with main system, while main work is much better in WSL2.
I remove all Windows auto mounts and use only VS Code remote sessions and not VS Code WSL2 sessions.
WSL2 is more than fast enough. See phoronix site (well respected linux benchmarker).
Works really well. I just have to manually start the docker service (no systemd in WSL2) or dig out the MS command for running services on startup.
https://devblogs.microsoft.com/commandline/systemd-support-i...
I liked the original WSL because it delivered close integration in the filesystem (e.g. Linux applications used the Windows filesystem) but the filesystem interface in Windows is slow compared to the filesystem in Linux. For the work I did it was OK but the headline number for how long it takes to compile a kernel was awful with WSL 1 and Microsoft felt the need to rebuild WSL.
So WSL 2 is just "run Linux in a VM and use a bunch of Microsoft-supplied hacks to couple Linux and Windows" and that is just death... Microsoft can't couple Linux to Windows effectively any more than Microsoft could make a Dropbox clone that worked 1/4 as well as Dropbox or make a Steam clone that works at all. (Ok, I have occasionally installed an app from the Windows store, it sorta works on a new machine from the store and just after you make a feature upgrade, but after a little bit of use the metadata database gets corrupted and I can't install anything anymore... And the idiots at Microsoft tell me I should nuke my whole account and spend hours reinstalling and reconfiguring all the applications I actually use just so I can install one crapplet from the Windows Store that I need for my printer.)
If I want to run Linux in a VM I can just run Linux in a VM and configure it so it works correctly. For me WSL 2 is Kryptonite because it makes it very easy to make a broken Linux configuration but impossible to make a good one.
the integration between WSL 2 and Windows is alive and well, I assure you.
most times I hear of something like this at work, like very odd problems I've never seen before, I will sit with the person and observe what they do before problems come up. every single time it is because they have some custom thing they do or apply or install "to all [their] windows systems out of the box" which "makes things better" somehow, but in reality always seems to make things break. these people are always smart people who knew very well how Windows worked 20 years ago and are unaware of just how much has changed in those two decades. damn near everything has changed, FYI. the old ways no longer work in a lot of cases.
those old tweaks mostly cause problems today. I'll show them what to do to stop windows from doing whatever it was that it did back then, in the rare event that windows still does the same things, and magically a lot of their issues simply stop being issues immediately.
your mileage may vary, but if you have problems, I would look closely at any customizations you've made, if any. maybe you've made none, I don't know. I no longer make any, and I no longer have the problems I hear others having.
You then have a standard terminal and Ubuntu environment wherever you go, and have some niceties like being able to call windows apps from Linux, and be able to run windows junk like netsh from bash and process its output.
https://store.rg-adguard.net/ lets you find the download link for appstore junk.
>As you can tell from the comparison table above, the WSL 2 architecture outperforms WSL 1 in several ways, with the exception of performance across OS file systems, which can be addressed by storing your project files on the same operating system as the tools you are running to work on the project.
So,
>That was surprisingly slow.
It wasn't (surprising). And,
>In other words: WSL 2 is slow.
No. Depends on what you're doing. Kinda gave up the article here.
> you can’t even mount an USB stick to it
yes, yes you can.
mount -t drvfs x: /mnt/x
Or you can run usbip if you need to have low level access to a usb device for some reason.