Skip to content

WSL: Connection fails on Arch Linux when networkingMode is set to mirrored #11224

@alysnnix

Description

@alysnnix
  • VSCode Version: 1.104.2
  • Local OS Version: Windows 11 24H2
  • Remote OS Version:
    • Version: 2.6.1.0
    • Kernel version: WSL2 Kernel 6.6.x
    • Architecture: x86-64
    • Distro: Arch Linux
  • Remote Extension/Connection Type: WSL

Problem Description

The VS Code WSL extension fails to connect to an Arch Linux distribution when the WSL networkingMode is set to mirrored. The VS Code window opens and attempts to connect, but it gets stuck on the "Opening Remote..." step and eventually times out without ever establishing a connection.

The issue is fully resolved by removing the networkingMode=mirrored setting from the .wslconfig file and restarting WSL, which confirms the problem is specific to this networking mode.

Steps to Reproduce:

  1. Configure WSL to use mirrored networking mode by adding the following to your %USERPROFILE%\.wslconfig file:
    [wsl2]
    networkingMode=mirrored
  2. Restart the WSL service to apply the new configuration by running wsl --shutdown in PowerShell or CMD.
  3. Attempt to open any folder within the Arch Linux WSL distro using VS Code (e.g., by running code . in the Arch terminal).
  4. Observe that the VS Code client fails to connect to the WSL server.

Logs

