Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSL vEthernet adapter shows up as disconnected after the latest Windows 10 update (10.0.20197.1000) #5821

Closed
peteykun opened this issue Aug 27, 2020 · 196 comments

Comments

@peteykun
Copy link

peteykun commented Aug 27, 2020

Environment

Windows build number: 10.0.20197.1000
Your Distribution version: Ubuntu 20.04
The issue is on WSL 2.

Steps to reproduce

  1. Start using Ubuntu on WSL2: works fine
  2. After an arbitrary amount of time, no longer able to access the network.
  3. ipconfig on Windows shows
Ethernet adapter vEthernet (WSL):

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

Expected behavior

Network access should be available.

Actual behavior

As the adapter is disconnected, cannot access the network from inside WSL.
This issue did not exist prior to installing the latest Windows update from the dev channel.
Requires a Windows restart to restore network access, but the adapter disconnects once again arbitrarily.

Putting the laptop to sleep and waking it up almost always causes the adapter to show up as disconnected immediately.

Does not seem to be related to the use of a VPN although I use one (via the OpenConnect client).

@Hebilicious
Copy link

Hebilicious commented Aug 27, 2020

I'm having the same issue on 20197.

This is the output of Powershell ipconfig
image
I do not use a VPN, just WSL2 and docker desktop.
Trying to change the DNS settings inside WSL to 8.8.8.8 doesn't work either
Does anyone have a workaround ?

@Hebilicious
Copy link

Seems like it's the same issue as #5805

@vcjr
Copy link

vcjr commented Aug 27, 2020

Having same issue. For me it appear that connectivity is there but once I connect to a wireless connection or plug in the ethernet Media Disconnect happens.

@Biswa96
Copy link

Biswa96 commented Aug 27, 2020

There is a new insider build. Would you like to check?

@vcjr
Copy link

vcjr commented Aug 27, 2020

I currently have it installed and hasn't changed any of the issues.

@xiaoqidun
Copy link

20201,The same problem, wsl network does not work when the system wakes up from sleep.

@xiaoqidun
Copy link

20201 has the same problem, the availability of wsl2 is too poor, and it has been rolled back to wsl1.

@etfeet
Copy link

etfeet commented Aug 27, 2020

I'm seeing this issue as well.
Build 20197.
wsl2 with both Ubuntu 18.04 and 20.04 vm's.

WSL vEethernet adapter appears media disconnected. working fine after reboot. but will be disconnected again within 30 mins.

@craigloewen-msft
Copy link
Member

Hey folks we're looking into resolving this issue! If you're seeing it could you please collect some logs for us and file it in Feedback hub? You can find the instructions to do that here. Please link to your feedback hub item here in this issue to help us find it. Thank you!

@etfeet
Copy link

etfeet commented Aug 27, 2020

heres the feedback hub link - https://aka.ms/AA9g338l

@ajdurand
Copy link

mine as well - https://aka.ms/AA9hjik

@jaysonsantos
Copy link

If it worth mentioning, after sleeping the same network problem also affects Windows Sandbox

@wadjeroudi
Copy link

@craigloewen-msft do you have some workaround to force the vEthernet to connect with a command or something ? thx

@mwoodpatrick
Copy link

I reported what appears to be a related issue in:

#5805

At least in one occurrence for me the disconnection appears to be related to enabling VPN. Is there a log of when events such as switches being connected/disconnected are logged? I currently have not found a way of re-enabling the switch anyone know of a PowerShell command which will do this?

@evantkchong
Copy link

evantkchong commented Aug 28, 2020

@craigloewen-msft Hey I'm having the same issue in build 20197 with Ubuntu 18.04 running with WSL2.
Feedback hub link: https://aka.ms/AA9hz4q

@Hebilicious
Copy link

@mwoodpatrick @craigloewen-msft
I'm having a similar issue. When I connect the host windows machine to an OpenVPN server with the OpenVPN windows client, my Ethernet Adapter vEthernet (WSL) crashes :
image
Does anyone knows how to restart it from the host, ie with Powershell ?

@riv-robot
Copy link

@craigloewen-msft Have the same problem. Just submitted a ticket throuhg the feedback hub. Wasn't signed in so didn't get a link to it.

@evantkchong
Copy link

Tried to see if the problem was resolved in build 20201 but no dice

@jaysonsantos
Copy link

jaysonsantos commented Aug 29, 2020

