Docker-machine error “Could not find matching IP for MAC address” on Windows 10

拥有回忆 提交于 2019-11-28 23:08:02

Open virtual box, remove docker vm. Thet start quick-start again. I have same problem too on windows.

Aaron Knauf

I had this same problem. I solved it by:

1) Remove the "VirtualBox Host-Only Ethernet Adapter" using the VirtualBox Manager gui. (Preferences->Network->Host-only Networks) In fact there were 2 of these; I deleted both.

2) Delete the default VM (again, using the VirtualBox Manager gui)

3) re-run the start.sh script

Further notes: I'm using Windows 7 and cygwin64. The start.sh script has issues with finding the path to vboxmanage. While solving these errors, I ran the start.sh script multiple times, which probably accounts for the strange state that VBox found itself in.

VonC

That error message comes from "Determine host-only interface dynamically, stop assuming eth1" and PR 3112 fixing issue 3108

I would try to:

  • uninstall completely VirtualBox,
  • delete any vbox* file in C:\Windows\system32\drivers\,
  • delete any vbox* folders in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services
  • reinstall virtualbox 5.0.18 and its Oracle VM VirtualBox Extension Pack
  • use CMD only (no bash to avoid any side-effect)

Set your PATH by an senv.bat script which would include (change the path to your setup):

rem minimal path:
set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem

rem add Git to PATH
set glatest=PortableGit-2.8.1-64-bit
set PATH=%PATH%;C:\Personal_Unsaved\prgs\git\%glatest%\bin;C:\Personal_Unsaved\prgs\git\%glatest%\usr\bin;C:\Personal_Unsaved\prgs\git\%glatest%
set TERM=msys
set GIT_HOME=C:\Personal_Unsaved\prgs\git\%glatest%

rem add VirtualBox to PATH
set "PATH=%PATH%;C:\Personal_Unsaved\prgs\vbox\latest"

rem add docker-machine to PATH
set PATH=%PATH%;C:\Personal_Unsaved\prgs\dm\latest

Than, in that new environment, with the latest docker-machine 0.7.0, create a new machine:

docker-machine create -d virtualbox test
docker-mahcine ssh test

(use ssh from docker-machine, not ssh from a git bash)

Kevin Hooke mentions below in the comments (July 2016):

I had this same error on 1.11.2 on Windows 7 after downloading and installing the latest Toolbox. Error only started after updating Toolbox.

Even after deleting the default VM in VirtualBox would get the same error when it was recreated.

I noticed in the ticket mentioned in the answer above on GitHub that it mentions VirtualBox 5.0.14, so I just updated to 5.0.24. Started up the Quickstart prompt, it recreated the default vm, and now no issue.

This worked for me on Windows:

I ran this command -

docker-machine rm default

Then, I restarted docker-machine terminal and it assigned IP automatically.

If different IP (from previous run) is assigned on restart, docker-machine shows connectivity issues with the VM.
One approach that worked for me is to restart it in a way so that it gets same IP at restart.
E.g. if 192.168.99.102 (third in seq 100, 101, 102) was assigned at creation, then start any two other VMs before this docker machine, so that this one gets 102.

I am maintaining the commands, which had been handy in running docker in my initial days for reference:
Handy commands on docker-machine, docker and docker-compose for starters.

One day I woke up, and Docker didn't work with mentioned "Could not find matching IP for MAC address ..."

What helped me it was to:

  • uninstal Docker Toolbox
  • uninstall VirtualBox
  • remove folder C:\Users\user_name\.docker
  • remove folder C:\Users\user_name\.VirtualBox
  • install Docker Toolbox again

My answers can be useful for future readers, because once I recently faced this problem, I found this question first.

all above mentioned solution did not work for me, I have deleted Default Machine from Virtual Machine and recreated it by

docker-machine rm default
docker-machine create --driver virtualbox default

Then, I have removed network adapters as described above by Aaron Knauf

Finally, I have uninstalled docker and VirtualBox, and deleting configuration files .docker and .VirtualBox in user`s folder.

Then, After reinstalling Docker Toolbox and VirtualBox, then Docker worked well

Even if reinstalling is not good practice, it solved my problem.

Same as a few of you have done above but with some changes

  1. Remove the "VirtualBox Host-Only Ethernet Adapter" using the VirtualBox Manager GUI. (Preferences->Network->Host-only Networks) In fact there were 2 of these; I deleted both.
  2. Delete the default VM (again, using the VirtualBox Manager GUI)
  3. Start the "Docker QuickStart Terminal" in Admin mode
  4. As the terminal is starting, create a new "VirtualBox Host-Only Ethernet Adapter" on the VirtualBox Manager GUI and provide the static IP Address as your previous Docker machince, and enable DHCP on it.

This worked for me once. Hope it will work again and again :)

I had through this problem. I can tell - removing and reinstalling does nothing. Here are my steps:

  1. Download and install latest docker-toolbox from github (currently v18.09.3)
  2. Download and install latest virtualbox (currently 6.0.4-128413)
  3. Start docker-toolbox with shortcut
  4. Get error "Could not find matching IP for MAC address ..." (Machine started normally, you can log into from Virtualbox GUI and it works fine. But Windows does not see it beacause network settings)
  5. Do not stop the virtual machine
  6. Create dmvbf.bat file with this contents

    @echo off
    setlocal enabledelayedexpansion
    set machine=%1
    if "%machine%" == "" (
        echo dmvbf expects a machine name
        exit /b 1
    )
    set ipx=%2
    if "%ipx%" == "" (
        echo dmvbf x missing ^(for 192.168.x.y^)
        exit /b 2
    )
    set ipy=%3
    if "%ipy%" == "" (
        echo dmvbf y missing ^(for 192.168.x.y^)
        exit /b 3
    )

    echo kill $(more /var/run/udhcpc.eth1.pid) | docker-machine ssh %machine% sudo tee /var/lib/boot2docker/bootsync.sh >NUL
    echo ifconfig eth1 192.168.%ipx%.%ipy% netmask 255.255.255.0 broadcast 192.168.%ipx%.255 up | docker-machine ssh %machine% sudo tee -a /var/lib/boot2docker/bootsync.sh >NUL
    echo route add default gw 192.168.99.22 | docker-machine ssh %machine% sudo tee -a /var/lib/boot2docker/bootsync.sh >NUL


    docker-machine ssh %machine% "sudo cat /var/run/udhcpc.eth1.pid | xargs sudo kill"

    docker-machine ssh %machine% "sudo ifconfig eth1 192.168.%ipx%.%ipy% netmask 255.255.255.0 broadcast 192.168.%ipx%.255 up"

(Thanks to VonC answer)

  1. execute dmvbf.bat default 99 101 in Windows CMD. It change IP address inside machine through ssh
  2. docker-machine restart default
  3. docker-machine regenerate-certs default. Because we chaned IP address, previously generated certificate is not valid any more.
  4. eval $(docker-machine env default) in Windows CMD. Without this step I was getting different errors (exit status 255 etc)
  5. start docker-toolbox once again, this time you get docker started well with an IP 192.168.99.101
  6. execute docker run hello-world and enjoy.

I had a similar problem, I simply made it work by killing the VM process in the Task Manager and relaunching Docker Quickstart Terminal.

I hope this may help someone someday.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!