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

WSL2 can't start after VMware 17.6.0 incident, virtual networking missing #12055

Closed
1 of 2 tasks
Raven-Singularity opened this issue Sep 19, 2024 · 2 comments
Closed
1 of 2 tasks

Comments

@Raven-Singularity
Copy link

Windows Version

Microsoft Windows [Version 10.0.19045.4894]

WSL Version

2.2.4.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.153.1-2 (according to wsl --version)

Distro Version

Ubuntu 20.04 LTS

Other Software

  • VMware Workstation v17.6.0 (but is no longer being used, and was uninstalled)
  • Ubuntu 20.04 LTS (WSL v2) installed long ago via Microsoft Store
  • Debian 12.5 (WSL v2) installed today for testing via Microsoft Store
# wsl --list --all --verbose

  NAME      STATE           VERSION
* Ubuntu    Stopped         2
# wsl --version

WSL version: 2.2.4.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.61
MSRDC version: 1.2.5326
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26091.1-240325-1447.ge-release
Windows version: 10.0.19045.4894

From my generated WSL logs:

Name              : MicrosoftCorporationII.WindowsSubsystemForLinux
Publisher         : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture      : X64
ResourceId        : 
Version           : 2.2.4.0
PackageFullName   : MicrosoftCorporationII.WindowsSubsystemForLinux_2.2.4.0_x64__8wekyb3d8bbwe
InstallLocation   : C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_2.2.4.0_x64__8wekyb3d8bbwe
IsFramework       : False
PackageFamilyName : MicrosoftCorporationII.WindowsSubsystemForLinux_8wekyb3d8bbwe
PublisherId       : 8wekyb3d8bbwe
IsResourcePackage : False
IsBundle          : False
IsDevelopmentMode : False
NonRemovable      : False
IsPartiallyStaged : False
SignatureKind     : Store
Status            : Ok

Repro Steps

Virtual network drivers missing, WSL2 will not start

After an incident with VMware Workstation 17, the virtual network adapter needed by WSL2 have disappeared, and I cannot find any way to recover them. Ubuntu always remains in the status Stopped. I cannot access my internal web sites and programming environment for over a week, this is aggravatingly frustrating and awful.

Steps that got me to where I am:

  1. Auto-updated VMware Workstation Pro to version 17.5.2
  2. Manually upgraded VMware Workstation to version 17.6.0 from the Broadcom web site
  3. Tried out VMware, but experienced bad lag, and issues related to hardware virtualisation within virtualisation
  4. Discovered that installing VMware Workstation 17 broke my WSL2, it would no longer load my Ubuntu
  5. Uninstalled VMware Workstation completely
  6. Removed all traces of VMware from the Registry (encountered permission issues removing old virtual networking entries)
  7. Endlessly installed and uninstalled WSL2 related System Features and rebooted

Expected Behavior

WSL should start up and let me run my local development environment and my local Nginx PHP-FPM web server.

Actual Behavior

When attempting to run my WSL v2 Ubuntu 20.04 distro:

Failed to configure network (networkingMode Nat).
Error code: Wsl/Service/CreateInstance/CreateVm/ConfigureNetworking/HNS/ERROR_FILE_NOT_FOUND

It also says:

To disable networking, set `wsl2.networkingMode=None` in C:\Users\MyUserName\.wslconfig

However, following the instructions to disable networking with wsl2.networkingMode=None does not have any effect. I created the file with the suggested line, but then WSL complains that the file does not have an = sign in it -- which it clearly does, on the first and only line in the file! Because it was not doing anything useful, I removed the file again.

Diagnostic Logs

Features I have added, removed, or reinstalled multiple times include:

[x] Windows Subsystem For Linux
[x] Virtual Machine Platform
[x] Windows Hypervisor Platform
[x] Windows Sandbox
[x] Hyper-V
[x] Containers

I also tried these adding and removing these ones because I heard people on forums having problems with virtual networking adapters with/without these Features enabled:

[x] Microsoft Defender Application Guard
[x] Guarded Host

And I tried this one because it mentioned networking:

[x] Simple TCPIP services (i.e. echo, daytime, etc)

None of these components has had any effect on the missing virtual network drivers.

I also tried these commands from an Administrator PowerShell:

# netsh int ip reset all
# netsh winsock reset
# Restart-Service LxssManager
# Restart-Service -Force -Name hns
# Restart-NetAdapter -Name "vEthernet (WSL)"
# Restart-NetAdapter -Name "Ethernet"
# Get-Service vmcompute | Restart-Service

These commands did not recover the virtual network drivers needed by WSL2.

Commands above with vEthernet (WSL) in them failed due to this adapter not existing. Note: the adapter is not simply hidden. The only adapter that exists is my Intel(R) Ethernet Connection (2) I219-V, everything else has been purged/deleted. Running ipconfig /all only shows the Intel adapter, no virtual networking entries (as would usually show up).

I attempted to install another random distro to see if WSL2 would recreate the required virtual network adapters, but it did not do so. After the installer downloaded Debian, WSL provided this error:

Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80070002
Error: 0x80070002 The system cannot find the file specified.