Another report if it still need https://aka.ms/AA9hmex

@sc0ttwad3
Copy link

Now, with build 20201, it hasn't been corrected, it's gotten worse!

On a laptop with 1 ethernet adapter, 1 Wireless adapter, WSL 2 with one distro, ipconfig shows 30 entries! (Powershell Get-NetIPConfiguration shows the same). How can I purge this back to reality? Note, I've replaced real IP addresses with x.x.x.x

C:\Toolkit>ipconfig                                                                                    
                                                                                                       
Windows IP Configuration                                                                               
                                                                                                                                                                                                              
Ethernet adapter vEthernet (Default Switch):                                                           
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (Default Switch) 2:                                                         
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (WSL):                                                                      
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (Default Switch) 3:                                                         
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (WSL) 2:                                                                    
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (Default Switch) 4:                                                         
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (WSL) 3:                                                                    
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (Default Switch) 5:                                                         
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (WSL) 4:                                                                    
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (Default Switch) 6:                                                         
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (WSL) 5:                                                                    
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (Default Switch) 7:                                                         
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (WSL) 6:                                                                    
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (Default Switch) 8:                                                         
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (WSL) 7:                                                                    
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (Default Switch) 9:                                                         
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (WSL) 8:                                                                    
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (Default Switch) 10:                                                        
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (WSL) 9:                                                                    
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (Default Switch) 11:                                                        
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (WSL) 10:                                                                   
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (Default Switch) 12:                                                        
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (WSL) 11:                                                                   
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (Default Switch) 13:                                                        
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (WSL) 12:                                                                   
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (WSL) 13:                                                                   
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter Ethernet 2:                                                                           
                                                                                                       
   Connection-specific DNS Suffix  . :                                                      
   IPv4 Address. . . . . . . . . . . : x.x.x.x                                                 
   Subnet Mask . . . . . . . . . . . : 255.255.255.0                                                   
   Default Gateway . . . . . . . . . : x.x.x.x                                                    
                                                                                                       
Unknown adapter Local Area Connection:                                                                 
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Wireless LAN adapter Local Area Connection* 2:                                                         
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Wireless LAN adapter Wi-Fi:                                                                            
                                                                                                       
   Connection-specific DNS Suffix  . :                                                     
   IPv4 Address. . . . . . . . . . . : x.x.x.x                                                  
   Subnet Mask . . . . . . . . . . . : 255.255.255.0                                                   
   Default Gateway . . . . . . . . . : x.x.x.x                                                    
                                                                                                       
Ethernet adapter vEthernet (Default Switch) 14:                                                        
                                                                                                       
   Media State . . . . . . . . . . . : Media disconnected                                              
   Connection-specific DNS Suffix  . :                                                                 
                                                                                                       
Ethernet adapter vEthernet (WSL) 14:                                                                   
                                                                                                       
   Connection-specific DNS Suffix  . :                                                                 
   Link-local IPv6 Address . . . . . : xxxx::xxxx:xxxx:xxxxxxxx                                   
   IPv4 Address. . . . . . . . . . . : x.x.x.x                                                   
   Subnet Mask . . . . . . . . . . . : 255.255.240.0                                                   
   Default Gateway . . . . . . . . . :                                                                 
                                                                                                       

@Hebilicious
Copy link

Hebilicious commented Aug 29, 2020

@sc0ttwad3 I'm not experiencing this duplication issue with 20201.
My WSL2 network was also working fine after my laptop woke up from sleep today. I had some issue with Docker Desktop, but so far no weird disconnect. I did try to use openvpn with my host windows and it broke the wsl connection though. I am not sure if those issues are related.

@peteykun
Copy link
Author

peteykun commented Aug 29, 2020

Can confirm that the issue still exists with 20201.1000, though I do not face the adapter duplication @sc0ttwad3 seems to be having. I just tried putting my laptop to sleep and waking it up and the adapter immediately disconnected. Spent the better part of the day trying to install the update, for those having trouble here is my solution to the problem. Regardless, the issue with the WSL adapter still very much persists.

image

image

image

@diasgc
Copy link

diasgc commented Aug 29, 2020

Still experimence it since 20197 update. Relevant info: build 20201.1000 ,WSL2 with Ubuntu 20.04.1 VSCode 1.48.2 synching local '//wsl$/...' git repo. Got this sequence repeting in event viewer Hyper-V Switch ext (last 3 events)

Device ROOT\VMS_VSMP\0000 had a problem starting.

Driver Name: wvms_mp_windows.inf
Class Guid: {4d36e972-e325-11ce-bfc1-08002be10318}
Service: VMSMP
Lower Filters: 
Upper Filters: 
Problem: 0xA
Problem Status: 0xC0000001

Device ROOT\VMS_VSMP\0000 was deleted.

Class Guid: {4d36e972-e325-11ce-bfc1-08002be10318}
Device ROOT\VMS_VSMP\0000 was configured.

Driver Name: wvms_mp_windows.inf
Class Guid: {4d36e972-e325-11ce-bfc1-08002be10318}
Driver Date: 06/21/2006
Driver Version: 10.0.20201.1000
Driver Provider: Microsoft
Driver Section: VMSVSMP.ndi
Driver Rank: 0xFF0000
Matching Device Id: vms_vsmp
Outranked Drivers: 
Device Updated: true
Parent Device: HTREE\ROOT\0

@benhillis benhillis self-assigned this Aug 29, 2020
@benhillis
Copy link
Member

We are investigating, something clearly broke recently in the networking stack.

@abelgana
Copy link

Any workaround?

@vcjr
Copy link

vcjr commented Aug 31, 2020

Best suggestion I can give until this problem is resolved is disconnect any external adapters. Immediately after you boot up if you aren't using a wired connection, connect to your Wi-Fi. Avoid changing or disconnecting any adapters for the time that you need WSL on. For me since doing this the WSL2 adapters has been working and no problems as of yet. (6 Hours since boot time and doing this)

@sergeivolodin
Copy link

sergeivolodin commented Aug 31, 2020

Some temporary solution I found to fix the problem after PC sleep, works without rebooting. Do steps A, B, C below a few times. I'm not sure about the proper order -- it works differently every time for me, but the connection appears after a few trials.

A. Restart the WSL service (Restart-Service LxssManager from admin power shell)

image

or

Win+Rservices.msc

image

B. Restart the Host Network Service

image

C. Disable and then Enable the Hyper-V network device

  1. Go to Device Manager (in Control Panel)
    image

  2. Enable 'Show hidden devices'

image

  1. Open 'Network Adapters'

image

  1. Disable and then Enable the Hyper-V adapters you have

Doing ABC for a few times brings back the connection to WSL and it does not seem to go away!

image

image

@bobodevil
Copy link

Steps above is a workaround.

As stated, I've restarted randomly and finally, it starts working after a couple times.

@mashiro01
Copy link

#5821 (comment)

@sergeivolodin

The posted workaround works for me and I have created a powershell script to run the three steps:

echo "Restarting WSL Service"
Restart-Service LxssManager
echo "Restarting Host Network Service"
Stop-Service -name "hns"
Start-Service -name "hns"
echo "Restarting Hyper-V adapters"
Get-NetAdapter -IncludeHidden | Where-Object `
    {$_.InterfaceDescription.StartsWith('Hyper-V Virtual Switch Extension Adapter')} `
    | Disable-NetAdapter -Confirm:$False
Get-NetAdapter -IncludeHidden | Where-Object `
    {$_.InterfaceDescription.StartsWith('Hyper-V Virtual Switch Extension Adapter')} `
    | Enable-NetAdapter -Confirm:$False

This works fine on my pc.

@ErvalhouS
Copy link

Even though it is not disconnecting the interface anymore, I can observe the same connectivity issues as if it was disconnected on build 20236.

@dcharlespyle
Copy link

dcharlespyle commented Oct 19, 2020 via email

@mariela21180
Copy link

Each time it happens to me, it is always the LxssManager Service. I don’t have to touch the other service or devices anymore. Just LxssManager. I have to stop the service, and when it hangs, end the entire process tree in Resource Monitor, and start the service in Services. Then it works for a while until it happens again, when I then need to end the process tree and start the service again. I haven’t had to touch Host Network Service for the last few builds.

this is happening to me too since today

@ad-on-is
Copy link

Is there any feedback on this yet? I installed a fresh version of Windows 10 on my new laptop, and this issue started to happen again.

@mariela21180
Copy link

Is there any feedback on this yet? I installed a fresh version of Windows 10 on my new laptop, and this issue started to happen again.

I have the same issue, and I also think that it's happening since the last Windows update. I've reported it here: microsoft/vscode-remote-release#3899

