4

Today out of the blue my WSL2 has no network connectivity. How could I fix the issue? Here's information on my system.

Host's internet is fine.

Hope someone can help...

My Windows host says:

C:\WINDOWS\system32>ipconfig

Windows IP Configuration


Ethernet adapter Ethernet:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter VirtualBox Host-Only Network:

   Connection-specific DNS Suffix  . :
   Autoconfiguration IPv4 Address. . : 169.254.50.150
   Subnet Mask . . . . . . . . . . . : 255.255.0.0
   Default Gateway . . . . . . . . . :

Ethernet adapter VirtualBox Host-Only Network #2:

   Connection-specific DNS Suffix  . :
   Autoconfiguration IPv4 Address. . : 169.254.183.238
   Subnet Mask . . . . . . . . . . . : 255.255.0.0
   Default Gateway . . . . . . . . . :

Unknown adapter Local Area Connection:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Local Area Connection* 9:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Local Area Connection* 10:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter Ethernet 3:

   Connection-specific DNS Suffix  . :
   IPv4 Address. . . . . . . . . . . : 172.27.241.136
   Subnet Mask . . . . . . . . . . . : 255.255.255.128
   Default Gateway . . . . . . . . . :

Wireless LAN adapter Wi-Fi:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::5993:95f2:e6a9:3ae%13
   IPv4 Address. . . . . . . . . . . : 192.168.1.102
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.1

Ethernet adapter Bluetooth Network Connection:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter vEthernet (WSL):

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::a13b:1465:781c:2eae%60
   IPv4 Address. . . . . . . . . . . : 172.21.128.1
   Subnet Mask . . . . . . . . . . . : 255.255.240.0
   Default Gateway . . . . . . . . . :

My WSL2 Ubuntu16 Linux says:

$ ifconfig
$

All network interfaces are down:

$ ip link
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 6e:3d:bc:fa:46:33 brd ff:ff:ff:ff:ff:ff
3: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether b2:71:a8:3b:74:c6 brd ff:ff:ff:ff:ff:ff
4: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
5: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:15:5d:0a:3f:de brd ff:ff:ff:ff:ff:ff

There is no WiFi network adapter, although this might be normal if WSL2 connects throught eth0 linked to vEthernet.

$ ifconfig -a                                                      
bond0     Link encap:Ethernet  HWaddr 6e:3d:bc:fa:46:33            
          BROADCAST MASTER MULTICAST  MTU:1500  Metric:1           
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0       
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0     
          collisions:0 txqueuelen:1000                             
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)                   
                                                                   
dummy0    Link encap:Ethernet  HWaddr b2:71:a8:3b:74:c6            
          BROADCAST NOARP  MTU:1500  Metric:1                      
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0       
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0     
          collisions:0 txqueuelen:1000                             
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)                   
                                                                   
eth0      Link encap:Ethernet  HWaddr 00:15:5d:0a:3f:de            
          BROADCAST MULTICAST  MTU:1500  Metric:1                  
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0       
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0     
          collisions:0 txqueuelen:1000                             
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)                   
                                                                   
lo        Link encap:Local Loopback                                
          LOOPBACK  MTU:65536  Metric:1                            
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0       
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0     
          collisions:0 txqueuelen:1000                             
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)                   
                                                                   
sit0      Link encap:IPv6-in-IPv4                                  
          NOARP  MTU:1480  Metric:1                                
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0       
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0     
          collisions:0 txqueuelen:1000                             
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)              

/etc/resolv.conf

$ cat /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4

/etc/wsl.conf

$ cat /etc/wsl.conf
[automount]
root = /
options = "metadata,umask=22,fmask=11"
[network]
generateResolvConf = false
generateHosts = false

Host's internet is fine.

I don't know what else to do.

How could I fix?

Please, help.

1
  • 1
    Not sure, but see if a wsl --shutdown resolves it. If not, check out this thread and comment in particular. Seems to have worked for a number of people, but I'm not sure if that's your exact problem. Commented Feb 11, 2021 at 1:26

3 Answers 3

1

TL;DR Go to The Solution (in my case)

After days of productivity lost, I started noticing two arrows in the icons on my desktop and many other folders. It turned out it was NTFS compression.

The fix was easy, but the discovery long and painful.

The Solution (in my case)

Uncompress recursively all files and folders, likeso:

  1. open a cmd shell
  2. execute compact /U /S /I

In case you're wondering what does option are, They mean: uncompress, recursively and ignore all errors/warnings, respectively. But you can check the help of the command with compact /h.

I still want to see how can I disable completely that this from happening again in the future.

1

The solution with uncompress helped in my case. Here are more details about how to apply it:

  1. Terminate all your important processes inside WSL.
  2. start the Windows shell: cmd.exe
  3. cd %TEMP%
  4. wsl --shutdown - Terminates the WSL2 utility virtual machine.
  5. compact /U /S - Uncompresses files in the current directory (%TEMP%) and recursively in its subdirectories.

It is possible that these two commands would suffice but I did not test them yet:

wsl --shutdown
compact /U %TEMP%

Please let us know if they resolve the problem too.


Note: The idea about the %TEMP% directory comes from this bug report: https://github.com/microsoft/WSL/issues/5775 which was closed without any investigation.

0

To disable the compression completely, refer to the solution here: https://answers.microsoft.com/en-us/windows/forum/all/really-annoying-auto-compression-in-windows-10/8b976fd3-e822-4dc5-a0be-e254239cc640

  1. Right click on Start > Select PowerShell (Admin) Copy/paste the following command into the window then Press Enter.

  2. fsutil behavior set disablecompression 1

  3. Close PowerShell and Reboot

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .