Off-Topic: I'm setting up a new machine, and wondering whether I should use WSL 1 or 2 (or both?). Is there a clear path forward for these systems? WSL 1 has served me pretty well. Most of the inter-filesystem interaction amounts to using rsync to back up directories. Otherwise it's just sshing into servers. I use virtualbox for off-line development.
> Off-Topic: I'm setting up a new machine, and wondering whether I should use WSL 1 or 2 (or both?). Is there a clear path forward for these systems? WSL 1 has served me pretty well. Most of the inter-filesystem interaction amounts to using rsync to back up directories. Otherwise it's just sshing into servers. I use virtualbox for off-line development.
I would recommend wsl2 for sure.
WSL is nice to have and a million times better than DOS/Powershell but it's not at Linux/Mac terminal level yet.
Getting the same working with WSL2 was a pain in the ass, and I eventually gave up.
So if you like X-forwarding... I personally would recommend sticking to WSL1, unless that gives you other issues.
Overall it works the same as WSL 1, you just need to change DISPLAY=:0 to DISPLAY="$(/sbin/ip route | awk '/default/ { print $3 }'):0"
Here's a snippet from my bashrc that handles both WSL 1 and WSL 2: https://github.com/nickjj/dotfiles/blob/385007837ab787a2be2e...
I have no idea what I did (i just blindly follow some guide on a no-name blog), but I got it all working fairly effortlessly. The only slightly annoying thing is having to start the server on windows if i restart my pc, but otherwise it was pretty easy.