I updated my Win 10 Pro box to WSL 2 and changed the /etc/resolv.conf file et. al to allow WSL to access the Internet (and that works fine), but if I enable ufw (with just http / https allowed through), all networking is blocked. "ping 8.8.8.8" just hangs and "sudo apt update" returns "Temporary failure resolving 'archive.ubuntu.com'"
Are there other services/ports I'm supposed to open in ufw to make this work? Are there changes I'm supposed to make to the Hyper-V Manager?
(FYI: I put "nameserver 208.67.222.222" (OpenDNS) in the resolv.conf file (yes, I followed others' advice to prevent resolv.conf from being overwritten).)
I also created a rule in Windows Defender to allow bash.exe access, but since WSL 2 doesn't use the Windows firewall, that was probably a waste of time. I can't find any information anywhere on how to properly configure ufw for WSL 2, so any information would be appreciated...
Make sure that NTFS compression is not applied at two WSL-dependent directories (
%LocalAppData%\Packages\CanonicalGroupLimited*
and%TEMP%
, more detailed my answer at https://stackoverflow.com/a/68854905/12691808)