docker / for-mac

Bug reports for Docker Desktop for Mac
https://www.docker.com/products/docker#/mac
2.43k stars 118 forks source link

Docker Desktop cannot start on mac M1 chip #6145

Open xingtanzjr opened 2 years ago

xingtanzjr commented 2 years ago

Expected behavior

The docker desktop should start correctly.

Actual behavior

When I install the docker at first, it runs smoothly. And later, I change the CPU resource from 6 core to 10 core, the docker desktop cannot run and it show the message The docker desktop is stopped.

I tried to re-install it and it doesn't work for me. The troubleshoot function is still not working and any operation has no effect.

The docker desktop is repeated from starting to stopped image

Information

Output of /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check

Steps to reproduce the behavior

  1. Install Docker desktop.
  2. Change the resource CPU from 6 core to 10 core.
b-studios commented 2 years ago

Can confirm, this exact thing happened to me. Even uninstalling and purging all configs doesn't seem to help.

b-studios commented 2 years ago

As a workaround, I figured out that the configs are stored here:

~/Library/Group Containers/group.com.docker/settings.json

Switching back to 6 CPUS via key:

{
...
  "cpus": 6,
...
}

resolved the issue for me temporarily

MSLP commented 2 years ago

Thanks a lot to @b-studios for the workaround, as I had to re-install and wipe Docker Engine twice (btw, simple re-install does not work, you gotta follow advices here + manual sudo su -> cd / && find . -name '*docker*' -or -name '*Docker*' 2>&1 >out and inspecting the files, drove me crazy) before I found this issue

I'n my vain attempts to improve I/O performance for my local environment, I played around with different configurations, and can confirm that changing CPU from 6 to 10 completely breaks Docker for Mac.

It is broken both in 4.3.2 (that my colleague has and experiences less problems) and the latest version as well.

I have MBP 2021 M1 Pro if it matters.

LeSauvage commented 2 years ago

As a workaround, I figured out that the configs are stored here:

~/Library/Group Containers/group.com.docker/settings.json

Switching back to 6 CPUS via key:

{
...
  "cpus": 6,
...
}

resolved the issue for me temporarily

Thanks, this fixed my issue, I switched to 10 cpu two days ago and been trying to fix it since, could not find the settings and re-installing wouldn't fix

MSLP commented 2 years ago

By the way, switching to 6 (from the default 4) cores has dramatically worsened my performance. I believe it is related to the issue outlined here: https://github.com/docker/roadmap/issues/142#issuecomment-772732443. I switched back to 1 CPU and my local setup (quite a hefty one) finally worked on par (and in some aspects better) than MBP 2019 with i5 :D

Gau-thier commented 2 years ago

Thanks! Got the same trouble yesterday, didn't know it was related to the new resources config I set. Worked for me:

Hope this will be fixed soon!

ramblingenzyme commented 2 years ago

Had this same issue, I set my cpus to 9, out of 10. Changing it to 6 fixed the loop. Why would this be happening though, very confused.

jleren commented 2 years ago

I have the same issue, changing CPU's started a reboot loop for Docker Desktop

BasilPH commented 2 years ago

I'm having the same issue where the docker engine oscillates between "starting" and "stopped". I am however on an Intel Mac. Changing CPU from 10 to 6 didn't help. The crash loop seems to be triggered by me updating Docker Desktop to 4.4.2 (73305).

Update: Rebooting my Mac fixed the issue.

Cyclic commented 2 years ago

8 is great.

B-0-B-B-Y commented 2 years ago

I have tried all of the suggestions on here, as well as other threads and still cannot get docker desktop to start up, forever stuck on docker engine is starting. Am on an M1 macbook. Have abandoned Docker Desktop as it just doesn't work, I've spent over 3 full work days trying to make it work and in the end installed colima as a workaround...

lwinch2006 commented 2 years ago

Can not start Docker on MacBook Pro 16 with M1 Max chip. "Whale menu" does not appear on top, but some process is running as I see through Activity Monitor. Changing settings in settings.json does not help. This happens right after installation. UI does not appear at all.

philsturgeon commented 2 years ago

