Unable to run the nano container in powershell terminal.

Dhamodharan 1 Reputation point
2021-06-05T03:22:02.143+00:00

I am trying to run a nano container with command prompt its working fine and able to execute the commands, but the same way when i try to run the same nano container with powershell its not, its throwing the below screen.

Firing command:

docker run -it mcr.microsoft.com/windows/nanoserver:1809 powershell.exe

Result:

docker: Error response from daemon: container 7a335935e7ef90807c4a37b52bf8592bc26fbd79658d2508849395472ab5b064 encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2)
[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!00007FF779519F4B: (caller: 00007FF7794CE13A) Exception(2) tid(38c) 80070002 The system cannot find the file specified.
CallContext:[\Bridge_ProcessMessage\VmHostedContainer_ExecuteProcess]
Provider: 00000000-0000-0000-0000-000000000000] extra info: {"CommandLine":"powershell.exe","User":"ContainerUser","WorkingDirectory":"C:\","EmulateConsole":true,"CreateStdInPipe":true,"CreateStdOutPipe":true,"ConsoleSize":[51,192]}.

Can someone help to fix this?

Regards,
Dhamodharan

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,726 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yuhan Deng 3,786 Reputation points Microsoft External Staff
    2021-06-07T06:37:24.003+00:00

    Hi,
    As far as I know, Microsoft removed powershell and other pieces from base nano server image. You might need to use image with built in powershell to carry on with this.

    Thanks for your understanding.
    Best regards,
    Danny

    -----------------------------

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.