@PeterMaco
Copy link

Is this fix included in 21H1 on Beta channel?
image

@therealkenc
Copy link
Collaborator

Is this fix included in 21H1 on Beta channel?

There was no firm indication whether the Ethernet adapter vEthernet (WSL) n: ... Media disconnected problem was transient 20xxx or applied to the 19xxx backport of WSL2. Supposition has been that the problem was transient, given it was identified as a regress. There was only one +1 style post for 19xxx in the issue thread, which did not have a Media disconnect screencap indicating a Media disconnected. Had the Media disconnected problem been endemic in 19xxx there would probably have been more screeching.

@craph
Copy link

craph commented Apr 8, 2021

@therealkenc , @craigloewen-msft I have the same issue here : #6771

I'm on the version 20H2
image
image

So is it possible to backport the fix in version 19xxx ?

@stna1981
Copy link

Is it possible to make this fix also available for the 20H2 release (19042.867). We do nut use Insider builds on our company PCs.

@RashiqAzhan
Copy link

This issue is not done and still present. I do not know why this is closed. I have to do this every boot to get internet in WSL2.

@akrizs
Copy link

akrizs commented Jun 11, 2021

Experiencing a similar issue... usually happens when i plug in or unplug a ethernet cable while im connected to a wifi, LxssManager just hangs on restart and doesn't wanna stop, I basicly have to restart my machine every time i need to plug in an ethernet cable, the WSL2 basicly becomes useless for me if i don't

@dcharlespyle
Copy link

When that happens to me I use Resource Monitor to terminate the entire process tree and allow it to restart. If it doesn't restart in a few seconds, I start it using Services. Have to do it less than I used to but it still happens from time to time.

@XiiDraco
Copy link

Not sure if this is the same issue but the internet connectivity inside of wsl2 is incredibly intermittent. Instead of straight up not working until I need a manual solution it stops working and I have to wait a couple minutes then try whatever I was doing again.

@kreczko
Copy link

kreczko commented Jun 16, 2021

Same issue since 21H1 update:

image

In WSL all network devices (including lo) are down
image

OS Name Microsoft Windows 10 Pro
Version 10.0.19043 Build 19043

image

@dcharlespyle
Copy link

Try setting the HNS service to automatic. You also may need to reset your networking. After doing both, I haven't seen that issue. I'm now on the latest build.

@onomatopellan
Copy link

@kreczko Since you have no IP, make sure you are not hitting #5437

@kreczko
Copy link

kreczko commented Jun 16, 2021

@onomatopellan thanks for the pointer. Indeed, it seems there was still an issue with %temp%.
I've previously undone the compression of the virtual drives (there is at least a helpful error message in that case) and have done the network reset - to no avail.

Undoing the compression on %temp% (+ network reset procedure again) seems to have done the trick.

@sugeng-sulistiyawan
Copy link

#5821 (comment)

Thanks, this works fine for me, Windows 11 Home Single Language V 22H2 Build 22621.1702

@crimsonvspurple
Copy link

Why is this issue closed?

I just faced this on latest windows build (22H2 / 22621.2134). Computer goes to sleep and after wake up, WSL2 (ubuntu) loses access to DNS resulting in no internet connectivity.

@dcharlespyle
Copy link

22621.2134 isn't the latest build. You're actually several updates behind. Update to at least one more revision higher than 22621.2134 and try again. I'm not involved with the Windows Preview program due to the machine being too old and I am at 22H2 / 22621.2215. I have not seen this above issue for some time.

@crimsonvspurple
Copy link

And it was working fine before. Why push broken builds like this on to people? Since this issue happened before on windows TEN, why there isn't a test to catch this? how did it happen again in 22621.2134? ridiculous.

@dcharlespyle
Copy link

And it was working fine before. Why push broken builds like this on to people? Since this issue happened before on windows TEN, why there isn't a test to catch this? how did it happen again in 22621.2134? ridiculous.

There are many permutations in hardware and software that can result in such a problem cropping up on a system unexpectedly. Programmers sometimes end up with a code regression. But sometimes they don't catch it if they don't have the same combination of hardware and software that you are using.

But your build still is behind. You should update. You also can try updating WSL before updating your build to the current public release of Windows 11. In a terminal or powershell prompt, run:

wsl --update

or

wsl --update --pre-release

Then, shutdown WSL and restart it.

@sjdhanasekaran
Copy link

Any working solution for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests