Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error response from daemon: is vmnetd running? #6677

Closed
3 tasks done
rbouma opened this issue Jan 13, 2023 · 47 comments
Closed
3 tasks done

Error response from daemon: is vmnetd running? #6677

rbouma opened this issue Jan 13, 2023 · 47 comments

Comments

@rbouma
Copy link

rbouma commented Jan 13, 2023

  • I have tried with the latest version of Docker Desktop
  • I have tried disabling enabled experimental features
  • I have uploaded Diagnostics
  • Diagnostics ID: 1890E3D2-2574-45D2-87A9-131871CF2E43/20230113085338

Expected behavior

When running our local devstack it needs to be binding to port 53 (priviliged port) and it needs to have the vmnetd running but is isn't stated in the error:
Error response from daemon: Ports are not available: exposing port UDP 127.0.0.1:53 -> 0.0.0.0:0: failed to connect to /var/run/com.docker.vmnetd.sock: is vmnetd running?: dial unix /var/run/com.docker.vmnetd.sock: connect: no such file or directory

in the docs stated the following:
If the privileged helper process is not running, Docker Desktop prompts the user for authorization to run it under launchd.

The priviliged port helper vmnet deamon needs to be installed when a prompt pops up and give permission.

Actual behavior

The prompt for installing the deamon never pops up and throws this error:
Error response from daemon: Ports are not available: exposing port UDP 127.0.0.1:53 -> 0.0.0.0:0: failed to connect to /var/run/com.docker.vmnetd.sock: is vmnetd running?: dial unix /var/run/com.docker.vmnetd.sock: connect: no such file or directory

This happens every restart of docker for mac

Information

  • macOS Version: Ventura 13.1
  • Intel chip or Apple chip: M1 pro
  • Docker Desktop Version: v4.16.0

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

/Applications/Docker.app/Contents/MacOS/com.docker.diagnose check
Starting diagnostics

[PASS] DD0027: is there available disk space on the host?
[PASS] DD0028: is there available VM disk space?
[PASS] DD0018: does the host support virtualization?
[PASS] DD0001: is the application running?
[PASS] DD0017: can a VM be started?
[PASS] DD0016: is the LinuxKit VM running?
[PASS] DD0011: are the LinuxKit services running?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0031: does the Docker API work?
[PASS] DD0013: is the $PATH ok?
[PASS] DD0003: is the Docker CLI working?
[PASS] DD0038: is the connection to Docker working?
[PASS] DD0014: are the backend processes running?
[PASS] DD0007: is the backend responding?
[PASS] DD0008: is the native API responding?
[PASS] DD0009: is the vpnkit API responding?
[PASS] DD0010: is the Docker API proxy responding?
[SKIP] DD0030: is the image access management authorized?
[PASS] DD0033: does the host have Internet access?
[PASS] DD0018: does the host support virtualization?
[PASS] DD0001: is the application running?
[PASS] DD0017: can a VM be started?
[PASS] DD0016: is the LinuxKit VM running?
[PASS] DD0011: are the LinuxKit services running?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0031: does the Docker API work?
[PASS] DD0032: do Docker networks overlap with host IPs?
No fatal errors detected.

Steps to reproduce the behavior

  1. install docker desktop for mac 4.16.0
  2. stop and close your docker, then start it again
  3. docker-compose.yml >
version: "3.9"
services:
dnsmasq:
  container_name: dnsmasq
  image: rollupdev/dnsmasq
  ports:
  - mode: ingress
    host_ip: 127.0.0.1
    target: 53
    published: "53"
    protocol: udp
  restart: always
  1. docker compose up
  2. you got error Error response from daemon: Ports are not available: exposing port UDP 127.0.0.1:53 -> 0.0.0.0:0: failed to connect to /var/run/com.docker.vmnetd.sock: is vmnetd running?: dial unix /var/run/com.docker.vmnetd.sock: connect: no such file or directory
@rbouma
Copy link
Author

rbouma commented Jan 13, 2023

