Docker won't start on Windows: Not Enough memory to start docker

WindowsDockerVirtual MachineHyper V

Windows Problem Overview


I am trying to get started with Docker on Windows. My machine has 4GB of RAM and a 1.9GHz - 2.5GHz Intel i5 processor, running Windows 10 Pro x64. I know these aren't powerful specs, but I would have thought I should be able to run Docker?

However, having downloaded Docker, I get the error message:

> Not Enough memory to start docker

I have seen various forum posts and github issues about this and followed all the advice I can see, such as modifying the settings in Docker, I tried these:

enter image description here

They also mentioned changing the settings of the Hyper-V VM however, this seems to be deleted and recreated with the Docker specified settings on every attempted launch. I tried 2048MB, 1792MB, 1536MB, 1280MB and 1024MB of RAM, all of which failed.

What else can I do? Surely I can run docker in some form on my machine? NB: I have closed all non-essential background apps. There doesn't seem to be many other suggestions for what seems to be a fairly common issue, where the given solutions don't work?

Windows Solutions


Solution 1 - Windows

I have also encountered the same problem. Tried everything from giving dynamic memory to enabling and disabling Hyper V and many more. But with all that, I got no success.

Then I tried these steps for

Docker won't start on Windows: Not Enough memory to start docker:

  1. From System Tray menu, right click on Docker icon

  2. Select Switch to Windows containers...

  3. Restart the system.

There you go after restarting your docker status should be showing as: Docker is running

Hope this helps!

PS: Switching back to Linux container should work now after switching to Windows Containers for most of the users as said by rfay.


Updates (May 01, 2019)

Despite of the above methods if you're still unable to start docker on your Windows Machine, try with the following things:

  • Download RAMMap from Microsoft's Official website
  • Open the application and select Empty menu
  • From the sub-menu list select the first option Empty Working Sets
  • Now refresh it by pressing F5

Now try running docker and I believe this should work. Good Luck!

RAMMap Application

Solution 2 - Windows

I solved this issue by right clicking on the docker tray icon chose settings and then tapped on the "Advanced" section.

Then I lowered the memory from the default 2048 to 1536 and works like charm. Another option is try to switch to Windows Containers then Restart the Machine and switch back to Linux Containers.

Below is my docker settings with Advanced tab open. Note the Memory is 1536 and My laptop has 4GB Ram.

enter image description here

Also the virtual machine "MobyLinuxVM" is running as shown below;

enter image description here

I hope this helps someone one day even if was a late answer :)

Solution 3 - Windows

if you are on window and got this error, Go to Search box

#1 type Hyper-V Manager 
 Click on it,
 a window like attached screenshot open,

enter image description here

#2 Select  MobilinuxVM(normally same name if running windows docker)
#3 Right click and open - Setting 
    2 The second window will open(setting for MobiLinux) i.e to the screenshot.
#4 Go to Memory Tab in left Pane.
#5 click on a dynamic checkbox and set minimum value to some lower amount say 512, and max value to the desired one,
#6 apply 
now it will start running as well after few minutes take the amount it required as well.

Solution 4 - Windows

It is not the problem of RAM. It is the allocated disk memory to docker.
It means there is not enough space for docker to create an image or any other docker related operations.

Open the docker settings >> advanced >> disk image max size

Increase this size and apply the changes.

It will restart automatically and then you're good to go.

enter image description here

Solution 5 - Windows

In Settings, I did a reset to factory defaults. And restarted the laptop. It Worked for me

Solution 6 - Windows

Posting what worked for me:

  1. Open Resources settings in docker
  2. Set memory to lowest setting, in my case 1024MB
  3. Open Task manager, verify that I've at least the memory I specified above free
  4. Restart docker, switch to linux containers

In my case this worked because I was using almost all of my RAM with VScode and firefox, so closed them and tried and it worked

Solution 7 - Windows

Have you enabled NUMA spanning in your HyperV settings? if not enable it i bet that will solve your issue.

By default, Windows Server enables NUMA spanning, which provides the most flexibility as virtual machines (VMs) can access and use memory in any NUMA node. But it may result in lower performance compared to forcing VMs to use memory on the same NUMA node as the processor cores.

By disabling NUMA spanning, you ensure that VMs use memory and processor cores in the same NUMA node, giving the best performance. This should only be changed once, if, as an administrator, you feel comfortable with NUMA and the implications of disabling and also if you have some additional management suite that can help ensure best configuration.

To configure NUMA spanning, open the Hyper-V Settings and select the NUMA Spanning option and disable it, I am sure, it will get solved; I struggled with the issue for a week and resolved it by disabling NUMA.

I am sure this would be marked as resolved by disabling NUMA in Hyper-V Manager.

Solution 8 - Windows

I have also the same problem. Maybe you have other virtual machine in Hyper-v, other Virtual machin need memory too. please stop all other Hyper-v Virtual machine and test again. for me worked My Hyper-v Manager

enter image description here

Solution 9 - Windows

When I experienced this problem I modified the PowerShell script MobyLinux.ps1 found in the resources folder on the Docker install in C:\Program Files\Docker\Docker\resources. Essentially I forced the values for the $CPUs to 2 and the $Memory to 512, which worked for my dev box's limited resources!

enter image description here

At this point when Docker drops the MobyLinuxVM instance in Hyper-V and re-creates it from the PowerShell script it now uses my values: enter image description here

This time the VM remains up and stable, and Docker successfully switches from the Windows Containers to the Linux Containers:

enter image description here

Hope this helps someone.

Solution 10 - Windows

I lowered my memory and swap to the lowest it would go as well as the disk image size to 32gb and it finally started without switching to windows containers or having to reboot.