WSL Extension Log
[2025-09-27 05:20:23.133] * Visual Studio Code Server
[2025-09-27 05:20:23.133] *
[2025-09-27 05:20:23.133] * By using the software, you agree to
[2025-09-27 05:20:23.133] * the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and
[2025-09-27 05:20:23.133] * the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).
[2025-09-27 05:20:23.133] *
[2025-09-27 05:20:23.133] Server bound to 127.0.0.1:41814 (IPv4)
[2025-09-27 05:20:23.133] Extension host agent listening on 41814
[2025-09-27 05:20:23.133] 
[2025-09-27 05:20:23.133] [02:20:22] Remote configuration data at /home/<USERNAME>/.vscode-server
[2025-09-27 05:20:23.133] [02:20:22] process arguments: {
[2025-09-27 05:20:23.133]   _: [],
[2025-09-27 05:20:23.133]   host: '127.0.0.1',
[2025-09-27 05:20:23.133]   port: '0',
[2025-09-27 05:20:23.133]   'connection-token': '<CONNECTION_TOKEN>',
[2025-09-27 05:20:23.133]   'without-connection-token': false,
[2025-09-27 05:20:23.133]   'disable-websocket-compression': true,
[2025-09-27 05:20:23.133]   'print-startup-performance': false,
[2025-09-27 05:20:23.133]   'print-ip-address': false,
[2025-09-27 05:20:23.133]   'accept-server-license-terms': true,
[2025-09-27 05:20:23.133]   'telemetry-level': 'all',
[2025-09-27 05:20:23.133]   'enable-smoke-test-driver': false,
[2025-09-27 05:20:23.133]   'disable-telemetry': false,
[2025-09-27 05:20:23.133]   'disable-experiments': false,
[2025-09-27 05:20:23.133]   'disable-workspace-trust': false,
[2025-09-27 05:20:23.133]   log: [ 'trace' ],
[2025-09-27 05:20:23.133]   'force-disable-user-env': false,
[2025-09-27 05:20:23.133]   'enable-sync': false,
[2025-09-27 05:20:23.133]   'use-test-resolver': false,
[2025-09-27 05:20:23.133]   'update-extensions': false,
[2025-09-27 05:20:23.133]   'list-extensions': false,
[2025-09-27 05:20:23.133]   'show-versions': false,
[2025-09-27 05:20:23.133]   force: false,
[2025-09-27 05:20:23.133]   'do-not-sync': false,
[2025-09-27 05:20:23.133]   'do-not-include-pack-dependencies': false,
[2025-09-27 05:20:23.133]   'pre-release': false,
[2025-09-27 05:20:23.133]   'start-server': false,
[2025-09-27 05:20:23.133]   'enable-remote-auto-shutdown': false,
[2025-09-27 05:20:23.133]   'remote-auto-shutdown-without-delay': false,
[2025-09-27 05:20:23.133]   'use-host-proxy': true,
[2025-09-27 05:20:23.133]   'without-browser-env-var': true,
[2025-09-27 05:20:23.133]   help: false,
[2025-09-27 05:20:23.133]   version: false,
[2025-09-27 05:20:23.133]   'user-data-dir': '/home/<USERNAME>/.vscode-server/data',
[2025-09-27 05:20:23.133]   'builtin-extensions-dir': '/home/<USERNAME>/.vscode-server/bin/e3a5acfb517a443235981655413d566533107e92/extensions',
[2025-09-27 05:20:23.133]   'extensions-dir': '/home/<USERNAME>/.vscode-server/extensions',
[2025-09-27 05:20:23.133]   logsPath: '~/.vscode-server/data/logs/20250927T022022'
[2025-09-27 05:20:23.133] }
[2025-09-27 05:20:23.133] [02:20:22] 
[2025-09-27 05:20:23.133] 
[2025-09-27 05:20:23.133] 
[2025-09-27 05:20:23.133] 
[2025-09-27 05:20:23.133] 
[2025-09-27 05:20:23.133] [02:20:23] [File Watcher (node.js)] Request to start watching: /home/<USERNAME>/.vscode-server/data/Machine (excludes: <none>, includes: <all>, filter: <none>, correlationId: <none>),/home/<USERNAME>/.vscode-server/data/Machine/settings.json (excludes: <none>, includes: <all>, filter: <none>, correlationId: <none>)
[2025-09-27 05:20:23.133] [02:20:23] [File Watcher (node.js)] ignoring a path for watching who's stat info failed to resolve: /home/<USERNAME>/.vscode-server/data/Machine/settings.json (error: Error: ENOENT: no such file or directory, stat '/home/<USERNAME>/.vscode-server/data/Machine/settings.json')
[2025-09-27 05:20:23.133] [02:20:23] [File Watcher (node.js)] starting fs.watchFile() on /home/<USERNAME>/.vscode-server/data/Machine/settings.json (correlationId: undefined)
[2025-09-27 05:20:23.133] [02:20:23] ExtensionManagementService#cleanUp
[2025-09-27 05:20:23.133] [02:20:23] ExtensionManagementService#removeTempDeleteFolders
[2025-09-27 05:20:23.133] [02:20:23] Extension host agent started.
[2025-09-27 05:20:23.133] [02:20:23] [File Watcher (node.js)] Request to start watching: /home/<USERNAME>/.vscode-server/extensions (excludes: <none>, includes: <all>, filter: <none>, correlationId: <none>)
[2025-09-27 05:20:23.133] [02:20:23] [File Watcher (node.js)] Request to stop watching: /home/<USERNAME>/.vscode-server/data/Machine/settings.json (excludes: <none>, includes: <all>, filter: <none>, correlationId: <none>)
[2025-09-27 05:20:23.133] [02:20:23] [File Watcher (node.js)] stopping file watcher (/home/<USERNAME>/.vscode-server/data/Machine/settings.json (excludes: <none>, includes: <all>, filter: <none>, correlationId: <none>))
[2025-09-27 05:20:23.133] [02:20:23] No extensions are marked as removed.
[2025-09-27 05:20:23.133] [02:20:23] [File Watcher (node.js)] Started watching: '/home/<USERNAME>/.vscode-server/data/Machine'
[2025-09-27 05:20:23.133] [02:20:23] [File Watcher (node.js)] Request to start watching: /home/<USERNAME>/.vscode-server/extensions/extensions.json (excludes: <none>, includes: <all>, filter: <none>, correlationId: <none>)
[2025-09-27 05:20:23.133] [02:20:23] [File Watcher (node.js)] Started watching: '/home/<USERNAME>/.vscode-server/extensions'
[2025-09-27 05:20:23.133] [02:20:23] [File Watcher (node.js)] Started watching: '/home/<USERNAME>/.vscode-server/extensions/extensions.json'
[2025-09-27 05:20:23.140] + CODE_PROFILE=/home/<USERNAME>/.vscode-server/server-env-setup
[2025-09-27 05:20:23.140] + printf 'Setting up server environment: Looking for %s. ' /home/<USERNAME>/.vscode-server/server-env-setup
[2025-09-27 05:20:23.140] + '[' -f /home/<USERNAME>/.vscode-server/server-env-setup ']'
[2025-09-27 05:20:23.140] + echo 'Not found.'
[2025-09-27 05:20:23.140] + VSCODE_REMOTE_BIN=/home/<USERNAME>/.vscode-server/bin
[2025-09-27 05:20:23.140] ++ uname -r
[2025-09-27 05:20:23.140] + WSL_VERSION=6.6.87.2-microsoft-standard-WSL2
[2025-09-27 05:20:23.140] + echo 'WSL version: 6.6.87.2-microsoft-standard-WSL2 archlinux'
[2025-09-27 05:20:23.140] + '[' -x /usr/bin/wslinfo ']'
[2025-09-27 05:20:23.140] + printf 'Network mode: '
[2025-09-27 05:20:23.140] + /usr/bin/wslinfo --networking-mode
[2025-09-27 05:20:23.140] ++ dirname /mnt/c/Users/<USERNAME>/.vscode/extensions/ms-vscode-remote.remote-wsl-0.104.2/scripts/wslServer.sh
[2025-09-27 05:20:23.140] + /mnt/c/Users/<USERNAME>/.vscode/extensions/ms-vscode-remote.remote-wsl-0.104.2/scripts/wslDownload.sh e3a5acfb517a443235981655413d566533107e92 stable /home/<USERNAME>/.vscode-server/bin
[2025-09-27 05:20:23.140] + '[' '!' -d /home/<USERNAME>/.vscode-server/bin/e3a5acfb517a443235981655413d566533107e92 ']'
[2025-09-27 05:20:23.140] + RC=0
[2025-09-27 05:20:23.140] + '[' 0 -ne 0 ']'
[2025-09-27 05:20:23.140] + echo 'WSL-shell-PID: 455'
[2025-09-27 05:20:23.140] + echo 'Node executable: /home/<USERNAME>/.vscode-server/bin/e3a5acfb517a443235981655413d566533107e92/node'
[2025-09-27 05:20:23.140] + echo 'Starting server: /home/<USERNAME>/.vscode-server/bin/e3a5acfb517a443235981655413d566533107e92/bin/code-server --host=127.0.0.1 --port=0 --connection-token=<CONNECTION_TOKEN> --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --log=trace --telemetry-level=all'
[2025-09-27 05:20:23.140] + '[' -f /etc/alpine-release ']'
[2025-09-27 05:20:23.140] ++ uname -m
[2025-09-27 05:20:23.140] + '[' x86_64 = aarch64 ']'
[2025-09-27 05:20:23.140] + /home/<USERNAME>/.vscode-server/bin/e3a5acfb517a443235981655413d566533107e92/bin/code-server --host=127.0.0.1 --port=0 --connection-token=<CONNECTION_TOKEN> --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --log=trace --telemetry-level=all
[2025-09-27 05:20:23.144] Started local proxy server on 53806.
[2025-09-27 05:20:23.144] WSL resolver response: 127.0.0.1:53806
[2025-09-27 05:20:23.144] To debug connection issues, open a local browser on http://127.0.0.1:53806/version
[2025-09-27 05:20:23.144] Extension host environment: {
[2025-09-27 05:20:23.144]   "LSCOLORS": "Gxfxcxdxbxegedabagacad",
[2025-09-27 05:20:23.144]   "WSL2_GUI_APPS_ENABLED": "1",
[2025-09-27 05:20:23.144]   "WSL_DISTRO_NAME": "archlinux",
[2025-09-27 05:20:23.144]   "WT_SESSION": "<WT_SESSION>",
[2025-09-27 05:20:23.144]   "__ETC_PROFILE_NIX_SOURCED": "1",
[2025-09-27 05:20:23.144]   "NAME": "Code",
[2025-09-27 05:20:23.144]   "NIX_PROFILES": "/nix/var/nix/profiles/default /home/<USERNAME>/.nix-profile",
[2025-09-27 05:20:23.144]   "LOGNAME": "<USERNAME>",
[2025-09-27 05:20:23.144]   "HOME": "/home/<USERNAME>",
[2025-09-27 05:20:23.144]   "LANG": "en_US.UTF-8",
[2025-09-27 05:20:23.144]   "LS_COLORS": "rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.7z=01;31:*.ace=01;31:*.alz=01;31:*.apk=01;31:*.arc=01;31:*.arj=01;31:*.bz=01;31:*.bz2=01;31:*.cab=01;31:*.cpio=01;31:*.crate=01;31:*.deb=01;31:*.drpm=01;31:*.dwm=01;31:*.dz=01;31:*.ear=01;31:*.egg=01;31:*.esd=01;31:*.gz=01;31:*.jar=01;31:*.lha=01;31:*.lrz=01;31:*.lz=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.lzo=01;31:*.pyz=01;31:*.rar=01;31:*.rpm=01;31:*.rz=01;31:*.sar=01;31:*.swm=01;31:*.t7z=01;31:*.tar=01;31:*.taz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tgz=01;31:*.tlz=01;31:*.txz=01;31:*.tz=01;31:*.tzo=01;31:*.tzst=01;31:*.udeb=01;31:*.war=01;31:*.whl=01;31:*.wim=01;31:*.xz=01;31:*.z=01;31:*.zip=01;31:*.zoo=01;31:*.zst=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.jxl=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:",
[2025-09-27 05:20:23.144]   "WAYLAND_DISPLAY": "wayland-0",
[2025-09-27 05:20:23.144]   "NIX_SSL_CERT_FILE": "/etc/ssl/certs/ca-certificates.crt",
[2025-09-27 05:20:23.144]   "TERM": "xterm-256color",
[2025-09-27 05:20:23.144]   "ZSH": "/home/<USERNAME>/.oh-my-zsh",
[2025-09-27 05:20:23.144]   "DISPLAY": ":0",
[2025-09-27 05:20:23.144]   "SHLVL": "3",
[2025-09-27 05:20:23.144]   "PAGER": "more",
[2025-09-27 05:20:23.144]   "XDG_RUNTIME_DIR": "/run/user/1000/",
[2025-09-27 05:20:23.144]   "DEBUGINFOD_URLS": "https://debuginfod.archlinux.org ",
[2025-09-27 05:20:23.144]   "WSLENV": "ELECTRON_RUN_AS_NODE/w:WT_SESSION:WT_PROFILE_ID:",
[2025-09-27 05:20:23.144]   "XDG_DATA_DIRS": "/usr/local/share:/usr/share:/home/<USERNAME>/.nix-profile/share:/nix/var/nix/profiles/default/share",
[2025-09-27 05:20:23.144]   "DBUS_SESSION_BUS_ADDRESS": "unix:path=/run/user/1000/bus",
[2025-09-27 05:20:23.144]   "HOSTTYPE": "x86_64",
[2025-09-27 05:20:23.144]   "PULSE_SERVER": "unix:/mnt/wslg/PulseServer",
[2025-09-27 05:20:23.144]   "WT_PROFILE_ID": "<PROFILE_ID_REMOVED>",
[2025-09-27 05:20:23.144]   "_": "/usr/sbin/env"
[2025-09-27 05:20:23.144] }
[2025-09-27 05:20:23.160] Using executable (0) to forward requests from local 53806 to remote 41814
[2025-09-27 05:20:23.160] NodeExecServer run: C:\WINDOWS\System32\wsl.exe -d archlinux -e /home/<USERNAME>/.vscode-server/bin/e3a5acfb517a443235981655413d566533107e92/node -e const net = require('net'); process.stdin.pause(); const client = net.createConnection({ host: '127.0.0.1', port: 41814 }, () => { client.pipe(process.stdout); process.stdin.pipe(client); }); client.on('close', function (hadError) { console.error(hadError ? 'Remote close with error' : 'Remote close'); process.exit(hadError ? 1 : 0); }); client.on('error', function (err) { process.stderr.write(err && (err.stack || err.message) || String(err)); });

Metadata

Metadata

Assignees

Labels

wslIssue in vscode-remote WSL

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions