Skip to content

Mirrored mode - WSL chooses to mirror the disconnected host wifi adapter instead of the connected host ethernet adapter #10884

Open

Description

Windows Version

Microsoft Windows [Version 10.0.22631.2792]

WSL Version

2.0.9.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.133.1-1

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

Windows host has two network adapters:

  • Wired (connected)
  • Wifi (disconnected from AP)

Launch WSL2 with mirrored mode on

I expect eth0 to be mapped to the host's ethernet adapter. However, eth0 is down.
Alternatively, eth1 might be mapped to the host's ethernet adapter, however, eth1 is also down.
There's no network connectivity from the WSL2 instance.

When I connect wifi to the AP on the host (keep in mind that ethernet was connected all along), I get:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether f0:2f:74:17:fb:9b brd ff:ff:ff:ff:ff:ff
3: loopback0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:15:5d:94:14:45 brd ff:ff:ff:ff:ff:ff
4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 3c:9c:0f:8c:67:e3 brd ff:ff:ff:ff:ff:ff
    inet 192.168.86.244/24 brd 192.168.86.255 scope global noprefixroute eth1
       valid_lft forever preferred_lft forever
    inet6 fde2:e410:ef31:ba1b:918f:4cbd:b0aa:e961/64 scope global nodad deprecated noprefixroute
       valid_lft forever preferred_lft 0sec
    inet6 fde2:e410:ef31:ba1b:ed0d:5578:aa63:9ee5/128 scope global nodad noprefixroute
       valid_lft forever preferred_lft forever
    inet6 fe80::9a4e:1657:ce6e:4077/64 scope link nodad noprefixroute
       valid_lft forever preferred_lft forever

Notice that eth1 is now mapped to the now connected wifi adapter (fine, I guess), but the connected ethernet adapter is not mapped within the WSL instance (eth0 is down).

Expected Behavior

I expect the ethernet adapter to be always connected in WSL2 as eth0. This is the behavior I get if I change networking back to NAT.

Actual Behavior

❯ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether f0:2f:74:17:fb:9b brd ff:ff:ff:ff:ff:ff
3: loopback0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:15:5d:94:14:45 brd ff:ff:ff:ff:ff:ff
4: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether 3c:9c:0f:8c:67:e3 brd ff:ff:ff:ff:ff:ff

Diagnostic Logs

No response

Activity

  1. github-actions commented on Dec 7, 2023

    @github-actions
    Contributor

    Hi I'm an AI powered bot that finds similar issues based off the issue title.

    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. Thank you!

    Open similar issues:

    Closed similar issues:

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

  2. chanpreetdhanjal commented on Dec 11, 2023

    @chanpreetdhanjal
  3. 0Delta commented on May 14, 2024

    @0Delta

    same problem
    If I provide information on his behalf, will this progress?

  4. chanpreetdhanjal commented on May 14, 2024

    @chanpreetdhanjal

    We will prioritize it with other items we have in our queue as soon as we get networking logs.

  5. 0Delta commented on May 15, 2024

    @0Delta

    Thank you for your progress in the investigation.
    My environment and logs.

    Windows Version

    Microsoft Windows 11
    Version 23H2
    OS build 22631.3527
    Windows Version (from wsl --version ) 10.0.22631.3527

    WSL Version

    2.1.5.0

    Are you using WSL 1 or WSL 2?

    WSL 2

    Kernel Version

    5.15.146.1-2

    Distro Version

    Ubuntu 22.04

    Logs

    WslLogs-2024-05-15_14-45-20.zip
    WslNetworkingLogs-2024-05-15_14-44-17.zip

  6. CatalinFetoiu commented on May 16, 2024

    @CatalinFetoiu
    Contributor

    hello 0Delta (@0Delta). thanks for attaching the logs

    it looks like the interfaces mirrored in Linux (eth0 and eth1) are in a bad state, they are down and don't have IP addresses assigned. this is already the case before the tracing was started.

    in order to see what caused the interfaces to be in this state, can you please collect new logs by doing the following?

    start the networking logs script
    run "wsl --shutdown"
    start wsl and reproduce the issue
    stop the networking logs script

    thanks

  7. 0Delta commented on May 22, 2024

    @0Delta

    Hi Cătălin Emil Fetoiu (@CatalinFetoiu) .

    I tried to follow your instructions but ran into some problems.
    I managed to get the logs by swapping steps and using tricks and I am attaching them.

    I did the following steps

    • wsl --shutdown
    • collect-networking-logs.ps1
    • Connect PC to internet via Wifi
    • Start WSL2
    • ping 8.8.8.8 within WSL2 (works fine)
    • Connect wired to PC, automatically switches from wireless to wired
    • ping starts to fail
    • Exit collect-networking-logs.ps1.
    • Archive generation fails with the following message, so copy the directory created before archive generation
    • Compressed the copied backup with 7zip.
    PS C:\Users\zdelta> .\collect-networking-logs.ps1
    
    
        ディレクトリ: C:\Users\zdelta
    
    
    Mode                 LastWriteTime         Length Name
    ----                 -------------         ------ ----
    d-----        2024/05/22     23:40                WslNetworkingLogs-2024-05-22_23-40-27
    wsl_networking.wprp not found in the current directory. Downloading it from GitHub.
    networking.sh not found in the current directory. Downloading it from GitHub.
    
    データ収集を初期化しています。お待ちください。
    初期化が完了しました。シナリオを再現し、次に 'capture stop' を実行します。
    
    Log collection is running. Please reproduce the problem and press any key to save the logs.
    Saving logs...
    データ収集が正常に行われました。出力 = WslNetworkingLogs-2024-05-22_23-40-27/wfpdiag.cab
    
    100%  [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>]
    
    "3" 個の引数を指定して "Write" を呼び出し中に例外が発生しました: "ストリームが長すぎます。"
    発生場所 C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.Archive\Microsoft.PowerShell.Archive.psm1:820 文字:29
    + ...                     $destStream.Write($buffer, 0, $numberOfBytesRead)
    +                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : IOException
    
    Logs saved in: C:\Users\zdelta\WslNetworkingLogs-2024-05-22_23-40-27.zip. Please attach that file to the GitHub issue.
    

    The final log is here.
    WslNetworkingLogs-2024-05-22_23-40-27_bak.zip

    Thanks for the research.

  8. CatalinFetoiu commented on May 22, 2024

    @CatalinFetoiu
    Contributor

    0Delta (@0Delta) sorry about the issues with the script. unfortunately the zip you shared does not contain a logs.etl file, which is needed for investigating the issue.

    can you try restarting the Windows machine, then running the script again? It's possible some cleanup of the script did not succeed and it's interfering with reruns of the script.

    please run collect-networking-logs.ps1 first, then run "wsl --shutdown". WSL autorestarts, so if we start the script after running "wsl --shutdown", it's possible some parts of the WSL initialization are not captured in the logs.

    thanks

  9. 0Delta commented on May 23, 2024

    @0Delta

    Cătălin Emil Fetoiu (@CatalinFetoiu)
    I have good news and bad news.

    I rebooted my PC and WSL2 is still online and communicating even after switching between wired and wireless and I am no longer able to log.
    Is there an update or something wrong ......

    Anyway, I am currently unable to proceed with this ticket.
    If it reoccurs, I will attach the log.

  10. 0Delta commented on May 31, 2024

    @0Delta

    Hello.

    Unfortunately, the problem has recurred again.
    The log was generated, but there was a problem that the compressed file was not generated as before.
    As in the previous time, we took a backup before compression of the file and compressed it. This time, Logs.etl also exists, but it has become a huge of 7GB. (It is 230MB even if compressed)

    So i couldn't attach it here, so I put it in Google Cloud Storage.

    https://storage.googleapis.com/wsl_issues_10884/WslNetworkingLogs-2024-05-31_23-50-14_bak.zip
    sha256 hash : b18c2804cf66fdd5a60d634b5e7cfc4ffb2b735114f55aa759c1030bb555aa97

  11. cveld commented on Jun 21, 2024

    @cveld

    Can we enforce WSL to mirror a specific eth adapter? I have three in wsl, and not sure if it tries to mirror the right one. At least in mirrored mode I am not able to connect from Windows to a wsl service. eth0 is the working one; I would expect it defaults to this anyways. So maybe my issue is somewhere else.

  12. doychinresolve commented on Feb 21, 2025

    @doychinresolve

    I have similar problem. I see two eth adapters in WSL but both are down.
    when I check the routing table it is empty.
    I have a VPN which when is connected I can see as new eth interface in WSL and the static routes associated with that VPN are visible in the routing table.

    In my case I suspect that this happened when I installed an updated driver version of the LAN adapter. For some reason the vswitch that is supposed to connect WSL with the network is still pointing the wrong network adapter that is not there anymore.

    I tried with WSL and hyper-v uninstall and reinstall but it always ends in the same situation.

  13. alexrsagen commented on Feb 9, 2026

    @alexrsagen

    I am experiencing the same issue with NAT networking mode. Thankfully, mirrored networking mode works fine for me.

    I have lots of network adapters installed on my system, such as OpenVPN TAP, Wintun Userspace Tunnel (WireGuard), Hyper-V, Bluetooth PAN, Wi-Fi and Ethernet. Most of these are usually disconnected.

    WSL consistently selects my (disconnected) Wi-Fi interface instead of any connected interface.

    The only workaround to enable NAT networking I've found, is to disable every network adapter except Wi-Fi, then connect to a Wi-Fi network.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions