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 mirror mode not working #12161

Closed
1 of 2 tasks
wang201314 opened this issue Oct 13, 2024 · 3 comments
Closed
1 of 2 tasks

WSL mirror mode not working #12161

wang201314 opened this issue Oct 13, 2024 · 3 comments

Comments

@wang201314
Copy link

Windows Version

Microsoft Windows [版本 10.0.22631.4169]

WSL Version

2.3.24.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.153.1

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

Contents of .wslconfig file:

# Some recommended configuration options are as follows

[wsl2]                      # Core configuration

autoProxy=false             # Whether to force WSL2/WSLg to use Windows proxy settings (enable as needed)
dnsTunneling=false          # WSL2/WSLg DNS tunneling to forward DNS requests through the Windows proxy (enable as needed)
firewall=true               # Windows firewall integration for WSL2/WSLg, allowing Hyper-V or WPF to filter traffic from the subsystem (enable as needed)
guiApplications=true        # Enable WSLg GUI application support
ipv6=true                   # Enable IPv6 network support
localhostForwarding=true    # Enable localhost forwarding support
memory=4GB                  # Limit maximum memory usage of the WSL2/WSLg subsystem
nestedVirtualization=true   # Enable nested virtualization support in the WSL2/WSLg subsystem
networkingMode=mirrored     # Enable the mirrored networking feature
#pageReporting=true          # Enable WSL2/WSLg page file reporting to allow Windows to reclaim unused allocated memory
processors=8                # Set the number of logical CPU cores for the WSL2/WSLg subsystem to 8 (cannot exceed the number of physical cores)
vmIdleTimeout=-1            # Set idle timeout for WSL2 VM instance; -1 means never shut down (seems to apply only to Win11+)

[experimental]                  # Experimental features (may become standard in future releases)

autoMemoryReclaim=gradual       # Enable gradual automatic memory reclamation; other options: dropcache / disabled (immediate/disabled)
hostAddressLoopback=true        # Enable local loopback support between WSL2/WSLg and the Windows host
sparseVhd=true                  # Enable automatic virtual hard disk space reclamation for WSL2/WSLg
bestEffortDnsParsing=true       # Used with dnsTunneling; Windows will attempt to resolve issues by ignoring unknown records in DNS requests (enable as needed)
useWindowsDnsCache=false        # Used with dnsTunneling; decide whether to use the Windows DNS cache pool

After running the following commands:

wsl --terminate Ubuntu

wsl

ifconfig

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
      inet 172.20.237.175  netmask 255.255.240.0  broadcast 172.20.239.255
      inet6 fe80::215:5dff:fe35:4b32  prefixlen 64  scopeid 0x20<link>
      ether 00:15:5d:35:4b:32  txqueuelen 1000  (Ethernet)
      RX packets 28945020  bytes 40629431698 (40.6 GB)
      RX errors 0  dropped 2  overruns 0  frame 0
      TX packets 8424081  bytes 836350436 (836.3 MB)
      TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
      inet 127.0.0.1  netmask 255.0.0.0
      inet6 ::1  prefixlen 128  scopeid 0x10<host>
      loop  txqueuelen 1000  (Local Loopback)
      RX packets 1011686  bytes 440257398 (440.2 MB)
      RX errors 0  dropped 0  overruns 0  frame 0
      TX packets 1011686  bytes 440257398 (440.2 MB)
      TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

The physical machine has multiple network adapters, but WSL is not selecting any of them for mirroring. Instead, it continues using 172.20.237.175 as the IP address, and internet access is unavailable.

Expected Behavior

WSL is not selecting one of network adapters for mirroring.

Actual Behavior

The physical machine has multiple network adapters, but WSL is not selecting any of them for mirroring. Instead, it continues using 172.20.237.175 as the IP address, and internet access is unavailable.

Diagnostic Logs

No response

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 wsl-gh-logs@microsoft.com 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.

@wang201314
Copy link
Author

these are logs

WslLogs-2024-10-13_11-53-18.zip

Copy link

The log file doesn't contain any WSL traces. Please make sure that you reproduced the issue while the log collection was running.

Diagnostic information
.wslconfig found
Failed to parse .wslconfig: doesn't support inline comment# 推荐的一些配置项如下
[wsl2]                      # 核心配置
autoProxy=false             # 是否强制 WSL2/WSLg 子系统使用 Windows 代理设置(请根据实际需要启用)
dnsTunneling=false          # WSL2/WSLg DNS 代理隧道,以便由 Windows 代理转发 DNS 请求(请根据实际需要启用)
firewall=true               # WSL2/WSLg 子系统的 Windows 防火墙集成,以便 Hyper-V 或者 WPF 能过滤子系统流量(请根据实际需要启用)
guiApplications=true        # 启用 WSLg GUI 图形化程序支持
ipv6=true                   # 启用 IPv6 网络支持
localhostForwarding=true    # 启用 localhost 网络转发支持
memory=4GB                  # 限制 WSL2/WSLg 子系统的最大内存占用
nestedVirtualization=true   # 启用 WSL2/WSLg 子系统嵌套虚拟化功能支持
networkingMode=mirrored     # 启用镜像网络特性支持
#pageReporting=true          # 启用 WSL2/WSLg 子系统页面文件通报,以便 Windows 回收已分配但未使用的内存
processors=8                # 设置 WSL2/WSLg 子系统的逻辑 CPU 核心数为 8(最大肯定没法超过硬件的物理逻辑核心数)
vmIdleTimeout=-1            # WSL2 VM 实例空闲超时关闭时间,-1 为永不关闭,根据参数说明,目前似乎仅适用于 Win11+

[experimental]                  # 实验性功能(按照过往经验,若后续转正,则是配置在上面的 [wsl2] 选节)
autoMemoryReclaim=gradual       # 启用空闲内存自动缓慢回收,其它选项:dropcache / disabled(立即/禁用)
hostAddressLoopback=true        # 启用 WSL2/WSLg 子系统和 Windows 宿主之间的本地回环互通支持
sparseVhd=true                  # 启用 WSL2/WSLg 子系统虚拟硬盘空间自动回收
bestEffortDnsParsing=true       # 和 dnsTunneling 配合使用,Windows 将从 DNS 请求中提取问题并尝试解决该问题,从而忽略未知记录(请根据实际需要启用)
useWindowsDnsCache=false        # 和 dnsTunneling 配合使用,决定是否使用 Windows DNS 缓存池

Detected appx version: 2.3.24.0
Found no WSL traces in the logs

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

1 participant