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

VScode opens in Windows Host instead of WSL remote #242375

Open
VarunNikam22 opened this issue Mar 1, 2025 · 4 comments
Open

VScode opens in Windows Host instead of WSL remote #242375

VarunNikam22 opened this issue Mar 1, 2025 · 4 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@VarunNikam22
Copy link

Type: Bug

Context

I'm running a Windows 11 machine with Ubuntu-24.04 installed in the WSL-2.0 envionment. In my workflow, I use the Terminal application to access the distro, and use code . CLI to open VScode workspaces in difference directories.

Expected Behaviour

A VScode instance should open up connected to my WSL distro remote along with the worskpace in the directory from which the code . command was run.

Bug

VScode instance opens up in the same directory but in my native Windows environment instead of connecting to WSL remote.

VS Code version: Code 1.97.2 (e54c774, 2025-02-12T23:20:35.343Z)
OS version: Windows_NT x64 10.0.26100
Modes:
Remote OS version: Linux x64 5.15.167.4-microsoft-standard-WSL2

System Info
Item Value
CPUs Intel(R) Core(TM) i5-10300H CPU @ 2.50GHz (8 x 2496)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 7.80GB (0.71GB free)
Process Argv . --crash-reporter-id c60cd1bc-7c65-46cd-b259-ff360e690ed1
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu-24.04
OS Linux x64 5.15.167.4-microsoft-standard-WSL2
CPUs Intel(R) Core(TM) i5-10300H CPU @ 2.50GHz (8 x 0)
Memory (System) 3.73GB (2.44GB free)
VM 0%
Extensions (22)
Extension Author (truncated) Version
jupyter-keymap ms- 1.1.2
remote-ssh ms- 0.117.1
remote-ssh-edit ms- 0.87.0
remote-wsl ms- 0.88.5
pdf tom 1.2.2
vscode-icons vsc 12.11.0
ruff cha 2025.14.0
copilot Git 1.275.0
copilot-chat Git 0.24.1
vscode-pull-request-github Git 0.104.1
MagicPython mag 1.1.0
git-graph mhu 1.30.0
black-formatter ms- 2024.6.0
debugpy ms- 2025.0.1
python ms- 2025.0.0
vscode-pylance ms- 2025.2.1
jupyter ms- 2025.1.0
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.1.0
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
autodocstring njp 0.6.1

(1 theme extensions excluded)

A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
py29gd2263:31024239
vscaat:30438848
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
2e7ec940:31000449
pythontbext0:30879054
cppperfnew:31000557
dwnewjupyter:31046869
nativerepl1:31139838
pythonrstrctxt:31112756
nativeloc1:31192215
iacca1:31171482
5fd0e150:31155592
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
customenabled:31248079
5a9hg449:31230677
hdaa2157:31222309
copilot_t_ci:31222730
jda6j935:31233686
copilothoveron:31248524

@microsoft microsoft deleted a comment from Ck3555 Mar 3, 2025
@microsoft microsoft deleted a comment from Ck3555 Mar 3, 2025
@aeschli
Copy link
Contributor

aeschli commented Mar 3, 2025

Can you add a screenshot?
If you are in a WSL terminal, code . will open a new WSL window.

@aeschli aeschli added the info-needed Issue requires more information from poster label Mar 3, 2025
@VarunNikam22
Copy link
Author

Image

Here, you can see I use the code . command from my terminal in WSL, and in the next screenshot, you can see the path it is trying to open is in the Windows file system C:\Users\FOX TROT\Desktop instead of something like /mnt/c/Desktop

Image

Special case

When I use the same command from an already open VScode instance running on WSL host, it does open another instance of VSCode running on WSL host, as expected.

Image

Image

@aeschli
Copy link
Contributor

aeschli commented Mar 5, 2025

Can you run code . --verbose in the WSL terminal?

You can ctrl+C after a few seconds, I'm only interested in the first few lines where we see how code.exe is invoked

@VarunNikam22
Copy link
Author

Here you go. It did output a bunch of things, let me know if you need more of it.