Another thread mentioned the WSL kernel file might have gone missing as a cause, but my WSL2 kernel appears intact:

# dir %systemroot%\system32\lxss\tools\kernel

Volume in drive C has no label.

Directory of C:\WINDOWS\system32\lxss\tools

2022-03-07  11:05 PM        43,301,584 kernel
               1 File(s)     43,301,584 bytes

Network logs show these errors repeated thousands of times:

2024-09-19 2:14:59 AM,1013,Error,HNS-Network-Create :- 
 Network id = '{b3400b03-3c85-4d7e-8b9e-0fcf91c77ece}'.
 Network type = 'ICS'.
  Result code = '0x80070002'. 
2024-09-19 2:14:59 AM,1013,Error,HNS-Layer-Create :- 
 Network id = '{e76a9b78-ea42-4c81-b2c6-00847988713b}'.
 Network type = 'LAYERED'.
  Result code = '0x80070002'. 
2024-09-19 2:14:59 AM,1000,Error,HNS failed to create vmswitch with error '0x80070002' and adapter id = 'C08CB7B8-9B3C-408E-8E30-5E16A3AEB444'.
2024-09-19 2:14:41 AM,1055,Information,RPC request received. Type: 'Query', Entity: 'Namespace', Id: '{910f7d92-ba2d-4c3f-98ae-7c0ac590d2dc}', Access Level: 'Administrator', Data: '{"ActivityId":"25DA31A2-99C7-454C-B1F7-51352060F09D","AdditionalParams":{},"CompartmentGuid":"B1062982-2B18-4B4F-B3D5-A78DDB9CDD49","CompartmentId":1,"Containers":[],"Flags":0,"Health":{"LastErrorCode":0,"LastUpdateTime":133711942079807386},"ID":"910F7D92-BA2D-4C3F-98AE-7C0AC590D2DC","IsDefault":true,"Policies":[],"State":1,"Version":47244640267,"Resources":null}'

I looked in my Ethernet Adapter properties to see if anything was amiss, and these don't look right:

[x] VMware Bridge Protocol
[  ] Hyper-V Extensible Virtual Switch

I don't want the VMware Bridge Protocol as I already uninstalled VMware, but if I try to uninstall it I receive the following error:

Could not uninstall the VMware Bridge Protocol feature.  The error is 0x8007007E.

I do want the Hyper-V Extensible Virtual Switch as I believe that's how WSL2 produces its virtual network adapter vEthernet (WSL), but when I try to enable it I receive this error message:

Your current selection will also disable the following features:
Hyper-V Extensible Virtual Switch

Are you sure you want to disable these feature(s)?

When I select Yes it then gives me this second pop-up error message:

An unexpected condition occurred.
Not all of your requested changes in settings could be made.

These errors don't make a bit of sense, I am literally just selecting the checkbox for that one feature and hitting Apply.

It seems there is something else that is required before I can enable the virtual switch feature, or else the virtual switch feature on my system is completely broken.

When I go to my Device Manager, under Network Adapters I see Hyper-V Extensible Virtual Switch appearing and disappearing every few seconds. When it appears, it has a yellow exclamation point, and if I load up Properties for it there are hundreds of these add/remove error log entries shown.

Screenshot:

Hyper-V_Extensible_Virtual_Switch_Errors

How can I recreate the missing vEthernet (WSL) virtual network adapter and continue using WSL2?

Copy link

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'.
Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The script will output the path of the log file once done.

If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here

Once completed please upload the output files to this Github issue.

Click here for more info on logging
If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@Raven-Singularity
Copy link
Author

Raven-Singularity commented Sep 19, 2024

After the above, I tried reinstalling my Intel network driver to see if that fixed the issues with the broken Hyper-V virtual switches. Unfortunately, that made it worse. My Intel network adapter also turned into a yellow exclamation point and had the same error message as appeared on my Hyper-V Extensible Virtual Switch in the General tab:

Windows is still setting up class configuration for this device. (Code 56)

After this, my Intel network adapter would not longer accept a driver at all. It would try to install a driver, freeze up for minutes, then give me an error. After a couple more hours of troubleshooting I solved the problem.

There is a registry key that VMware leaves behind, which broke my Hyper-V Extensible Virtual Switch, my regular Intel network adapter, and my WSL2 networking:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{3d09c1ca-2bcc-40b7-b9bb-3f3ec143a87b}

After removing this registry key manually, then clicking Network Reset on the Networking Control Panel page, my system came back up with fully working networking, including my WSL2 launching again!

I'm pretty sure the fix was the registry key, as all my problems started when VMware was installed then uninstalled. But it's possible the Network Reset may have helped. If you are experiencing the same issue, I recommend trying the registry key first, and if that doesn't work, try the Network Reset (or just do both fixes at the same time, like I did).

Note: Network Reset made me wait 5 minutes before it rebooted the system.

Other error codes I experienced which can help search engines finding this solution:

0x80071779
0x80041002

Hope it works for others!

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

No branches or pull requests

2 participants
@Raven-Singularity and others