We fixed this temporary manually for now via:

we need to do this after every restart of docker desktop

check if the vmnetd launch service exists in /Library/PrivilegedHelperTools/com.docker.vmnetd otherwise copy them over with:

sudo cp /Applications/Docker.app/Contents/Library/LaunchServices/com.docker.vmnetd /Library/PrivilegedHelperTools/com.docker.vmnetd

check if the launch deamon exists in /Library/LaunchDaemons/com.docker.vmnetd.plist otherwise create it with:

sudo tee -a /Library/LaunchDaemons/com.docker.vmnetd.plist > /dev/null <<EOT
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        <plist version="1.0">
        <dict>
                <key>Label</key>
                <string>com.docker.vmnetd</string>
                <key>Program</key>
                <string>/Library/PrivilegedHelperTools/com.docker.vmnetd</string>
                <key>ProgramArguments</key>
                <array>
                        <string>/Library/PrivilegedHelperTools/com.docker.vmnetd</string>
                </array>
                <key>RunAtLoad</key>
                <true/>
                <key>Sockets</key>
                <dict>
                        <key>Listener</key>
                        <dict>
                                <key>SockPathMode</key>
                                <integer>438</integer>
                                <key>SockPathName</key>
                                <string>/var/run/com.docker.vmnetd.sock</string>
                        </dict>
                </dict>
                <key>Version</key>
                <string>64</string>
        </dict>
        </plist>
EOT

Last step is stop the vmnetd service if it is already running, unload, load the service and then start the vmnetd service again

sudo launchctl stop com.docker.vmnetd
sudo launchctl unload /Library/LaunchDaemons/com.docker.vmnetd.plist
sudo launchctl load /Library/LaunchDaemons/com.docker.vmnetd.plist
sudo launchctl start com.docker.vmnetd

this fixed our issue. but it will be better if docker is prompting for installing the deamon to use privileged ports such as 53

@aiordache
Copy link

Hi @rbouma.
Looking at the logs you uploaded, we found a failed vmnetd install but no details on the actual error apart from an exit status.
You can use the commands below to remove/install vmnetd:

/Applications/Docker.app/Contents/MacOS/install remove-vmnetd
/Applications/Docker.app/Contents/MacOS/install vmnetd

Do you mind trying them and check if the install is returning an error and if you can get more details on it please? Thanks!

@rbouma
Copy link
Author

rbouma commented Jan 13, 2023

@aiordache

❯ /Applications/Docker.app/Contents/MacOS/install remove-vmnetd
❯ /Applications/Docker.app/Contents/MacOS/install vmnetd
Error: parsing Info.plist: reading plist /Applications/Docker.app/Contents/Info.Plist: open /Applications/Docker.app/Contents/Info.Plist: no such file or directory

found out that the Info.plist exists

❯ ls -altrh /Applications/Docker.app/Contents/
drwxr-xr-x user admin 128 B  Thu Dec  1 11:40:33 2022  Library
drwxr-xr-x user admin  96 B  Thu Dec  1 11:40:33 2022  Frameworks
.rw-r--r-- user admin   8 B  Thu Dec  1 11:40:34 2022  PkgInfo
.rw-r--r-- user admin 7.5 KB Thu Dec  1 11:40:37 2022  embedded.provisionprofile
drwxr-xr-x user admin  96 B  Thu Dec  1 11:40:37 2022  _CodeSignature
.rw-r--r-- user admin 3.4 KB Tue Jan 10 19:20:28 2023  Info.plist
drwxr-xr-x user admin 320 B  Fri Jan 13 09:22:00 2023  .
drwxr-xr-x user admin 608 B  Fri Jan 13 09:22:03 2023  MacOS
drwxr-xr-x user admin 512 B  Fri Jan 13 09:22:05 2023  Resources
drwxr-xr-x user admin  96 B  Fri Jan 13 09:26:22 2023  ..

We are all using Case Sensitive File System so Info.Plist is non exists on the system