Solution 11 - Windows

Issue resolved after just restarting the PC -_-. Dont know what is that.

Solution 12 - Windows

So to begin with I normally start off with opening Visual Studio Code then my terminal and finally Docker Desktop WSL2. The problem being is that Visual Studio Code is a chunky memory hogger and initially requires a lot of memory to run. Especially if you used the integrated terminal, multiple tabs, and ultimately multiple windows.

When I open Docker Desktop last it gives me not enough resources error. After a little messing and testing, I found out that Docker initially needs to load first because it needs to obtain a certain amount of memory for your containers and images to run. So starting Docker Desktop manually, not on windows startup, then your other programs and tools should, I am saying should as everyone's environment and problems are different from mine and I am not expecting them to be the same, work fine.

So here are the steps:

  1. On opening your computer, mine is Windows 10 using WSL2 with Home, do not immediately have Docker open on startup. Instead, run the program manually by double-clicking the icon or searching in your start menu and clicking on Docker Desktop.
  2. Next, we then want to open Windows Visual Studio Code and other programs after that.
  3. Before running any commands, as I do run them through node js with specific package.json defined commands, check docker desktop as sometimes your containers and images are already running and therefore shouldn't need to run any commands to bring them up again.

If all this fails try going into your settings and allocating specific memory. Check your task manager processes and see what is taking up all of your resources. I hope this helps. Again everyone's environment is not the same so do not expect similar results as I have had. This SHOULD work doesn't mean it will. Read the documentation as well as it does help with identifying problems faster.

Solution 13 - Windows

Just follow the step:

  1. Go to Troubleshoot in the Docker dashboard.
  2. Click on Clean/Purge data.
  3. Select all options and press delete.

It takes a few minutes. (that's work for me)

Solution 14 - Windows

I had the same problem. In my case I had another VM running on Hyper-V that was consuming all the resources. Even after system restart the VM was always active. I opened Hyper-V Administrator and deactivated the problematic VM. Then I could start Docker properly.

Solution 15 - Windows

My Windows 10 Laptop has 8 GB of RAM. I also use virtual memory. When i start my OS and immediately run some RAM hungry applications, I can't start Docker until i stop most of the applications.

Yet: https://stackoverflow.com/a/45816385/7082956 helped me as well.

Solution 16 - Windows

This may happen because the ram is not free at the time you starting docker

I had opened 20 tabs of the browser, that leads to no free ram so I closed all the tabs refresh the computer several times, and tried restarting once again and it works for me

Solution 17 - Windows

I have faced same issue: Docker out of memory in windows.

I have solved issue, by following three steps.

**1. Quit Docker Desktop by clicking mouse right button. 2. Now run Docker Desktop as Administrator.

  1. Now restart your windows system.**

Now Docker will work properly. This solution has worked for me. :)

Solution 18 - Windows

Problem: Installed Docker Desktop. Got Out of Memory error upon starting with linux instance.

Details: OS: Windows 10 Professional Host: Lenovo ThinkPad Carbon X1, 4GB RAM Docker Desktop: Version 2.1.0.1 (37199) Docker advanced settings:

  • CPUs: 2
  • Memory: 2048MB (this is the maximum)
  • Swap: 2048MB
  • Disk Image Size: 59.6GB (4MB used)

Hyper-V settings for DockerDesktopVM:

  • Settings > Memory > RAM: 2048MB (tried to increase to 4096; still doesn't work)
  • Settings > Memory > Enable Dynamic Memory (checked/un-checked; both doesn't work)

Under variations of the above settings, Docker Desktop gives this error when starting/ re-starting:

Not enough memory to start Docker Desktop You are trying to start Docker Desktop but you don't have enough memory. Free some memory or change your settings.

The problem resolutions reported in the following links, e.g. starting with Windows instance, then switching back to Linux, don't work for me, regardless of how much memory I allocate via Hyper-V or Docker settings.

It is utterly frustrating because apparently people are reporting being able to start with linux instances on host machines with 4GB of RAM. So I wonder what I am doing wrong.

Resources researched/ tried:

Questions:

  1. Can I even run Docker Desktop with linux instance on my host machine?
  2. If (1) is yes, then what settings will allow me to do this?

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGeorge EdwardsView Question on Stackoverflow
Solution 1 - WindowsrbashishView Answer on Stackoverflow
Solution 2 - WindowsSTREET MONEYView Answer on Stackoverflow
Solution 3 - WindowsMohitView Answer on Stackoverflow
Solution 4 - WindowsShubham ChadokarView Answer on Stackoverflow
Solution 5 - WindowsGurvinder singhView Answer on Stackoverflow
Solution 6 - WindowspiyushView Answer on Stackoverflow
Solution 7 - Windowsuser11078255View Answer on Stackoverflow
Solution 8 - WindowsAllex FerraView Answer on Stackoverflow
Solution 9 - WindowsAcrilixView Answer on Stackoverflow
Solution 10 - WindowsMike CheelView Answer on Stackoverflow
Solution 11 - WindowsMuhammad YounusView Answer on Stackoverflow
Solution 12 - WindowsDevOpsIsTheNameOfTheGameView Answer on Stackoverflow
Solution 13 - WindowsMD SAIF UDDINView Answer on Stackoverflow
Solution 14 - WindowsBeposuView Answer on Stackoverflow
Solution 15 - WindowsValerij DoblerView Answer on Stackoverflow
Solution 16 - WindowsArunView Answer on Stackoverflow
Solution 17 - Windowskattula nethajeeView Answer on Stackoverflow
Solution 18 - WindowsAHLView Answer on Stackoverflow