Hacker News new | past | comments | ask | show | jobs | submit login

The things I liked the most about WSL were the ability to share the same file system (and RAM, etc.) and not have to care about partitioning any resources. And to search the Linux files on the Windows side and even modify them with tools that can handle them (yes, I know what I'm doing). Now all of that goes out the window(s)... so I'm pretty unenthusiastic about WSL2. And the 9P server has been next to useless for me on WSL1. It's so darn slow for a local filesystem, it's almost like accessing files over SMB.



You still don't need to manage all those things. Wsl2 does it all automatically as far as I ve seen from the current version I tried


It needs a VHD, which requires setting aside a partition of your disk, meaning you can't dynamically share space with your Windows files. That's a huge downside for me. (By "partition" here I'm just referring to the English sense, not the MBR/GPT per se.)

You also can't nor search/modify your Linux files directly from Windows like I mentioned. The 9P server with WSL1 has been so slow as to be unusable for some directories when I try to use it. Does it feel native SSD-speed on WSL2?

As for RAM, does it really share RAM with Windows? That's great news if it does, but I don't think I've seen any VMs do this, though I've never tried it with Hyper-V... if it does, I'm guessing that's what lets it use memory ballooning?


It's a resizable VHD that handles its business in the background, so I don't understand the complaint. And you can access your Linux files in Windows just fine when using WSL2. Just go to `\\wsl$`.

WSL2 is the first thing to legit make me reconsider my daily-driver Fedora setup in...well, since I started using it in ~2016. I just do not think about it, it's great.


> resizable VHD

Just like what you normally use with a Hyper-V VM. A resizable VHD which grows but not shrinks, and with a size limit. Heck they even have a document on what to do when you exceed the default 256GB limit: https://docs.microsoft.com/en-us/windows/wsl/wsl2-ux-changes...


It shrinks the VHD automatically??

And yes the \\wsl$ is the 9P server I just tried to explain is incredibly slow compared to normal files on WSL1. I haven't tried WSL2 yet but I don't expect going through a VM would be faster.


I've never looked as to whether it shrinks it, but I assume not (that would be hard). OTOH, storage is cheap, so I've never really worried.

I never used WSL1 in anger, but accessing WSL2 over the \\wsl$ is not particularly slow. It's not as fast as native, but I don't notice it. I do almost all of my access of files on the Linux image via a terminal and VSCode-over-WSL-Remote, though.


Well "storage is cheap" for you but why assume my money and everyone else's is cheap? I'm low on space and I need to shell out hundreds of dollars to get a larger version of what I have just to use WSL2. Or I could just keep using WSL1 and save my money, especially in this economy. Why in the world would I get a new SSD just for WSL2?

This isn't about using it "in anger". I'm not pushing it to some kind of corner case, you just need to use it for real instead of trying hello-world examples. You notice this immediately as you're dealing with nontrivial folder contents. To give you an idea, this is the speed of raw grep from inside WSL1 Ubuntu:

  $ time sudo grep -ri asfadsfadf /etc
  real    0m0.075s
  user    0m0.016s
  sys     0m0.063s
This is the speed from \\wsl$ (MSYS2):

  real    0m9.227s
  user    0m0.078s
  sys     0m0.561s
And this is the speed on the raw files from Windows (MSYS2):

  real    0m0.092s
  user    0m0.000s
  sys     0m0.046s
\\wsl$ is literally some 60x-70x slower than direct access, and it's not because I'm "using it in anger". If you don't believe me, try it yourself with any program you prefer and see if you get similar speed before you tell me I'm wrong.

This is par for the course on \\wsl$. Explorer lags, too, if you try to browse a folder with a bunch of subfolders that actually have some contents. It's plain as daylight to me. Not noticing to me is like not noticing that your car suddenly goes 1mph instead of 65mph.


That has been my experience as well.

WSL2 is much much faster.


Do you specifically mean \\wsl$ is much faster on WSL2?


  time grep -ri asfadsfadfg /home/me/python-venvs
  0.79s user
  0.14s system
  99% cpu
  0.928 total

  wsl time grep -ri asfadsfadfg /home/me/python-venvs
  0.83s user
  0.10s system
  99% cpu
  0.932 total
EDIT: cleaned up and formatted the output for better visibility, reacting to your comment.

First command ran from a zsh Terminal session in WSL

Second one ran from a powershell session using the wsl "bridge" executable.


I can't make sense of your command lines (why are you passing grep to grep??), but you're comparing pure-Windows against pure-WSL? I was comparing the two of those against \\wsl$ which is the slow one...


Any interaction with the linux filesystem.

With WSL 1 installing an Ubuntu package or performing an upgrade was unbearably slow, with WSL 2 it feels normal.

\\wsl$ is also much faster, yes


Normal interactions from within WSL of course feel normal. It's just a VM with a fancy name after all. Which is removing pretty much all the overhead of the Windows I/O system, and which has hence been faster for ages. I'm surprised \\wsl$ would be faster though; that should have more overhead going through a VM, not less. If I ever try out WSL2 I'll have to give it a shot, but somehow my past experiences don't leave me optimistic...


Supposedly it can release memory, as of October. It wasn't working in January when I last tried it, but I guess it's worth putting it back on auto to see what happens.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: