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

Not able to Connect WSL from VSCODE || WSL (21) ERROR: CreateProcessParseCommon:711: Failed to translate #9810

Closed
Mounesh1881 opened this issue Apr 23, 2024 · 17 comments
Assignees
Labels
containers Issue in vscode-remote containers *question Issue represents a question, should be posted to StackOverflow (VS Code)

Comments

@Mounesh1881
Copy link

We observed that we were running into below errors while connecting from Visual Studio to WSL.

image
image
Start: Run: wsl -l -v
[414 ms] Initializing configuration support...
[414 ms] Internal initialization of dev container support package...
[484 ms] Start: Run: wsl -d docker-desktop-data -e /bin/sh -c echo ~
[986 ms] Could not connect to WSL.
[986 ms] Command failed: wsl -d docker-desktop-data -e /bin/sh -c echo ~
[986 ms]
[986 ms] <3>WSL (21) ERROR: CreateProcessParseCommon:711: Failed to translate C:\Users\ECADMIN\AppData\Local\Programs\Microsoft VS Code
<3>WSL (21) ERROR: CreateProcessParseCommon:757: getpwuid(0) failed 2
<3>WSL (21) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Program Files\Common Files\Oracle\Java\javapath
<3>WSL (21) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin
<3>WSL (21) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Windows\system32
<3>WSL (21) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Windows
<3>WSL (21) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Windows\System32\Wbem
<3>WSL (21) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Windows\System32\WindowsPowerShell\v1.0
<3>WSL (21) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Windows\System32\OpenSSH
<3>WSL (21) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Program Files\dotnet
<3>WSL (21) ERROR: UtilTranslatePathList:2866: Failed to translate C:\ProgramData\chocolatey\bin
<3>WSL (21) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Program Files\Amazon\AWSCLIV2
<3>WSL (21) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Program Files\Docker\Docker\resources\bin
<3>WSL (21) ERROR: UtilTranslatePathList:2866: Failed to translate C:\ProgramData\Riverbed\ProcessInjection\rpictrlBin
<3>WSL (21) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Users\ECADMIN\AppData\Local\Microsoft\WindowsApps
<3>WSL (21) ERROR: UtilTranslatePathList:2866: Failed to translate C:\ProgramData\Riverbed\ProcessInjection\rpictrlBin
<3>WSL (21) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Users\ECADMIN\AppData\Local\Microsoft\WindowsApps
<3>WSL (21) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Users\ECADMIN\AppData\Local\GitHubDesktop\bin
<3>WSL (21) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Users\ECADMIN\AppData\Local\Programs\Microsoft VS Code\bin
<3>WSL (21) ERROR: CreateProcessEntryCommon:334: getpwuid(0) failed 2
<3>WSL (21) ERROR: CreateProcessEntryCommon:505: execvpe /bin/sh failed 2
<3>WSL (21) ERROR: CreateProcessEntryCommon:508: Create process not expected to return

@vscodenpa vscodenpa added the wsl Issue in vscode-remote WSL label Apr 23, 2024
@aeschli
Copy link
Contributor

aeschli commented Apr 23, 2024

docker-desktop-data is an internal distro (used by the docker implemetation).
Can you use a different distro and see if the issue exists?

@Mounesh1881
Copy link
Author

as discussed @aeschli

please find the requested information here.

we are running .devcontainer file below the content of the file

// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "Ubuntu",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"features": {
"ghcr.io/devcontainers/features/terraform:1": {}
},

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
"remoteUser": "vscode"

}

@aeschli
Copy link
Contributor

aeschli commented Apr 24, 2024

This is a problem in WSL: microsoft/WSL#9252
Closing as duplicate of microsoft/WSL#9252

There are some solutions in there: Can you see if microsoft/WSL#9252 (comment) works?

@aeschli aeschli closed this as completed Apr 24, 2024
@Mounesh1881
Copy link
Author

the solution provided in #9252 is not working for me.
i want to someone can look into my issue help to resolve.

@aeschli aeschli assigned chrmarti and unassigned aeschli Apr 24, 2024
@aeschli
Copy link
Contributor

aeschli commented Apr 24, 2024

@chrmarti Is it dev containers that runs wsl -d docker-desktop-data -e /bin/sh -c echo ~ ?

Maybe the current directory should not be a location on the windows file system.

@Mounesh1881
Copy link
Author

@chrmarti Can you please help us here

@Mounesh1881
Copy link
Author

@aeschli @chrmarti can we have update here

@aeschli
Copy link
Contributor

aeschli commented Apr 25, 2024

@Mounesh1881 @chrmarti is on vacation this week, please be patient

@chrmarti
Copy link
Contributor

What is the folder's path that you want to reopen in a container? Is it in a WSL or Windows filesystem?

Are any of the following settings set:
Image

@chrmarti chrmarti reopened this Apr 29, 2024
@chrmarti chrmarti added containers Issue in vscode-remote containers info-needed Issue requires more information from poster and removed wsl Issue in vscode-remote WSL labels Apr 29, 2024
@Mounesh1881
Copy link
Author

Just i am running this "image": "mcr.microsoft.com/devcontainers/base:jammy" only , no extra action written in code there.

@chrmarti
Copy link
Contributor

Are you using a workspace folder on a Windows drive or in a WSL filesystem?

Also check the above mentioned user settings.

@Mounesh1881
Copy link
Author

image

@chrmarti
Copy link
Contributor

Please reply to all of the following:

  1. Are you using a workspace folder on a Windows drive or in a WSL filesystem?
  2. What about the Dev Containers: Execute In WSL setting? It is not part of your above screenshot.
  3. What is the output of running wsl -l -v in a terminal on Windows?

@Mounesh1881
Copy link
Author

Are you using a workspace folder on a Windows drive or in a WSL filesystem?-- not sure about this , but my code is in local drive.
What about the Dev Containers: Execute In WSL setting? It is not part of your above screenshot.
image

What is the output of running wsl -l -v in a terminal on Windows?
image

@chrmarti
Copy link
Contributor

docker-desktop-data is shown as the default distro, this makes Dev Containers use this distro which is not a completely functional Linux install. Please run wsl --setdefault Ubuntu to fix this.

I also suggest you uncheck Dev Containers: Execute In WSL in the user settings unless there is a specific reason to always access the Docker CLI through WSL. (Dev Containers will still go through WSL when the workspace folder is in a WSL filesystem.)

@Mounesh1881
Copy link
Author

thank you so much this worked for me

@chrmarti
Copy link
Contributor

chrmarti commented May 2, 2024

Thanks for confirming. Closing as answered.

@chrmarti chrmarti closed this as completed May 2, 2024
@chrmarti chrmarti added *question Issue represents a question, should be posted to StackOverflow (VS Code) and removed info-needed Issue requires more information from poster labels May 2, 2024
@microsoft microsoft locked and limited conversation to collaborators Jun 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
containers Issue in vscode-remote containers *question Issue represents a question, should be posted to StackOverflow (VS Code)
Projects
None yet
Development

No branches or pull requests

4 participants