In Windows 11, I needed WSL 2 to have a distribution with systemd, so I installed both.
It opened without problem, but it had no internet.
I guess the problem is not related to DNS because it also occurs with things like ping 8.8.8.8
or ping to the 'distribution' ip itself ping 172.x.xxx.x
(as seen in the windows side with ipconfig /all
).
This post is similar to:
https://github.com/microsoft/WSL/issues/5336
If I transform the installed Ubuntu distribution to WSL 1, with wsl --set-version Ubuntu 1
, internet and ping works perfectly (but I need wsl2 systemd). I followed suggestions (see EDIT) of more than 10 different pages, but nothing worked.
Those were related to changes in /etc/resolv.conf
, Firewall, VPN, Hyper-V and WSL feature reinstalling, swap disabling/compression, temp folder compression, IPv6 disabling, changing router, etc. The github post has around 200 comments, I think I have tried all answers contained in them.
As soon as I transform back to version 2, remote, or local ping to the WSL IP itself (172.XX.XXX.X), breaks.
Any suggestion?
EDIT: My Firewall was inactivated but not uninstalled, see answer.