Virtual drives created with subst not mounted in WSL
Windows Version
Microsoft Windows [Versión 10.0.26100.4061]
WSL Version
Versión de WSL: 2.4.13.0
Are you using WSL 1 or WSL 2?
- [x] WSL 2
- [ ] WSL 1
Kernel Version
5.15.167.4
Distro Version
Ubuntu 24.04
Other Software
No response
Repro Steps
Run this in a command prompt
subst <driveletter> C:\path\to\folder
Change to the newly created drive, then run wsl sh -c "command" or something similar. You'll get this error:
<3>WSL (1230 - Relay) ERROR: CreateProcessParseCommon:863: Failed to translate
Expected Behavior
The virtual drive was mounted in WSL and the path translation was successful.
Actual Behavior
~ ❯ subst R: C:\Users
~ ❯ R:
R:\🔒
❯ wsl sh -c "echo Hello, World!"
<3>WSL (1355 - Relay) ERROR: CreateProcessParseCommon:863: Failed to translate R:
Hello, World!
Diagnostic Logs
No response
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 [email protected] 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'.
Diagnostic information
.wslconfig found
Detected appx version: 2.4.13.0
Is the issue that (a) you cannot run wsl sh -c "command" while on the virtual drive in PowerShell/CMD or that (b) the virtual drive is not mounted in WSL at /mnt/X?
Note that (b) is currently open as a feature request. #10311
The issue in the title is a dupe of #10311.
The issue of running a WSL-related command in PowerShell from a subst drive is related.
Closing as dupe of #10311. Will make a note about running WSL-related commands there.