Replying to the multiple comments saying to turn off the Windows Defender Firewall for vEthernet (WSL) interface, make sure you have the firewall configured on WSL before making that change. Well I was trying to configure wsl2 on my company's laptop without success. it's working now. But that seems to be a separate issue. Which was the first Sci-Fi story to predict obnoxious "robo calls"? Systems that require WSL 2 should leave the ICS service (SharedAccess) in it's default start state, Manual (Trigger Start), and any policy that disables ICS should be overwritten or removed. What positional accuracy (ie, arc seconds) is necessary to view Saturn, Uranus, beyond? Or run the WSL Linux Shell as windows administrator (with right click) an edit file /mnt/c/Windows/System32/drivers/etc/hosts. By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. inet6 fe80::215:5dff:fe9a:1fe3 prefixlen 64 scopeid 0x20 Nameserver problems in WSL 2 Ubuntu 20.04 - Stack Overflow However the way it was handled may alienate the community. (meaning if lots of resolutions fail at the same time, the service will take longer than 20s to recover). Note that I don't have the Docker daemon running inside WSL, although I do have it running on the host and exposed to the WSL instance. DNS server inside wsl2 is not working for windows microsoft WSL Effect of a "bad grade" in grad school applications, Two MacBook Pro with same model number (A1286) but different year. Link only answers are not considered good answers. Then try the wget above again. in the explorer top bar enter \\wsl$\ and it will list your distributions. The best answers are voted up and rise to the top, Not the answer you're looking for? Share Improve this answer Follow answered Jun 25, 2020 at 13:52 daveomcd 6,309 14 81 134 Add a comment 0 Best I can do is provide a working example. If your use-case for WSL supports it, WSL1 will typically run without issues when connect to a VPN. Using nslookup from the Windows side, I can use the WSL dns server (setting server 172.20.128.1). To fix this, append the following to the the /etc/wsl.conf file: Please note that adding this command will include metadata and modify the file permissions on the Windows files seen from WSL. While disabling the ICS service will break WSL 2, and we do not recommend disabling ICS, portions of ICS can be disabled using these instructions. Interesting - Are you sure its the Windows Firewall that's blocking it? Launch it using wsl -d <newDistroName> If that doesn't work, or you really need WSL2 when connected to the vpn, there are a few possible workarounds, but one of the more promising seems to be this one. privacy statement. Either fix it on Windows, or fix the DNS server on 172.22.192.1. The workaround breaks down into two problems: Network connection to internet DNS in WSL2 This problem is tracked in multiple microsoft/WSL issues including, but not limited to: microsoft/WSL#5068 microsoft/WSL#4277 microsoft/WSL#4246 Network connection Instructions for this process can vary from machine to machine, please see this article from Bleeping Computer for an example. There is no need to disable the default auto-generation of /etc/resolv.conf. Fixed. Stop the sshd service and start sshd in debug mode: Check the startup logs and make sure HostKeys are available and you don't see log messages such as: If you do see such messages and the keys are missing under /etc/ssh/, you will have to regenerate the keys or just purge&install openssh-server: This error is related to being in a bad install state. rev2023.5.1.43405. Sign up for a free GitHub account to open an issue and contact its maintainers and the community. the lookup of the non qualified hostname takes 10s to fail, and make the DNS unresponsive for 20s. Sign up for a free GitHub account to open an issue and contact its maintainers and the community. https://gist.github.com/coltenkrauter/608cfe02319ce60facd76373249b8ca6, https://github.com/microsoft/WSL/issues/4277, https://github.com/microsoft/WSL/issues/4246, https://gist.github.com/akshayhiremath/1b3bff527b3eca6cd41cf60ce88f3a56/8570f9fb4dbd681fc7aabcc817fa18cbab5f1e86#file-fix-wsl2-dns-resolution, How a top-ranked engineering school reimagined CS curriculum (Ep. To enable it run in an elevated powershell: Additionally, if you have 3rd party hypervisors installed (Such as VMware or VirtualBox) then please ensure you have these on the latest versions which can support HyperV (VMware 15.5.5+ and VirtualBox 6+) or are turned off. Hence, be aware that the VPN connection will not permit WSL to see the outside world, as of the time of this post. It is only available on Windows 11, even though it first looks like one can install it on Windows 10, it fails when trying to run it after installation. Since none of the solutions from the mentioned link didn't work for me. ), Exit all of your Linux prompts and run the following Powershell command, If resolv.conf is soft linked to another file, remove the link with, Create a new resolv.conf with the following content. To subscribe to this RSS feed, copy and paste this URL into your RSS reader. How to force Unity Editor/TestRunner to run at full speed when in background? You can convert the instance from PowerShell via: Or, if you'd like, you can wsl --import that backup into a new instance WSL1 instance via wsl --import UbuntuWSL1 \location\for\instance \path\to\ubuntu.tar --version 1. Implementation of that should decrease possibility of getting issues by overlapping IP addresses in case of Docker Desktop is used. Many times this issue has bothered me, I ended up making this simple helper code: https://github.com/epomatti/wsl2-dns-fix-config, This is a problem with WSL, not Ubuntu or Windows. In admin PowerShell window I run the following to allow Inbound traffic to the virtual WSL ethernet connection.