Docker-machine error "Could not find matching IP for MAC address" on Windows 10
Asked Answered
I

11

21

I got strange problem with docker-machine on windows 10. And I still cannot find solution.

It used to work before, but after some update of Windows 10 I began to get error "Could not find matching IP for MAC address ...". This error appears on any action with docker-machine.

For example, with docker-machine ls: enter image description here

I tried to reinstall dockertools with virtual box (with different network drivers). Tried to install latest version of virtual box. Remove and recreate docker virtual machine. Remove all vitrualbox host-only networks. It all doesn't help.

Here is what I get with docker-machine -D create -d virtualbox default:

enter image description here

docker-machine env default:

enter image description here

docker-machine regenerate-certs:

enter image description here

Could anybody point me in the right direction? What can cause such problem?

Thanks!


I've tried method suggested by VonC.

  1. Remove virtualbox and clean drivers and registry how suggested.
  2. Reboot PC.
  3. Install latest virtualbox (Version 5.0.18 r106667)
  4. Reboot PC.
  5. Set environment as suggested.

This is result.

C:\Users\Vadim>Desktop\env.bat

C:\Users\Vadim>rem minimal path:

C:\Users\Vadim>set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem

C:\Users\Vadim>rem add Git to PATH

C:\Users\Vadim>rem set glatest=PortableGit-2.8.1-64-bit

C:\Users\Vadim>set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem; C:\Program Files\Git\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git

C:\Users\Vadim>set TERM=msys

C:\Users\Vadim>set GIT_HOME=C:\Program Files\Git

C:\Users\Vadim>rem add VirtualBox to PATH

C:\Users\Vadim>set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem; C:\Program Files\Git\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git;C:\Pr ogram Files\Oracle\VirtualBox

C:\Users\Vadim>rem add docker-machine to PATH

C:\Users\Vadim>set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem; C:\Program Files\Git\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git;C:\Pr ogram Files\Oracle\VirtualBox;C:\Program Files\Docker Toolbox

C:\Users\Vadim>set path Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Gi t\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git;C:\Program Files\Oracle\ VirtualBox;C:\Program Files\Docker Toolbox PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

C:\Users\Vadim>docker-machine create -d virtualbox test Running pre-create checks... Creating machine... (test) Copying C:\Users\Vadim.docker\machine\cache\boot2docker.iso to C:\Users\ Vadim.docker\machine\machines\test\boot2docker.iso... (test) Creating VirtualBox VM... (test) Creating SSH key... (test) Starting the VM... (test) Check network to re-create if needed... (test) Windows might ask for the permission to create a network adapter. Sometim es, such confirmation window is minimized in the taskbar. (test) Found a new host-only adapter: "VirtualBox Host-Only Ethernet Adapter #2"

(test) Windows might ask for the permission to configure a network adapter. Some times, such confirmation window is minimized in the taskbar. (test) Windows might ask for the permission to configure a dhcp server. Sometime s, such confirmation window is minimized in the taskbar. (test) Waiting for an IP... Waiting for machine to be running, this may take a few minutes... Detecting operating system of created instance... Waiting for SSH to be available... Detecting the provisioner... Provisioning with boot2docker... Copying certs to the local machine directory... Copying certs to the remote machine... Error creating machine: Error running provisioning: Could not find matching IP f or MAC address 080027d6b14d

I still get this error about IP and MAC.


Further investigation. As was suggested by VonC I've retried this with docker-machine 0.6.0. And I got other error: enter image description here

As it's obviously trying to work with eth1 interface on virtual machine I've checked what's going on (all this time I could see vms created and worked in virtual box interface). This is what I see into guest VM: enter image description here

As you can see eth1 interface doesn't have ip4 address specified. Can it be the cause of problem and how to fix it?

Inger answered 22/4, 2016 at 2:53 Comment(5)
Do you have Hyper-v Microsoft feature active?Samul
I don't, because I'm on Windows 10 Home. But it worked before (it worked last week). I also can create virtualbox vms myself and run them. Do I have a chance?Inger
@vadim did you ever find solution to this?Urticaria
@TeaLeave unfortunately not. Just moved to linux.Inger
continuing to run into this problem, with the same challenges @vadim ran into, including all the attempted work around on Windows/virtualbox without any resolution.Melaniemelanin
P
8

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

