ERROR: CreateProcessCommon:717: chdir(/mnt/c/WINDOWS/system32) failed 2
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 33.7k
- Forks
- 1.8k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 116
Description
### Windows Version
Microsoft Windows [10.0.19045.5854]
### WSL Version
2.5.7.0
### Are you using WSL 1 or WSL 2?
- [x] WSL 2
- [ ] WSL 1
### Kernel Version
_No response_
### Distro Version
Ubuntu 22.04
### Other Software
_No response_
### Repro Steps
just type "wsl"
> C:\WINDOWS\system32>wsl
<3>WSL (757 - Relay) ERROR: CreateProcessCommon:717: chdir(/mnt/c/WINDOWS/system32) failed 2
### Expected Behavior
The expected behavior is like WSL with path parameters added: No error exists
>C:\WINDOWS\system32>wsl ~
johnny@vv:~$ exit
### Actual Behavior
I can understand this error "CreateProcessCommon:717: chdir(/mnt/c/WINDOWS/system32) failed 2", because on my system, the correct case-sensitive path looks like this:
> johnny@vv:/$ cd /mnt/c/WINDOWS/system32
-bash: cd: /mnt/c/WINDOWS/system32: No such file or directory
johnny@vv:/$ cd /mnt/c/Windows/System32
johnny@vv:/mnt/c/Windows/System32$
It doesn't seem like WSL gets the correct case-sensitive path, if the path parameter isn't explicitly appended and WSL needs to get the working path by itself.
Importantly, this error path appears to be coming from windows, and when I open Prompt or Power Shell as an Administrator, the system gives us the wrong case path at the beginning :
> C:\WINDOWS\system32>cd \windows\system32
C:\WINDOWS\system32>cd \
C:\>cd WINDOWS
C:\Windows>cd system32
C:\Windows\System32>
Hopefully WSL will consider that this will happen with Windows and correct it.
### Diagnostic Logs
_No response_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue from C:\WINDOWS\system32 with WSL 2 and Ubuntu 22.04, then compare it with starting WSL using the ~ path parameter. Investigate how the Windows working directory is converted to the Linux path, especially when Windows reports different casing; done means launching wsl without an argument produces no chdir error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, linux, ubuntu
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100