Microsoft Windows [Version 10.0.19043.1081]
Ubuntu 20.04.2 LTS
I worked through the instructions for installing wsl for windows 10, from:
https://docs.microsoft.com/en-us/windows/wsl/install-win10
However, I cannot connect to the internet from Ubuntu. I switched off the firewall as suggested here:
https://docs.microsoft.com/en-us/windows/wsl/faq#why-do-i-not-have-internet-access-from-wsl-
But still could not connect.
There are a few things I have tried already but they did not resolve the problem (see below).
As in the FAQ page:
https://docs.microsoft.com/en-us/windows/wsl/faq#where-can-i-provide-feedback-
Thanks!
From Ubuntu terminal I tried to install:
curl https://get.volta.sh | bash
(6) Could not resolve host: get.volta.sh
so I tried:
ping 8.8.8.8
ping: connect: Network is unreachable
I already posted a request for that but the problem is network access:
[https://askubuntu.com/questions/1348348/trying-to-install-volta-sh-package-library]4
Some of the troubleshooting steps I have tried (which did not work)
- Disabled the firewall.
- Re-installed ubuntu.
- BT (my internet provider), port forwarding: https://www.bt.com/help/broadband/learn-about-broadband/how-do-i-set-up-port-forwarding-on-my-bt-hub-
- Checked Network Connection settings
Ethernet Properties
vEthernet Properties (WSL)
Hyper-V Virtual Ethernet Adapter
Internet Protocol Version 4 (TCP/IPv4) -checked
Internet Protocol Version 6 (TCP/IPv6) -checked
Hyper-V Extensible Virtual Switch -unchecked
- Checked Device Manager (View Hidden)
Network adapters > Hyper-V Virtual Ethernet Adapter Properties
Device status - This device is working properly.
- Turn Windows features on and off
Uncheck Windows Subsystem for Linux
Windows needs to reboot your PC to finish the requested changes
Recheck Windows Subsystem for Linux
Windows needs to reboot
- Change the nameserver
sudo nano /etc/resolv.conf
'# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/resolv.conf
'# [network]
'# generateResolvConf = false
nameserver xxx.xx.xx
Change the name server to 8.8.8.8 and save the file. You should now be able to connect to the internet.
-even restarted ubuntu, same error after restarting and the nameserver seems to be reset to default
- Flush DNS
Open Powershell or Cmd as Administrator
and run each of these commands:
wsl --shutdown
netsh winsock reset
netsh int ip reset all
netsh winhttp reset proxy
ipconfig /flushdns
Hit the Windows Key,
type Network Reset,
hit enter.
You should see this window.
Click "Reset now".
Restart Windows