Pungent answered 22/4, 2016 at 6:5 Comment(2)
I tried this many times. With or without reboot, reinstalling vitrualbox, reinstalling docker, removing host only adapters. In every possible combinations. Nothing helps :(Inger
this worked for me. I have virtualbox version 5.1.22r and docker version 17.06.0-ceBangup
B
5

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.

Boycie answered 9/5, 2016 at 10:21 Comment(4)
1. Done many times. 2. Also done many times. 3. Which start.sh?Inger
The start.sh script that I refer to is in C:\Program Files\Docker Toolbox. It is the same script that is executed by the Docker Quickstart Terminal shortcut. Personally, I run it - and all docker/machine commands from a cygwin terminal, rather than using the shortcut. If you read it, you will see that it does a few extra steps than just the dm create that you are trying to do - e.g. rm -rf ~/.docker/machine/machines/"${VM}"Boycie
I see from the output that you have posted that you get this message: Found a new host-only adapter: "VirtualBox Host-Only Ethernet Adapter #2". Does the adapter with that name have DHCP enabled in the Virtualbox preferences?Boycie
Yes it had. I also tried to remove all adapters from virtual box, and let docker to create them. It didn't change anything.Inger
S
4

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.

Samul answered 22/4, 2016 at 7:11 Comment(19)
Thanks for your answer. I've edited my question with results of your suggestion. It doesn't work.Inger
@Inger Would this work with docker-machine 0.6.0? (github.com/docker/machine/releases/tag/v0.6.0)Samul
C:\Users\Vadim>docker-machine version docker-machine version 0.6.0, build e27fb87 C:\Users\Vadim>docker-machine create -d virtualbox test Running pre-create checks... Creating machine... (test) Copying C:\Users\Vadim\.docker\machine\cache\boot2docker.iso to C:\Users\ Vadim\.docker\machine\machines\test\boot2docker.iso... (test) Creating VirtualBox VM... (test) Creating SSH key... (test) Starting the VM... (test) Check network to re-create if needed... (test) Waiting for an IP... Error creating machine: Error in driver during machine creation: Maximum number of retries (5) exceededInger
But I see this vm in VirtualBox interface, can show it, it's working! It's just cannot be managed by docker-machine.Inger
@Inger Can you check the logs of the VM? (in %USERPROFILE%\.docker\machine\machines\test\test\Logs)Samul
dl.dropboxusercontent.com/u/46978778/vbox_logs/VBox.log and dl.dropboxusercontent.com/u/46978778/vbox_logs/…Inger
@Inger Looks like github.com/docker/toolbox/issues/229 and github.com/docker/toolbox/issues/153Samul
@Inger Did you install the Oracle VM VirtualBox Extension Pack?Samul
Let us continue this discussion in chat.Inger
I really forgot Extension Pack for the first time. But after this i've repeated all the steps (with reinstalling VBox, cleaning drivers and registry etc) with Extension Pack and got the same results. "Error in driver" with 0.6.0 and "Could not find matching IP for MAC" with 0.7.0. But in both cases VM really created! I see it in VirtualBox interface, can open it and it's working!Inger
@Inger Strange, I did the same setup this afternoon without any issue. Do you have any firewall/AV (even Windows Defender) which might limit the ports and access to the docker-machine?Samul
All AV, Defender and Firewall are disable. Maybe it's somehow related to Windows version as this problem appeared after Windows 10 update. I have version - Microsoft Windows [Version 10.0.10586]. What is yours? I also added some new data to question. Could you check? Maybe it's some problem with guest eth1 interface?Inger
@Inger no ipv4... looks like github.com/docker/docker/issues/21175#issuecomment-196390721 Can you doulbe-check the docker logs? Try and disable ipv6 for testing (github.com/docker/libnetwork/issues/892)Samul
@Inger also of interest: github.com/docker/docker/issues/18113#issuecomment-208498623 and github.com/docker/libnetwork/issues/779 (for docker0, not eth1, but still worth checking out)Samul
Frankly I'm not quite ok with computer networks to figure it out by myself. What means "disabled by vendor"? What vendor? Windows? VirtualBox? Docker? How to enable it?Inger
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.Thrall
@KevinHooke Thank you. I have included your comment in the answer for more visibility.Samul
Thank you, but it doesn't work for me :( For me it began after updating Windows 10 not docker. Vitrual box that time was 5.0.18. I'm constantly updating it and trying my docker and it's still death with the same error. Now I have Version 5.0.24 r108355 of VitrualBox. Still the same problem :(Inger
@Vad And with VirtualBox 5.1?Samul
F
4

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.

Fuld answered 4/4, 2018 at 12:43 Comment(0)
Y
2

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.

Yuji answered 28/9, 2016 at 17:43 Comment(0)
H
2

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
Hemorrhoid answered 11/4, 2017 at 11:2 Comment(0)
P
2

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.

Propositus answered 16/5, 2018 at 9:53 Comment(0)
B
2

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.
Bergh answered 18/4, 2019 at 12:0 Comment(2)
When run dmvbf.bat default 99 101 I get Error: Cannot run SSH command: Host "default" is not running. Prior to install the DockerToolbox-19.03.1 I ran two scripts: setx DOCKER_TAG '$DOCKER_TAG' and setx HOST $(hostname). Could you advice please? Running on Windows 8.1.Clothe
Looks like you have no machines, or it has different name. Try to check list of machines docker-machine ls If it is empty try to create new docker-machine create defaultCapper
S
1

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 :)

Shakeup answered 15/2, 2019 at 18:47 Comment(0)
H
0

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.

Hermelindahermeneutic answered 24/4, 2018 at 13:5 Comment(0)
C
0

I was experiencing this issue. What worked for me was restating the docker-machine using command

docker-machine restart

Crookes answered 9/1, 2023 at 20:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.