0% found this document useful (0 votes)
20 views

stackoverflow-docker-failed-to-start

The document discusses a common issue where Docker fails to start, providing a detailed error message indicating a missing required feature. It outlines various troubleshooting steps, including enabling Windows Subsystem for Linux (WSL), updating to WSL 2, and adjusting Windows features. Several user solutions are shared, emphasizing the importance of proper installation and configuration of WSL and Docker settings.

Uploaded by

paschal.refugee
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

stackoverflow-docker-failed-to-start

The document discusses a common issue where Docker fails to start, providing a detailed error message indicating a missing required feature. It outlines various troubleshooting steps, including enabling Windows Subsystem for Linux (WSL), updating to WSL 2, and adjusting Windows features. Several user solutions are shared, emphasizing the importance of proper installation and configuration of WSL and Docker settings.

Uploaded by

paschal.refugee
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Docker Failed to Start

Asked 2 years, 4 months ago Modified 1 month ago Viewed 94k times

41

I have installed the Docker and then I have started the Docker. Docker says that "Docker is starting."
Then,Docker says "Docker Failed to Start". Please, Could you help me?

Docker Error Detail:

System.InvalidOperationException:
Failed to deploy distro docker‐desktop to C:\Users\‐‐‐\AppData\Local\Docker\wsl\distro: exit
code: ‐1
stdout: The operation could not be started because a required feature is not installed.

stderr:
at Docker.ApiServices.WSL2.WslShortLivedCommandResult.LogAndThrowIfUnexpectedExitCode(String
prefix, ILogger log, Int32 expectedExitCode) in C:\workspaces\PR‐
15138\src\github.com\docker\pinata\win\src\Docker.ApiServices\WSL2\WslCommand.cs:line 146
at Docker.Engines.WSL2.WSL2Provisioning.<DeployDistroAsync>d__17.MoveNext() in
C:\workspaces\PR‐
15138\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\WSL2Provisioning.cs:line
169
‐‐‐ End of stack trace from previous location where exception was thrown ‐‐‐
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)
at Docker.Engines.WSL2.WSL2Provisioning.<ProvisionAsync>d__8.MoveNext() in C:\workspaces\PR‐
15138\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\WSL2Provisioning.cs:line
78
‐‐‐ End of stack trace from previous location where exception was thrown ‐‐‐
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)
at Docker.Engines.WSL2.LinuxWSL2Engine.<DoStartAsync>d__25.MoveNext() in C:\workspaces\PR‐
15138\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\LinuxWSL2Engine.cs:line 99
‐‐‐ End of stack trace from previous location where exception was thrown ‐‐‐
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)
at Docker.ApiServices.StateMachines.TaskExtensions.
Your privacy
<WrapAsyncInCancellationException>d__0.MoveNext() in C:\workspaces\PR‐
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose
15138\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\TaskExtensions.cs:line
29 information in accordance with our Cookie Policy.
‐‐‐ End of stack trace from previous location where exception was thrown ‐‐‐
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Accept all cookies Necessary cookies only
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)
at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__5.MoveNext() in
Customize settings
docker docker‐compose

ShareImprove this questionFollow edited Aug 10, 2021 at 11:39 asked Feb 7, 2021 at 18:42
Yavuz Yoldaş
821 1 9 19

1 Have you gone through the checklist? docs.docker.com/docker‐for‐windows/wsl – J. Scott Elblein Feb 7, 2021
at 19:26
13 Answers Sorted by: Highest score ﴾default﴿

62

In my scenario, I needed to install WSL 2 and my computer didn't have it. Installing it made docker run
successfully. Try the below steps if you are installing docker for the first time.

First, we need to activate WSL from Windows.

Control Panel ‐> Programs ‐> Turn Windows features Turn On or Off

You need to check

Windows Subsystem For Linux

Windows Hypervisor Platform


Virtual Machine Platform

Then Click ok
After that, you need to Enable WSL 1 and update it to WSL 2 ﴾https://learn.microsoft.com/en‐
us/windows/wsl/install‐win10#manual‐installation‐steps﴿

To Install WSL 1 which comes built‐in, open PowerShell as Administrator and run:

dism.exe /online /enable‐feature /featurename:Microsoft‐Windows‐Subsystem‐Linux /all /norestart

After that download the WSL 2 update from Microsoft. Use below this: WSL2 Linux kernel update
package for x64 machines

After installing the above package, you need to set WSL 2 as the default version.

Open PowerShell as Administrator and run:

wsl ‐‐set‐default‐version 2

Now restart your computer. Now your docker should work.

Please note that to update to WSL 2, you must be running Windows 10.

For x64 systems: Version 1903 or higher, with Build 18362 or higher.
For ARM64 systems: Version 2004 or higher, with Build 19041 or higher.

ShareImprove this answerFollow edited Sep 11, 2021 at 18:06 answered Aug 13, 2021 at 7:51
Shane Bishop Menuka Ishan
3,765 4 15 42 4,994 2 50 65

1 I got WSL 2 requires an update to its kernel component. and had to run wsl ‐‐update ﴾as
Administrator﴿ and then wsl ‐‐set‐version Ubuntu‐20.04 2 to upgrade my existing wsl ﴾took about 8 min﴿
– Vl4dimyr Sep 18, 2021 at 19:35

31

My Solution:
I have checked the Prerequisites for Docker. I have applied the second step in prerequisites. (Windows
Subsystem for Linux Installation with Manual Installation Steps) It has fixed the error for me.

If you get an error like this ﴾during this installation process﴿:

WslRegisterDistribution failed with error: 0x80370114 Error: 0x80370114 The operation could not be
started because a required feature is not installed. ﴾I encountered this error.﴿ Please, apply this.

These steps are quoted from the "this" named hyperlink above.
1. Open "Windows Security"
2. Open "App & Browser control"
3. Click "Exploit protection settings" at the bottom
4. Switch to "Program settings" tab
5. Locate "C:\WINDOWS\System32\vmcompute.exe" in the list and expand it
6. Click "Edit"
7. Scroll down to "Code flow guard (CFG)" and uncheck "Override system settings"
8. Start vmcompute from powershell "net start vmcompute"
9. Then go back and command wsl ‐‐set‐default‐version 2

I have fixed my problems like that. Good luck :﴿

ShareImprove this answerFollow edited Mar 15, 2022 at 12:17 answered Feb 8, 2021 at 15:18
Yavuz Yoldaş
821 1 9 19

3 While the link may provide a solution, it may become stale/broken/etc, so please, edit your post and add the
solution worked for you ﴾the link at the end﴿ as a part of an answer. Here's the reason: Your answer is in
another castle: when is an answer not an answer? – astentx Jul 9, 2021 at 23:56

1 Thanks, in my case, I had to install the WSL2 Linux kernel update package for x64 machines – Chris Gong Aug
18, 2021 at 15:40

11

Docker failed to start WSL 2 update I just did this on powershell

wsl ‐‐install ‐d Ubuntu


wsl ‐‐update
wsl ‐‐shutdown

ShareImprove this answerFollow answered Sep 23, 2021 at 19:59


ZootHii
732 1 8 15

Thanks, this is worked for me on 21H1﴾OS Build 19043.1288﴿ – Eren Peksen Nov 7, 2021 at 11:05

The problem is in WSL as it becomes unresponsive and returns a service error. Follow the below steps

1. Uncheck the Windows Subsystem for Linux in Windows Features


2. Restart
3. Turn the feature back on
4. Re‐apply the WSL2 update
5. Restart

ShareImprove this answerFollow answered Feb 7, 2021 at 20:31


Ashok
3,060 14 31

Now,I check this path. =>"C:\Users\y00598996\AppData\Local\Docker\wsl\distro" folder is empty. I guess,Is it


the main problem,right ? – Yavuz Yoldaş Feb 7, 2021 at 21:44

By the way, I tried your advice but I take an same error. – Yavuz Yoldaş Feb 8, 2021 at 6:48

I was facing the same problem in my windows cooperate desktop. Unfortunately most of the windows
settings changes are not available for users and controlled by IT team. What I did to make docker
running is

Open Docker Desktop


Go to Settings
Turn off "Use the WSL 2 based engine" which switch to legacy Hyper‐V

I know this is not ideal but atleast got docker working.

ShareImprove this answerFollow answered Aug 22, 2021 at 15:24


jprism
3,229 3 39 56

The combination of the above answer and installation of new destro worked for me

1. Uninstall existing installation


2. Install With Admin privilege

3. Restart
4. Follow the accepted answer here https://answers.microsoft.com/en‐us/insider/forum/all/wsl‐2‐
installing‐linux‐failed‐error‐code/bae391d1‐4215‐4d93‐b0c4‐3d96404a7c74
5. Install a linux destro follow this https://learn.microsoft.com/en‐us/windows/wsl/install‐
win10#step‐4‐‐‐download‐the‐linux‐kernel‐update‐package
6. Launch Linux desktop as admin

ShareImprove this answerFollow answered Aug 19, 2021 at 5:49


Pranoy Sarkar
1,937 13 30

Fyi ‐‐ jprism's answer worked for me.

My issues were...

Docker install worked but would not start successfully, I got "WSL not installed" message.
Tried the WSL installation instructions from https://learn.microsoft.com/en‐us/windows/wsl/install
Default WSL installation was not found from PS session. Would not run from the command line
without specifying the distro. Worked when I explicitly specified the default distro with the ‐d
argument

Enabled WSL Subsystem as per https://www.windowscentral.com/install‐windows‐subsystem‐


linux‐windows‐10
Enabled all Hyper‐V options in Control Panel > Programs and features > Turn Windows
features on or off in addition WSL Subsystem
Finally as per jprism modified Docker settings to use Hyper‐V

ShareImprove this answerFollow edited Sep 25, 2021 at 0:00 answered Sep 24, 2021 at 16:30
bad_coder ‐ on strike LaaRay
11k 20 42 71 1

Please don't add "thank you" as an answer. Once you have sufficient reputation, you will be able to vote up
questions and answers that you found helpful. ‐ From Review – All Downhill From Here Sep 24, 2021 at 17:53

this can help you

& 'C:\Program Files\Docker\Docker\DockerCli.exe' ‐SwitchDaemon

run this in powershell.

ShareImprove this answerFollow answered Nov 13, 2021 at 20:03


Sougata Das
149 1 3

1 While this code may answer the question, providing additional context regarding how and/or why it solves
the problem would improve the answer's long‐term value. – Abhishek Dutt Nov 14, 2021 at 3:53

While this code may answer the question, providing additional context regarding how and/or why it solves
the problem would improve the answer's long‐term value. – Abhishek Dutt Nov 14, 2021 at 3:53
0

WSL2 cannot running.Reset winsock can fix it. Use following steps.

PS C:\WINDOWS\system32> wsl.exe ‐‐shutdown


PS C:\WINDOWS\system32> wsl.exe
The attempted operation is not supported for the type of object referenced.
PS C:\WINDOWS\system32> netsh winsock reset
Successfully reset the Winsock Catalog.
You must restart the computer in order to complete the reset.

After reboot ur system please run this command:

PS C:\WINDOWS\system32> wsl.exe

This will solve this error. I got it resolved at my machine.

ShareImprove this answerFollow answered Jun 14, 2022 at 3:52


MANITORATION
557 2 5 19

1. Uninstall Docker Desktop

2. Delete the following:

delete %appdata%\Docker*

delete %appdata%\Docker Desktop*

delete %LOCALAPPDATA%\Docker*

3. Reinstall Docker Desktop

Source
ShareImprove this answerFollow answered Dec 13, 2022 at 13:58
diman82
672 7 11

check if windows Update is running in services. If not, start it

ShareImprove this answerFollow answered Mar 29 at 10:16


Kwaku Boachie Fosu
1

Also mention how to do , how it would look ! Please check stackoverflow.com/help/how‐to‐answer – Harsh
Apr 4 at 4:47

Much much easier solution:

On Windows 11 with Docker Desktop v4.13.1 everything works fine with both Linux and Windows
containers. Than after a couple of restarts I suddenly get the same error ﴾Docker failed to start etc.﴿

Click on Troubleshoot in the header menu. Here you can Clean / Purge data, after that it works again.
WARNING: this solution will delete your Containers and Images. You can select what to delete after the
Clean / Purge data selection:

ShareImprove this answerFollow edited May 8 at 15:43 answered Dec 6, 2022 at 16:30
Cerveser
712 8 23

Does this delete containers and volumes? – DarkteK May 7 at 1:41

1 Good point: I've edited the answer => you delete the Containers and Images with this action. – Cerveser May
1 Good point: I've edited the answer => you delete the Containers and Images with this action. – Cerveser May
8 at 15:44

‐1

What fixed this for me was

Hit windows key, type "cmd", hit enter


Right click menu bar, select "Properties"
Uncheck "Use legacy console"

ShareImprove this answerFollow answered Oct 16, 2021 at 21:31


MattMatt Wright
102 1 4
Wright's

You might also like