Snaps unable to resolve names under WSL

Depending on the details of your setup, you may be experiencing problems with some snaps not being able to resolve DNS names when running snapd under WSL.

If you have this problem, a likely cause is that since you’re letting WSL manage resolv.conf, /etc/resolv.conf is a symlink to /mnt/wsl/resolv.conf, and AppArmor doesn’t know that that’s one of the possible locations for a programmatically-managed resolv.conf, and so is denying access to it.

(The denial should show up in the logs, if so.)

I’ve a pull request in to update AppArmor with this here; in the meantime, if you make the addition from that pull request to your /etc/apparmor.d/abstractions/nameservice file and then restart your WSL instance, it should clear the issue right up.

1 Like