vscode-remote-release icon indicating copy to clipboard operation
vscode-remote-release copied to clipboard

stuck with `opening remote` because of the `WSL` extension cannot work with `networkingMode=mirrored` in `~/.wslconfig`

Open realysy opened this issue 10 months ago • 5 comments

Is there an existing issue for this bug?

  • [x] I have searched the existing open issues and found none that apply.
  • [x] If I find any issue of interest that is related or closed, I will included a link to it in this issue.

Required Troubleshooting Steps

  • [x] I have read and performed the troubleshooting steps
  • [x] I have tried both values of the remote.SSH.useLocalServer setting
  • [x] My issue was not covered in the Tips and Tricks linked from the Troubleshooting Wiki.
  • [x] I will include a complete copy of my Remote - SSH logs by running Remote-SSH: Show Log in the command palette or from View > Output in the menu bar

[Optional] Diagnose with Copilot

I did not ask the @remote-ssh participant for help

In step 2 of the troubleshooting wiki, what was the result of running the generated SSH command verbatim outside of VS Code?

I did not try step 2 of the troubleshooting steps

Remote-SSH Log

Same issue with this one: https://github.com/microsoft/vscode-remote-release/issues/7486, and the reason and solution is https://github.com/microsoft/vscode-remote-release/issues/7486#issuecomment-2183139998.

Seems like the VSCode WSL extension cannot work with the config networkingMode=mirrored in ~/.wslconfig.


My Env:

  • Host: win 11 23h2
  • wsl: Ubuntu-24.04, Linux 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
  • ~/.wslconfig in host:
      [wsl2]
      processors=12
      memory=16GB
      swap=8GB
    
      networkingMode=mirrored
      autoProxy=true
      dnsTunneling=true
    
  • /etc/wsl.conf in wsl:
    [boot]
    systemd=true
    
    [automount]
    options="metadata,dmask=0022,fmask=0133"
    
  • VSCode v1.91.1, installed in host
  • WSL extension v0.88.5

Expected Behavior

With setting networkingMode=mirrored in ~/.wslconfig in host, VSCode still can be run in wsl code . to open a folder in wsl, opening remote successfully.

Actual Behavior

after running code ., vscode stuck with opening remote

Image

Steps To Reproduce

Anything else?

No response

realysy avatar Feb 19 '25 11:02 realysy

I managed to fix this by running the following:

ethtool -K lo tso off
ethtool -K loopback0 tso off

meanderix avatar Mar 26 '25 16:03 meanderix

Can you provide the WSL log as well.

aeschli avatar Mar 27 '25 08:03 aeschli

@aeschli I think this is a network performance issue akin to https://github.com/microsoft/WSL/issues/8171. The WSL remote extension performs extensive communication on the loopback interface and this seems to be due to TCP Segmentation Offload (I'm able to consistently reproduce this).

meanderix avatar Apr 01 '25 07:04 meanderix

I managed to fix this by running the following:

ethtool -K lo tso off
ethtool -K loopback0 tso off

Thank you! After struggling so long, this finally has solved my issue related not only to slow VS Code remote opening, but also slow internet upload speed (it was ~5-10% upload speed of my host's) of my WSL.

tbaroti avatar Apr 21 '25 15:04 tbaroti

I managed to fix this by running the following:

ethtool -K lo tso off
ethtool -K loopback0 tso off

This does not solve the issue. I experience exactly what was described by OP... everything works great except when in Mirror Mode...

VS Code is just stuck on this repeated loop:

2025-04-26 15:54:58.529 [info] $getCanonicalURI invoked for authority (wsl)
2025-04-26 15:54:58.533 [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-wsl, startup: false, activationEvent: 'onResolveRemoteAuthority:wsl'
2025-04-26 15:54:58.575 [info] [resolveAuthority(wsl,1)][0ms] activating remote resolvers wsl+ubuntu
2025-04-26 15:54:58.575 [info] [resolveAuthority(wsl,1)][0ms] activating resolver for wsl+ubuntu...
2025-04-26 15:54:58.575 [info] [resolveAuthority(wsl,1)][0ms] invoking final resolve()...
2025-04-26 15:54:59.589 [info] [resolveAuthority(wsl,1)][1014ms] waiting...
2025-04-26 15:55:00.603 [info] [resolveAuthority(wsl,1)][2028ms] waiting...
2025-04-26 15:55:01.232 [info] [resolveAuthority(wsl,1)][2658ms] setting tunnel factory...
2025-04-26 15:55:01.233 [info] [resolveAuthority(wsl,1)][2658ms] returned 127.0.0.1:60923
2025-04-26 15:57:08.282 [info] [resolveAuthority(wsl,2)][0ms] activating remote resolvers wsl+ubuntu
2025-04-26 15:57:08.282 [info] [resolveAuthority(wsl,2)][0ms] activating resolver for wsl+ubuntu...
2025-04-26 15:57:08.282 [info] [resolveAuthority(wsl,2)][0ms] invoking final resolve()...
2025-04-26 15:57:08.282 [info] [resolveAuthority(wsl,2)][0ms] setting tunnel factory...
2025-04-26 15:57:08.283 [info] [resolveAuthority(wsl,2)][0ms] returned 127.0.0.1:60923

jhirschibar avatar Apr 26 '25 19:04 jhirschibar