This happened to me when I tried to disable gRPc FUSE (related #5240) and after trying every single tip on every issue relating to starting failures, the solution was to obliterate everything, restart, and cross my fingers.

rm -rf ~/Library/Caches/com.docker.docker
rm -rf ~/.docker
rm -rf ~/Library/Group Containers/group.com.docker
philsturgeon commented 2 years ago

This happened to me when I tried to disable gRPc FUSE (related #5240) and after trying every single tip on every issue relating to starting failures, the solution was to obliterate everything, restart, and cross my fingers.

rm -rf ~/Library/Caches/com.docker.docker
rm -rf ~/.docker
rm -rf ~/Library/Group Containers/group.com.docker

open --background -a Docker
Brodan commented 2 years ago

I played with the resource allocation menu yesterday and now I can't get docker to get passed 'Docker Desktop is Starting'..... deleting all the old configs and installing from scratch isnt helping i straight up cant do my job now. thanks docker

geoff-va commented 2 years ago

This happened to me when I tried to disable gRPc FUSE (related #5240) and after trying every single tip on every issue relating to starting failures, the solution was to obliterate everything, restart, and cross my fingers.

rm -rf ~/Library/Caches/com.docker.docker
rm -rf ~/.docker
rm -rf ~/Library/Group Containers/group.com.docker

open --background -a Docker

I just ran into this today as well and these instructions are what finally worked for me. Thanks @philsturgeon 👍

mbm-michal commented 2 years ago

same issue! Had to go back to docker 4.5.0, check (enable) gRPc FUSE and install 4.6.1

findmyway commented 2 years ago

This happened to me when I tried to disable gRPc FUSE (related #5240) and after trying every single tip on every issue relating to starting failures, the solution was to obliterate everything, restart, and cross my fingers.

rm -rf ~/Library/Caches/com.docker.docker
rm -rf ~/.docker
rm -rf ~/Library/Group Containers/group.com.docker

open --background -a Docker

I just ran into this today as well and these instructions are what finally worked for me. Thanks @philsturgeon 👍

This saved my day!

cristianortiz commented 2 years ago

same issue in fresh install for mac mini M1, downgrade to Docker 4.5.0 from 4.7 fixed the problem.

mattclegg commented 2 years ago

Same issue with 4.8.2 using Big Sur on Intel Mac. Downgrading to 4.5.0 fixed the issue.

nagyadam2092 commented 2 years ago

FYI after a long session, the appcleaner way worked for me as well. Probably some leftover, undeletable config got in the way.

pplmx commented 2 years ago

This happened to me when I tried to disable gRPc FUSE (related #5240) and after trying every single tip on every issue relating to starting failures, the solution was to obliterate everything, restart, and cross my fingers.

rm -rf ~/Library/Caches/com.docker.docker
rm -rf ~/.docker
rm -rf ~/Library/Group Containers/group.com.docker

open --background -a Docker

Running the above, and restarting the PC, works fine.

arthurkulchenko commented 2 years ago

Same situation to

Can not start Docker on MacBook Pro 16 with M1 Max chip. "Whale menu" does not appear on top, but some process is running as I see through Activity Monitor. Changing settings in settings.json does not help. This happens right after installation. UI does not appear at all.

With a small difference, UI is loaded but constatly stopping or starting. Also noticed that cpus set to 5 in ~/Library/Group\ Containers/group.com.docker/settings.json

{
...
  "cpus": 5,
...
}

Downgrading to 4.5.0 fixed the issue.

Has no effect neither. Same effect when cleaning cache...


Turns out in my case the culprit was turned on VPN in network settings on mac settings, disabling it solve the endless starting issue.

sliucw commented 2 years ago

I fixed, my step: 1. uninstall Docker 2. rm -rf Library/Group\ Containers/group.com.docker rm -rf Library/Containers/com.docker.docker rm -rf Library/Application\ Support/Docker\ Desktop 3. brew install --cask docker

sanarena commented 2 years ago

Having same issue. all steps above (and previous issue tracker where completely uninstall docker and reinstall) did not work. fortunately diagnos button works "0DE2584C-17A4-4359-9A11-365C5C43E538/20220915081442" It worth mentioning that even in troubleshoot mode, I cannot click reset to factory or uninstall button. they all do no reaction.

JPBedran commented 2 years ago

Hey guys, I tried all the fixes above and it still didn't work for me. The docker desktop app was starting on what seemed to be an infinite loop.

What did work was the following:

I ran /Applications/Docker.app/Contents/MacOS/Docker from terminal while having docker desktop open, this made the engine start and docker dektop run normally.

Intuitively something was wrong with communication between terminal and docker, permissions? Could be, although upon installation an advanced authorisation was required but for the helper.

I then disabled integrated terminal and a Mac Authorisation request to docker access terminal popped up.

After authorising, closed down docker and restarted it, and everything worked fine without need to run the '/Applications/Docker.app/Contents/MacOS/Docker' command in terminal. Switched back integrated terminal on, closed and reopened and all still working fine.

Sum up:

Re switching integrated terminal purely optional from my POV.

Hope this helps anyone!! Cheers!

natuan62 commented 2 years ago

Hi @JPBedran I got same problem on mac pro M1

ran '/Applications/Docker.app/Contents/MacOS/Docker' from terminal while docker desktop open.
Switched integrated terminal off // <=== mean close terminal ?
Authorised docker to terminal // <== How to authorised docker from terminal ?

Thanks!

sato-ryoka commented 1 year ago

~/Library/Group Containers/group.com.docker/settings.json

"cpus": 8,

Thanks, I fixed

JPBedran commented 1 year ago

Hi @JPBedran I got same problem on mac pro M1

ran '/Applications/Docker.app/Contents/MacOS/Docker' from terminal while docker desktop open.
Switched integrated terminal off // <=== mean close terminal ?
Authorised docker to terminal // <== How to authorised docker from terminal ?

Thanks!

Hey @natuan62
Hope you got it by now, but just saw this. If you didn't, I switched the integrated terminal off in the docker settings and then switched it back on, in those steps the Mac auth to terminal should pop up. Let me know! Cheers!

iAmWillShepherd commented 1 year ago

I experienced an issue similar to this, except Docker Desktop indicated that the engine was running. Turns out, the socket for the docker container was stored in the ~/.docker/run/docker.sock, so I had to symLink it to /var/run/docker.sock to get things working again.

FWIW here are the things I tried before doing ☝🏽

  1. Restarting Docker desktop (doesn't work)
  2. Resetting docker to factory settings (doesn't work)
  3. Clean/Purged data (didn't work)
  4. Many of the solutions from above
  5. Restart the computer
  6. Pray
  7. Contemplate career choices

Honestly, this issue has taken at least a year off my life expectancy, please fix this.

MichaelVoelkel commented 1 year ago

So what I did is uninstall Docker. Not sure why Docker does not itself provide a comprehensive guide or tool or anything... guys, seriously, this should be basics?

Anyways, I used this guide: https://nektony.com/how-to/uninstall-docker-on-mac Yeah, I removed dozens of files at dozens of places, reinstalled Docker Desktop and now Docker Desktop at least starts up...

robert-wloch-iits commented 1 year ago

As a workaround, I figured out that the configs are stored here:

~/Library/Group Containers/group.com.docker/settings.json

Switching back to 6 CPUS via key:

{
...
  "cpus": 6,
...
}

resolved the issue for me temporarily

Thanks @LeSauvage. I just encountered that issue on my M1 MBP (OS Ventura 13.0.1). Since the M1 has only 8 cores (4 high performance cores and 4 high efficiency cores) I reduced the value from 5 to 4 and Docker works again.

dth138 commented 1 year ago

I also had a memory issue - the new M1 macs have less memory than my old machine, and I had allocated 20GB of memory to Docker. That was fine on my 32GB mac, but not on my 16 GB. Thanks for the tip to edit ~/Library/Group\ Containers/group.com.docker/settings.json

nicola-pugliese commented 1 year ago

In my case I removed this folder ~/Library/Group Containers/group.com.docker/ and then reinstalled the latest version of docker (v 4.16.2). So in my case I enabled again VirtioFS and everything worked.

MacBook Pro M1 - Mac OS 13.2 (22D49)

michael-koeller commented 1 year ago

I had the same problem on M2 MBP. I finally got Docker running by downgrading to v4.5.0, then upgrading from within the Docker UI.

drewlustro commented 1 year ago

:\

bauerjon commented 1 year ago

I also found that a previous build worked for me https://docs.docker.com/desktop/release-notes/ specifically 4.14

rom3r4 commented 1 year ago

In my case Docker Desktop started getting stuck after an upgrade from 10.17.0 to 10.18.0. I am running MacOS Ventura on Apple M1.

After many tries of the workarounds above, what only I worked was downgrading to 10.17.0. The downloading site is https://docs.docker.com/desktop/release-notes/

olivierodo commented 1 year ago

Thank you @rom3r4, I just tried and it worked 🚀🚀🚀.

ecyzhi commented 1 year ago

I tried everything here and none of it works for me but when I force quit those Docker processes, there was a fatal error shown. After some digging, only this solution worked for me. https://github.com/docker/for-mac/issues/6565#issuecomment-1397776736

snowe2010 commented 1 year ago

I spent several hours trying to figure this out and finally did. In the end the solution wasn't blindly copying and pasting things from the internet, it was to dig into the logs myself:

Per the Docker Docs:

pred='process matches ".*(ocker|vpnkit).*" || (process in {"taskgated-helper", "launchservicesd", "kernel"} && eventMessage contains[c] "docker")'
/usr/bin/log stream --style syslog --level=debug --color=always --predicate "$pred"

Then start Docker Desktop and wait for the error message. In my case, the error was:

docker running vm running vm and dependencies: running vm running virtualization.framework com.docker.virtualization waiting for com.docker.virtualization vm exit status 1

So I waited to get that error, then I quit Docker Desktop so it wouldn't interfere. I then searched the logs for exit status 1. I found this:

2023-06-22 22:52:20.822244-0600  localhost com.docker.virtualization[5191]: (CoreFoundation) [com.apple.CFBundle:strings] Bundle: <private>, key: %@ %@, value: %@ %@, table: Error, l
ocalizationNames: (null), result: %1$@ %2$@
2023-06-22 22:52:20.822280-0600  localhost com.docker.virtualization[5191]: VM configuration is invalid: Invalid virtual machine configuration. “memorySize” is greater than “maximumAllowedMemorySize”.
2023-06-22 22:52:20.822440-0600  localhost com.docker.virtualization[5191]: validating configuration &{Configuration:{MemorySize:32212254720 CPUCount:12 BootLoader:{Kernel:/Applicati
ons/Docker.app/Contents/Resources/linuxkit/kernel CommandLine:page_poison=1 vsyscall=emulate panic=1 nospec_store_bypass_disable noibrs noibpb no_stf_barrier mitigations=off linuxkit
.unified_cgroup_hierarchy=1 console=hvc0  irqaffinity=0 vpnkit.connect=connect://2/1999 vpnkit.disable=osxfs-data com.docker.VMID=42a6e2a8-3796-4d90-ad34-f040373bc042 Ramdisk:/Applic
ations/Docker.app/Contents/Resources/linuxkit/initrd.img} Rosetta:{Tag:} SerialPort:{Input:0x14000330010 Output:0x14000330028} EntropyDevice:{} NetworkDevice:0x1400012a540 StorageDev
ice:0x14000141000 SocketDevice:{} DirectorySharingDevices:[] MemoryBalloonDevice:{} VsockDevice:0x103d871f8 ID:42a6e2a8-3796-4d90-ad34-f040373bc042} Logger:0x1400013c300 MemoryMiB:30
720 VPNKitBridgeVSockPort:1999 DiagnosticsVSockPort:62374 RequestedMAC: MACAddrFilename:vms/0/macaddr VPNKitEthernet: ConsoleLog:log/vm/console.log ConsoleSocket:vms/<decode: missing
 data>
2023-06-22 22:52:20.822450-0600  localhost com.docker.virtualization[5191]: [...] 0/console.sock DiagnosticdDirect:diagnosticd.direct.sock VPNKitBridgeFDPassing:vpnkit-bridge-fd.sock
 VirtiofsShares:[] WatchdogEnabled:true UseRosetta:false InstallRosetta:false ReportCrashes:true BalloonListener:0x14000328000}: Invalid virtual machine configuration. “memorySize” i
s greater than “maximumAllowedMemorySize”.
2023-06-22 22:52:20.823183-0600  localhost com.docker.backend[5152]: received error from the com.docker.virtualization process
2023-06-22 22:52:20.823248-0600  localhost com.docker.backend[5152]: VM failed: running VM and dependencies: running VM: running virtualization.framework: com.docker.virtualization:
waiting for com.docker.virtualization VM: exit status 1
2023-06-22 22:52:20.823552-0600  localhost com.docker.backend[5152]: switched to docker cli context default
2023-06-22 22:52:20.823572-0600  localhost com.docker.backend[5152]: running unix engine: running VM: running VM and dependencies: running VM: running virtualization.framework: com.d
ocker.virtualization: waiting for com.docker.virtualization VM: exit status 1

It actually said it a bit further up in the logs as well.

2023-06-22 22:52:20.821315-0600  localhost com.docker.virtualization[5191]: Error Domain=VZErrorDomain Code=2 "“memorySize” is greater than “maximumAllowedMemorySize”." UserInfo={NSL
ocalizedFailure=Invalid virtual machine configuration., NSLocalizedFailureReason=“memorySize” is greater than “maximumAllowedMemorySize”.}

I then edited the ~/Library/Group\ Containers/group.com.docker/settings.json like others have mentioned, but modified the memoryMiB setting (why isn't this named what the logs say?), and then saved.

sudo vim ~/Library/Group\ Containers/group.com.docker/settings.json

Finally I restarted Docker and it worked!

If your error messages are weird I would highly recommend just searching for VM configuration is invalid or Invalid virtual machine configuration which will tell you right away if it's the settings file (I think).

backstory:

I actually migrated to this laptop from a much larger intel mac. the m2s are so good you don't need half the memory or cpus for the same tasks and as a result a lot of the apps were intel based. I think that's what caused all of this pain and suffering.

QinisoM commented 1 year ago

Thanks @sliucw

I fixed, my step: 1. uninstall Docker 2. rm -rf Library/Group\ Containers/group.com.docker rm -rf Library/Containers/com.docker.docker rm -rf Library/Application\ Support/Docker\ Desktop 3. brew install --cask docker

The above worked for me on my M1 Max.

submato commented 1 year ago

why this bug still exist nowadays

rictt commented 10 months ago

Version 4.51 still has this problem, and i renew the version to 4.5.0, the problem resolved