[main 2025-03-06T04:25:06.186Z] PolicyConfiguration#initialize
[main 2025-03-06T04:25:06.187Z] PolicyConfiguration#updatePolicyDefinitions [
'update.mode',
'update.channel',
'update.enableWindowsBackgroundUpdates',
'update.showReleaseNotes',
'http.useLocalProxyConfiguration',
'http.electronFetch',
'http.proxy',
'http.proxyStrictSSL',
'http.proxyKerberosServicePrincipal',
'http.noProxy',
'http.proxyAuthorization',
'http.proxySupport',
'http.systemCertificates',
'http.experimental.systemCertificatesV2',
'http.fetchAdditionalSupport',
'telemetry.telemetryLevel',
'telemetry.enableTelemetry'
]
[main 2025-03-06T04:25:06.190Z] NativePolicyService#_updatePolicyDefinitions - Found 1 policy definitions
[main 2025-03-06T04:25:06.205Z] [File Watcher (node.js)] Request to start watching: c:\Users\Varun\AppData\Roaming\Code\User (excludes: , includes: , filter: , correlationId: ),c:\Users\Varun\AppData\Roaming\Code\User\settings.json (excludes: , includes: , filter: , correlationId: )
[main 2025-03-06T04:25:06.225Z] NativePolicyService#_onDidPolicyChange - Updated policy values: {}
[main 2025-03-06T04:25:06.226Z] PolicyConfiguration#update [ 'update.mode' ]
[main 2025-03-06T04:25:06.232Z] Starting VS Code
[main 2025-03-06T04:25:06.232Z] from: c:\Program Files\Microsoft VS Code\resources\app
[main 2025-03-06T04:25:06.232Z] args: {
_: [ '\\wsl.localhost\Ubuntu-24.04\home\deds3c' ],
diff: false,
merge: false,
add: false,
remove: false,
goto: false,
'new-window': false,
'reuse-window': false,
wait: false,
help: false,
'list-extensions': false,
'show-versions': false,
'pre-release': false,
'update-extensions': false,
version: false,
verbose: true,
status: false,
'prof-startup': false,
'no-cached-data': false,
'prof-v8-extensions': false,
'disable-extensions': false,
'disable-lcd-text': false,
'disable-gpu': false,
'disable-chromium-sandbox': false,
sandbox: false,
telemetry: false,
debugRenderer: false,
'enable-smoke-test-driver': false,
logExtensionHostCommunication: false,
'skip-release-notes': false,
'skip-welcome': false,
'disable-telemetry': false,
'disable-updates': false,
'use-inmemory-secretstorage': false,
'disable-workspace-trust': false,
'disable-crash-reporter': false,
'crash-reporter-id': 'c60cd1bc-7c65-46cd-b259-ff360e690ed1',
'skip-add-to-recently-opened': false,
'open-url': false,
'file-write': false,
'file-chmod': false,
force: false,
'do-not-sync': false,
'do-not-include-pack-dependencies': false,
trace: false,
'trace-memory-infra': false,
'preserve-env': false,
'force-user-env': false,
'force-disable-user-env': false,
'open-devtools': false,
'disable-gpu-sandbox': false,
'__enable-file-policy': false,
'enable-coi': false,
'no-proxy-server': false,
'no-sandbox': false,
nolazy: false,
'force-renderer-accessibility': false,
'ignore-certificate-errors': false,
'allow-insecure-localhost': false,
'disable-dev-shm-usage': false,
'profile-temp': false,
logsPath: 'C:\Users\Varun\AppData\Roaming\Code\logs\20250306T095506'
}
[main 2025-03-06T04:25:06.233Z] Resolving machine identifier...
[main 2025-03-06T04:25:06.233Z] Resolved machine identifier: 03278e25e417a8c4a54b9885804e88924cdf9fc5825c3d1b2135dcbc6405f3d1
[main 2025-03-06T04:25:06.233Z] Main->SharedProcess#connect
[main 2025-03-06T04:25:06.235Z] PolicyConfiguration#updatePolicyDefinitions [
'terminal.integrated.automationProfile.linux',
'terminal.integrated.automationProfile.osx',
'terminal.integrated.automationProfile.windows',
'terminal.integrated.profiles.windows',
'terminal.integrated.profiles.osx',
'terminal.integrated.profiles.linux',
'terminal.integrated.useWslProfiles',
'terminal.integrated.inheritEnv',
'terminal.integrated.persistentSessionScrollback',
'terminal.integrated.showLinkHover',
'terminal.integrated.ignoreProcessNames'
]
[main 2025-03-06T04:25:06.236Z] PolicyConfiguration#updatePolicyDefinitions [
'terminal.integrated.defaultProfile.linux',
'terminal.integrated.defaultProfile.osx',
'terminal.integrated.defaultProfile.windows'
]
[main 2025-03-06T04:25:06.241Z] PolicyConfiguration#update []
[main 2025-03-06T04:25:06.241Z] PolicyConfiguration#update []
[main 2025-03-06T04:25:06.244Z] [File Watcher (node.js)] Started watching: 'c:\Users\Varun\AppData\Roaming\Code\User'
[main 2025-03-06T04:25:06.245Z] StorageMainService: creating application storage
[main 2025-03-06T04:25:06.251Z] ElectronURLListener: waiting for window to be ready to handle URLs...
[main 2025-03-06T04:25:06.251Z] lifecycle (main): phase changed (value: 2)
[main 2025-03-06T04:25:06.252Z] windowsManager#open
[main 2025-03-06T04:25:06.265Z] [File Watcher (node.js)] Started watching: 'c:\Users\Varun\AppData\Roaming\Code\User\settings.json'
[main 2025-03-06T04:25:06.370Z] [File Watcher (node.js)] [raw] ["change"] globalStorage
[main 2025-03-06T04:25:06.370Z] [File Watcher (node.js)] [CHANGED] c:\Users\Varun\AppData\Roaming\Code\User\globalStorage
[main 2025-03-06T04:25:06.371Z] [File Watcher (node.js)] [raw] ["change"] globalStorage
[main 2025-03-06T04:25:06.372Z] [File Watcher (node.js)] [CHANGED] c:\Users\Varun\AppData\Roaming\Code\User\globalStorage
[main 2025-03-06T04:25:06.458Z] [File Watcher (node.js)] >> normalized [CHANGED] c:\Users\Varun\AppData\Roaming\Code\User\globalStorage
[main 2025-03-06T04:25:06.459Z] User data changed
[main 2025-03-06T04:25:07.932Z] windowsManager#open pathsToOpen [ [Object: null prototype] {} ]
[main 2025-03-06T04:25:07.934Z] windowsManager#doOpenEmpty {
restore: false,
remoteAuthority: undefined,
filesToOpen: undefined,
forceNewWindow: false
}
[main 2025-03-06T04:25:07.936Z] IPC Object URL: Registered new channel vscode:28608308-f7ec-4772-b006-820116acf0fe.
[main 2025-03-06T04:25:07.936Z] window#validateWindowState: validating window state on 1 display(s) { mode: 0, x: 168, y: 32, width: 1200, height: 800 }
[main 2025-03-06T04:25:07.936Z] window#validateWindowState: single monitor working area { x: 0, y: 0, width: 1536, height: 816 }
[main 2025-03-06T04:25:07.937Z] window#ctor: using window state { mode: 0, x: 168, y: 32, width: 1200, height: 800 }
[main 2025-03-06T04:25:08.004Z] window#load: attempt to load window (id: 1)
[main 2025-03-06T04:25:08.024Z] windowsManager#open used window count 1 (workspacesToOpen: 0, foldersToOpen: 0, emptyToRestore: 0, maybeOpenEmptyWindow: true)
[main 2025-03-06T04:25:08.025Z] lifecycle (main): phase changed (value: 3)
[main 2025-03-06T04:25:08.025Z] resolveShellEnv(): skipped (Windows)
[main 2025-03-06T04:25:08.026Z] update#setState idle
[main 2025-03-06T04:25:08.118Z] [File Watcher (node.js)] [raw] ["change"] globalStorage
[main 2025-03-06T04:25:08.119Z] [File Watcher (node.js)] [CHANGED] c:\Users\Varun\AppData\Roaming\Code\User\globalStorage
[main 2025-03-06T04:25:08.120Z] [File Watcher (node.js)] [raw] ["change"] globalStorage
[main 2025-03-06T04:25:08.121Z] [File Watcher (node.js)] [CHANGED] c:\Users\Varun\AppData\Roaming\Code\User\globalStorage
[main 2025-03-06T04:25:08.129Z] resolveShellEnv(): skipped (Windows)
[main 2025-03-06T04:25:08.130Z] [File Watcher (node.js)] [raw] ["change"] globalStorage
[main 2025-03-06T04:25:08.130Z] [File Watcher (node.js)] [CHANGED] c:\Users\Varun\AppData\Roaming\Code\User\globalStorage
[main 2025-03-06T04:25:08.195Z] [File Watcher (node.js)] >> normalized [CHANGED] c:\Users\Varun\AppData\Roaming\Code\User\globalStorage
[main 2025-03-06T04:25:08.195Z] User data changed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants