After I restarted my windows i cannot connect to docker machine running in Oracle Virtual Box. When i start Docker QuickStart Terminal every thing looks fine, it's coming up OK and it gives me this message:
docker is configured to use the default machine with IP 192.168.99.100
For help getting started, check out the docs at https://docs.docker.com
but when i do:
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default - virtualbox Timeout
and:
λ docker images
An error occurred trying to connect: Get http://localhost:2375/v1.21/images/json: dial tcp 127.0.0.1:2375: ConnectEx tcp: No connection could be made because the target machine actively refused it.
also when i try to reinitialize my env., i get:
λ docker-machine env default
Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.99.100:2376": dial tcp 192.168.99.100:2376: i/o timeout
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
Be advised that this will trigger a Docker daemon restart which will stop running containers.
BTW, Regenerating certs also not helping. Any idea?
Thanks.
I have this problem too. Execute
docker-machine regenerate-certs <vm-name>
can not solve problem. I search Google the error info and find the solution below.sudo ifconfig vboxnet0 up
in terminal.docker-machine ls
.STATE
andURL
are ok.But restart the system this problem persists.
GitHub issues link I found is here.
It seems there is a bug in VirtualBox 5.1.24.
Please try regenerating certificates manually by:
and check for any errors to fix, then try again:
If it's failing on ssh, copy and paste that command into terminal to see what's the problem by adding extra
-vv
.If you've got:
then your machine isn't running (check by
docker-machine ls
), so try:Then try to ssh to it via:
Try this way/workaround:
Hope it helps also see my response here:https://github.com/docker/machine/issues/2808
In my case it was my
FortiClient
that caused the issue. After disabling itdocker-machine env default
worked fine again. I suggest you to check if there's any anti-virus program running in your system.The way I ensure being able to connect to my docker machines is by assigning them a fixed IP (and regenerating the certs only once) (no reboot needed)
After that,
docker-machine ls
always work.My current script:
(replace
%PRGS%\dm\latest
by the path wheredocker-machine.exe
is on your machine)(make sure
PATH
include the latest /path/to/git/usr/bin, for commands like ssh to be available)For instance:
That will assign
192.168.99.100
to the docker machine 'default
', and regenerate the certs once.Then each time
docker-machine ls
is called, it will display the same IP for 'default
'.After doing some research I found out that following workaround may solve the issue for now:
Open Network And Sharing Center
Click on Change Adapter Setting
See if you have any enabled adapters such as VPN or VM Ware network adapters.
Try to disable them and try to connect to your container one more time
If it didn't work while you have other adapters disabled, Restart your PC - in my case this worked for me.