VS Code error when Attach to Visual Studio Code windows container on local machine

Viewed 1002

When I right click on a local Windows Docker container in Visual Studio Code > Attach Visual Studio Code, I get the following error. Can Visual Studio Code attach to a Windows container? If so, where can I supply the missing uname/passwd?

[2484 ms] Start: Run in container: uname -m
[3364 ms] Start: Run in container: cat /etc/passwd
[3364 ms] Stdin closed!
[3371 ms] Shell server terminated (code: 126, signal: null)
container b125f4fce0c1de6ff89b6c94a27a7753a1c0c618d227c21f274e176edaedbdc6 encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: The user name or password is incorrect. (0x52e)
[Event Detail:  Provider: 00000000-0000-0000-0000-000000000000]
[Event Detail:  Provider: 00000000-0000-0000-0000-000000000000]
[Event Detail: onecore\vm\compute\management\orchestration\vmhostedcontainer\processmanagement.cpp(173)\vmcomputeagent.exe!00007FF6FD489F4B: (caller: 00007FF6FD43E13A) Exception(12) tid(628) 8007052E The user name or password is incorrect.
    CallContext:[\Bridge_ProcessMessage\VmHostedContainer_ExecuteProcess] 
 Provider: 00000000-0000-0000-0000-000000000000] extra info: {"CommandLine":"/bin/sh","User":"root","WorkingDirectory":"/","Environment":{"VSCODE_REMOTE_CONTAINERS_SESSION":"6ddd4179-d78f-4bdf-8723-35e92b8e49651614290826962"},"CreateStdInPipe":true,"CreateStdOutPipe":true,"CreateStdErrPipe":true,"ConsoleSize":[0,0]}
2 Answers

Actually these are dev containers, there should not be authentication needed. usually that's a need in production. but see below article, on the location of JSON file where you can alternatively set credentials:

https://code.visualstudio.com/docs/remote/attach-container

there is devcontainer.json where you can supply the username and password also you can specify.

Related