No network on WSL mirrored mode
Windows Version
Microsoft Windows [Version 10.0.22631.5335]
WSL Version
2.5.7.0
Are you using WSL 1 or WSL 2?
- [x] WSL 2
- [ ] WSL 1
Kernel Version
6.6.87.1-1
Distro Version
Nix-on-wsl
Other Software
No response
Repro Steps
$ ping google.com
ping: google.com: Name or service not known
Wireless network works as intended, ethernet doesn't work by itself. Before I managed to make it work with not connecting through dock station but directly to the laptop however now this also doesn't work.
When I replug ethenet cable I see on journal
Jun 16 09:57:54 leo unknown: WSL (296) ERROR: CheckConnection: getaddrinfo() failed: -3
Jun 16 09:57:59 leo unknown: WSL (296) ERROR: CheckConnection: getaddrinfo() failed: -3
At first I thought a duplicate of https://github.com/microsoft/WSL/issues/12310#issuecomment-2934079814 but there is no confirmation about it yet.
Expected Behavior
Having internet connection.
Actual Behavior
No internet connection.
Diagnostic Logs
Will send the logs per email, I reproduced the last error message during log collection as well, by replugging the cable.
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'.
/emailed-logs
Diagnostic information
Found '/emailed-logs', adding tag 'emailed-logs'
I had a similar issue. I had to disable the unused one of the two Windows Ethernet interfaces (one on the laptop, another on the dock) to make it work. No such problem with NAT mode.
I'm experiencing the same issue. The system works correctly in NAT mode, but when switched to mirrored mode, no routes are available:
~$ ip route
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
I'm also seeing identical output in journalctl:
Aug 28 14:12:12 1F91LX3 unknown: WSL (265) ERROR: CheckConnection: getaddrinfo() failed: -3
Aug 28 14:12:17 1F91LX3 unknown: WSL (265) ERROR: CheckConnection: getaddrinfo() failed: -3
Aug 28 14:12:22 1F91LX3 unknown: WSL (265) ERROR: CheckConnection: getaddrinfo() failed: -3
Aug 28 14:12:22 1F91LX3 unknown: WSL (265) ERROR: CheckConnection: getaddrinfo() failed: -3
I also have error 101 and -5
Aug 28 16:19:43 1F91LX3 unknown: WSL (265) ERROR: CheckConnection: connect() failed: 101
Aug 28 16:19:43 1F91LX3 unknown: WSL (265) ERROR: CheckConnection: getaddrinfo() failed: -5
Aug 28 16:19:43 1F91LX3 unknown: WSL (265) ERROR: CheckConnection: getaddrinfo() failed: -5
Aug 28 16:19:43 1F91LX3 unknown: WSL (265) ERROR: CheckConnection: connect() failed: 101
The connection works over Wi-Fi but not over Ethernet.
@octvs did you find a fix ?
I've the impression that the issue comes from Hyper-v.
On powershell I can read the logs from Hyper-v
Get-WinEvent -LogName "Microsoft-Windows-Hyper-V-Worker-Admin" -MaxEvents 20 | Where-Object {$_.TimeCreated -gt (Get-Date).AddHours(-1)} | Format-List TimeCreated, Id, LevelDisplayName, Message
I can see warning like Static MAC address XXXXXX for "" (XXXXXXX-XXXXX-XXXXXXX) conflicts with another adapter. (it's a VmNicStaticMacConflct error, raised from Hyper-V)
I can see error like
'VM-ID-001' {VOLUME-ID-001} (Instance ID VOLUME-ID-001): Failed to Power on with Error 'The
wrong diskette is in the drive. Insert VM-ID-001 (Volume Serial Number: {VOLUME-ID-001}) into drive
VM-ID-001. ' (0x80070022). (Virtual machine ID VM-ID-001)
Ok I found the solution for me.
TL;DR: I had two Ethernet adapters with the same MAC address - it looks like mirrored mode can't handle that.
Diagnosis
In PowerShell (run as admin), check the adapters:
Get-NetAdapter | Where-Object {$_.Name -like "*<your-mac-address>*"} | Format-Table Name, Status, InterfaceDescription
Name Status InterfaceDescription
---- ------ --------------------
Ethernet 4 Up Realtek USB GbE Family Controller #2
Ethernet Disconnected Intel(R) Ethernet Connection (23) I219-LM
You can get the specific MAC address by reading the Hyper-V error from my previous message.
I had two adapters with the same MAC address. This is likely seen as a MAC address conflict by WSL. "Ethernet 4" exists because I'm using a USB-C to Ethernet connection.
My guess is : Mirrored mode attempts to map physical network interfaces directly to WSL2. When it detects two interfaces with the same MAC address, Hyper-V generates the VmNicStaticMacConflct error and refuses to initialize the virtual network.
Now disable the adapter that's not active (the "Disconnected" one):
Disable-NetAdapter -Name "Ethernet" -Confirm:$false
Then restart WSL and it should work:
wsl --shutdown
PS: What tipped me off was seeing this in journalctl: hv_netvsc ...: unable to add netvsc device (ret -19)
I also had connection issue with mirrored mode, update to wsl 2.6.1 (with wsl --update --pre-release) fixed the issue for me.
Thanks for the pointers, @CallisteH, I just figured out that the Dell Pass-Through MAC address is used for both the Docking Station and also the Dell monitor (it also has ethernet port). Disabling one of them fixed the hv_netvsc errors for me.
I still see the following in the logs:
Sep 04 00:20:30 oldium-gen2 unknown: WSL (245) ERROR: CheckConnection: getaddrinfo() failed: -5
Sep 04 00:20:30 oldium-gen2 unknown: WSL (245) ERROR: CheckConnection: getaddrinfo() failed: -5
Sep 04 00:21:12 oldium-gen2 unknown: WSL (245) ERROR: CheckConnection: connect() failed: 101
although it starts eventually and networking works for me.
I wasn't able to answer this earlier since the problem occured on a specific configuration (at one worksite of mine) which I had to be back at to test.
This morning I finally had the chance, since the problem occured again once I'm back at the said location. @CallisteH your analysis and solution is totally correct for my case. Thanks a lot for providing all the information and the effort.
@oldium, I'm a but puzzled with your wording, did the update fix the issue discussed here? Or disabling fixed it and the update was a general recommendation?
@oldium, I'm a but puzzled with your wording, did the update fix the issue discussed here? Or disabling fixed it and the update was a general recommendation?
It worked for me (this does not mean it will work for everybody). The update fixed the network connectivity from WSL for me (before update the ping was not possible, but DNS worked). Next, the disabling of duplicate-MAC network interface fixed (at least some) warnings shown in journalctl.
Unfortunately, the problem hit me again. I am trying to disable network interfaces, because of the Event Log message, but after disabling like 3 interfaces (including hidden ones) I got the following issue in Event Log:
Message : 'D562B69F-2125-4FA7-AA1F-86E143B5B328' Static MAC address 00BE437C41E6 for "" (72072D11-CBD1-4209-B3B5-83D781D2364B) conflicts with another adapter.
But the MAC address is listed only once:
#> Get-NetAdapter -IncludeHidden | Format-Table Name, Status, InterfaceDescription, MacAddress
Name Status InterfaceDescription MacAddress
---- ------ -------------------- ----------
Připojení k místní síti* 4 Disconnected WAN Miniport (IKEv2)
Ethernet Docking Station Disabled Realtek USB GbE Family Controller 00-BE-43-7C-41-E7
vSwitch (FSE Switch) Up Hyper-V Virtual Switch Extension Adapter #2
Ethernet U3223QE Not Present Realtek USB GbE Family Controller #2 00-BE-43-7C-41-E7
Ethernet (ladicí program jádra) Not Present Microsoft Kernel Debug Network Adapter
Připojení k místní síti* 7 Disconnected WAN Miniport (PPPOE)
vEthernet (FSE HostVnic) Up Hyper-V Virtual Ethernet Container Adapter 00-15-5D-A4-F8-10
Připojení k místní síti* 8 Up WAN Miniport (IP)
Teredo Tunneling Pseudo-Interface Not Present
vEthernet (Default Switch) Up Hyper-V Virtual Ethernet Adapter 00-15-5D-1A-0D-54
WiFi Up Intel(R) Wi-Fi 6E AX211 160MHz 54-6C-EB-02-EC-66
Připojení k místní síti* 6 Disconnected WAN Miniport (PPTP)
Ethernet Notebook Disconnected Intel(R) Ethernet Connection (16) I219-LM 00-BE-43-7C-41-E6
vSwitch (Default Switch) Up Hyper-V Virtual Switch Extension Adapter
Připojení k místní síti* 1 Disabled Microsoft Wi-Fi Direct Virtual Adapter 54-6C-EB-02-EC-67
Připojení k místní síti* 10 Up WAN Miniport (Network Monitor)
Připojení k místní síti* 9 Up WAN Miniport (IPv6)
Microsoft IP-HTTPS Platform Interface Not Present
Síťové připojení Bluetooth Disconnected Bluetooth Device (Personal Area Network) 54-6C-EB-02-EC-6A
Připojení k místní síti* 5 Disconnected WAN Miniport (L2TP)
Připojení k místní síti* 3 Disconnected WAN Miniport (SSTP)
6to4 Adapter Not Present
There is really some serious issue in WSL startup.
This time it was probably caused by having the WSL window opened on the second user account. WSL is probably not able to run for two users simultaneously. Sorry for the noise.
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 in Collect WSL logs for networking issues
Once completed please upload the output files to this GitHub issue.
See Collect WSL logs (recommended method).
If you choose to email these logs instead of attaching them to the bug, please send them to [email protected] with the GitHub issue number in the subject, and include a link to your GitHub issue comment in the message body, and reply with '/emailed-logs'.
This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-file it as a new issue.
Thank you!