After rename the file with sudo mv /Applications/Docker.app/Contents/Info.plist /Applications/Docker.app/Contents/Info.Plist the install commands does work

after correcting the name docker is not starting anymore so needed it to rename it back to Info.plist

It is working now without any problem even when i restart docker desktop or the whole system the error is not seen anymore.

So i think this is an issue due to our file system that is case sensitive and the names with the Info.plist and Info.Plist


Update: 01-16-2023
Information
macOS Version: Ventura 13.1
Intel chip or Apple chip: Intel i9
Docker Desktop Version: v4.16.1

Again confirmed by a colleague running after running:

/Applications/Docker.app/Contents/MacOS/install remove-vmnetd
sudo mv /Applications/Docker.app/Contents/Info.plist /Applications/Docker.app/Contents/Info.Plist
/Applications/Docker.app/Contents/MacOS/install vmnetd
sudo mv /Applications/Docker.app/Contents/Info.Plist /Applications/Docker.app/Contents/Info.plist

it is working again.

So naming of the Info.Plist is not right.

@aiordache
Copy link

Sorry for this bug @rbouma. We'll get a fix in for the next release. Can you maybe duplicate the file and have it with both .Plist and .plist until then?

@rbouma
Copy link
Author

rbouma commented Jan 17, 2023

@aiordache Yes i have both files in the directory and so far it is running good. Will wait for the next release thanks!

@mat007
Copy link
Member

mat007 commented Jan 20, 2023

We have just released Docker Desktop 4.16.2 with a fix!

@mat007 mat007 closed this as completed Jan 20, 2023
@rbouma
Copy link
Author

rbouma commented Jan 20, 2023

@mat007 great! Thanks

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

/lifecycle locked

@monaw
Copy link

monaw commented Jun 15, 2023

i know this is closed but in case this helps anyone...in my case (MacOS 13.4, Docker Desktop Version 4.20.1), the steps mentioned above by rbouma, updated on 1-16 was close but didn't work. these steps worked for me:

  1. /Applications/Docker.app/Contents/MacOS/install remove-vmnetd
  2. sudo /Applications/Docker.app/Contents/MacOS/install vmnetd

@jonmann20
Copy link

same as @monaw was happening for me on MacOS 13.4 and Docker Desktop 4.20.1

@alanzheng88
Copy link

thanks @monaw! that resolved it for me on MacOS 13.4 and docker desktop 4.20.1

@kay-o
Copy link

kay-o commented Jul 23, 2023

Seems several projects have begun recommending Colima when using Docker on Mac. It seems to have solved this issue; trying it out further. (Colima describes itself as "container runtimes on macOS (and Linux) with minimal setup.")

@annstringer
Copy link

I can confirm that the solution by @monaw worked for me on MacOS 13.5.1 and Docker Desktop 4.23.

@setswei
Copy link

setswei commented Oct 19, 2023

+1 can also confirm those steps work on 13.4.1 and docker 4.24.2

@marcosbrasil
Copy link

+1
I can confirm that the solution by @monaw worked for me on MacOS Sonoma 14.0 and Docker Desktop 4.24.2.

@mogoman
Copy link

mogoman commented Nov 7, 2023

worked for me in Ventura upgrading to 4.25.0

@raoulwegat
Copy link

Thanks @monaw! Also working for me on Docker Desktop 4.25.2 (129061) and Sonoma 14.1.1

@sebastianricaldoni
Copy link

Thanks @monaw . It worked for me as well

macOS: Sonoma 14.1.1
Docker: v4.25.2 (build 129061)

@dhwani07
Copy link

Thanks @monaw works for me as well macOS: 13.5.2 Ventura, Docker v 4.25

@bellu
Copy link

bellu commented Dec 1, 2023

i know this is closed but in case this helps anyone...in my case (MacOS 13.4, Docker Desktop Version 4.20.1), the steps mentioned above by rbouma, updated on 1-16 was close but didn't work. these steps worked for me:

  1. /Applications/Docker.app/Contents/MacOS/install remove-vmnetd
  2. sudo /Applications/Docker.app/Contents/MacOS/install vmnetd

Thanks @monaw it worked on Sonoma Version 14.1 (23B74)

@manoj382
Copy link

manoj382 commented Dec 4, 2023

i know this is closed but in case this helps anyone...in my case (MacOS 13.4, Docker Desktop Version 4.20.1), the steps mentioned above by rbouma, updated on 1-16 was close but didn't work. these steps worked for me:

  1. /Applications/Docker.app/Contents/MacOS/install remove-vmnetd
  2. sudo /Applications/Docker.app/Contents/MacOS/install vmnetd

Thankful to have tracked down this thread. Worked for me!

Docker: 4.24.2 (124339 macOS: Ventura 13.6 (22G120)

@slackerzz
Copy link

i know this is closed but in case this helps anyone...in my case (MacOS 13.4, Docker Desktop Version 4.20.1), the steps mentioned above by rbouma, updated on 1-16 was close but didn't work. these steps worked for me:

1. /Applications/Docker.app/Contents/MacOS/install remove-vmnetd

2. sudo /Applications/Docker.app/Contents/MacOS/install vmnetd

Docker Desktop 4.26.0 on MacOS Sonoma 14.2

This helped, but after that, I constantly needed to run docker system prune, otherwise, each time I start my containers (via docker compose) I get something like this:

Error response from daemon: network 0903dc942d8d6f31628875418f6e873f3872b61fd69c45e108eecd43d162e8ba not found

@mitrol-design
Copy link

One more for @monaw ’s solution - macOS Sonoma 14.2.1 & Docker Desktop 4.26.1 — Thanks

@RootProgger
Copy link

RootProgger commented Jan 15, 2024

Same Problem on MacOS X Ventura, Docker Desktop 4.26.1.
@monaw solution works, but I can't every time go to the Sysadmin when i restart Docker-Desktop to call Sudo

@StephenHinck
Copy link

MacOS Sonoma 14.2.1 with Docker Desktop v4.26.1, same issue and same fix from @monaw worked great. Would be great to get this fixed directly and not require a workaround.

@nucsemin
Copy link

nucsemin commented Feb 1, 2024

Thanks a lot @rbouma. This solution worked for me.

@taoeffect
Copy link

I am running v4.29.0 on Sonoma 14.4.1, and still had to run @monaw's commands to get this to work.

Sounds like this hasn't been fixed? Can the issue be reopened?

@StephenHinck
Copy link

Updated to v4.31.0 today and it re-broke me. #6677 (comment) is still necessary to resolve this issue :-/

@RootProgger
Copy link

Updated to v4.31.0 today and it re-broke me. #6677 (comment) is still necessary to resolve this issue :-/

i resolved this issue on my Mac with complete deinstall docker desktop (including remove config files) and reinstall new version.

@ThePlastic
Copy link

Updated to v4.31.0 today and it re-broke me. #6677 (comment) is still necessary to resolve this issue :-/

i resolved this issue on my Mac with complete deinstall docker desktop (including remove config files) and reinstall new version.

tried, issue still present

@marcosbrasil
Copy link

I can confirm the same here as @StephenHinck

@StephenHinck
Copy link

@ThePlastic - reinstall has worked for me so far (and the fix has persisted through one upgrade). Follow the full instructions here: https://docs.docker.com/desktop/uninstall/, including the three terminal commands.

@KurtRogers
Copy link

Insane. @monaw you are a legend. The commands are still needed.

Docker v4.31.0 (153195)
image
MacOS 14.5 (23F79)

@ThePlastic
Copy link

ThePlastic commented Jul 4, 2024

@ThePlastic - reinstall has worked for me so far (and the fix has persisted through one upgrade). Follow the full instructions here: https://docs.docker.com/desktop/uninstall/, including the three terminal commands.

I didi it, step by step, still need the 2 commands listed above....

@brittonwalker
Copy link

The solve that worked for me was going to Settings -> Advanced and selecting "Allow privileged port mapping".
If it is already selected, which in my case was, I had to uncheck, apply changes, and check again. Solved my issue.

@ryan-ashbrook
Copy link

i know this is closed but in case this helps anyone...in my case (MacOS 13.4, Docker Desktop Version 4.20.1), the steps mentioned above by rbouma, updated on 1-16 was close but didn't work. these steps worked for me:

  1. /Applications/Docker.app/Contents/MacOS/install remove-vmnetd
  2. sudo /Applications/Docker.app/Contents/MacOS/install vmnetd

Worked for me as well.

@carbone
Copy link

carbone commented Aug 13, 2024

i know this is closed but in case this helps anyone...in my case (MacOS 13.4, Docker Desktop Version 4.20.1), the steps mentioned above by rbouma, updated on 1-16 was close but didn't work. these steps worked for me:

  1. /Applications/Docker.app/Contents/MacOS/install remove-vmnetd
  2. sudo /Applications/Docker.app/Contents/MacOS/install vmnetd

Worked for me as well.

Same. Thanks!

@kevinquillen
Copy link

kevinquillen commented Aug 22, 2024

This still happens (reported to me several times this week) and yet the issue is closed, and the fix is still to run the two commands.

@working-name
Copy link

@mat007 maybe a regression but it's not fixed in 4.20.1

@timohuisman
Copy link

i know this is closed but in case this helps anyone...in my case (MacOS 13.4, Docker Desktop Version 4.20.1), the steps mentioned above by rbouma, updated on 1-16 was close but didn't work. these steps worked for me:

  1. /Applications/Docker.app/Contents/MacOS/install remove-vmnetd
  2. sudo /Applications/Docker.app/Contents/MacOS/install vmnetd

Still got the issue in 4.34.3, ^ fixes the problem for me aswel.

@RalucaElisabetaR
Copy link

RalucaElisabetaR commented Dec 4, 2024

We fixed this temporary manually for now via:

we need to do this after every restart of docker desktop

Had same issue after updating to Docker to 4.36.0 and this fixed it ✔️✔️

@skoskie
Copy link

skoskie commented Jan 23, 2025

4.37.2 Checking in. Still an issue. Still resolved by...

/Applications/Docker.app/Contents/MacOS/install remove-vmnetd
sudo /Applications/Docker.app/Contents/MacOS/install vmnetd

@working-name
Copy link

Yup, still an issue. I gave up hope, so I placed the commands in a function in $HOME/.zshrc to make it easier to run every time:

function fixdocker() {
  sudo /Applications/Docker.app/Contents/MacOS/install remove-vmnetd
  sudo /Applications/Docker.app/Contents/MacOS/install vmnetd
}

All you do is type fixdocker like you do docker compose .... Function name = command, so it can be anything you want.

@rbouma
Copy link
Author

rbouma commented Jan 23, 2025

Original issue creator here: After all the issues I had in the past with Docker Desktop, I finally switched to a new Docker replacement called OrbStack. Check it out if you’re looking for something with fewer problems and much faster performance, including shorter startup times: https://orbstack.dev/

@skoskie
Copy link

skoskie commented Jan 30, 2025

I've heard of Orb and been wanting to try it out, but I need to research how disruptive the switch would be and I've just been way too busy to even think about it lately. I'm pretty dependent on DDev and not sure if they are compatible. Definitely glad to hear another positive comment about it though. Docker is so unreliable.

@crstauf
Copy link

crstauf commented Jan 30, 2025

I need to research how disruptive the switch would be

@skoskie For me, there was no disruption. Picked it up immediately.

dependent on DDev and not sure if they are compatible

One of my projects uses DDev and works fine with OrbStack.

@rbouma
Copy link
Author

rbouma commented Jan 30, 2025

@skoskie yes for me also, used mix of DDEV, Warden, RollDev and its al good and working correctly. OrbStack is also giving you a migration option to seamlessly transfer all projects, containers, volumes and images so you will not loose any data :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests