Docker cannot create a machine - Error in driver during machine creation - docker

error message
when the first time i run the Docker Quickstart Terminal , i got below message,the machine cannot be create.
Error creating machine: Error in driver during machine creation: exit status 1
Looks like something went wrong... Press any key to continue...
does anyone have some idea?
Versions of related components:
DockerToolbox-1.9.0
Windows 7 sp1
VirtualBox Version 5.0.8 r103449

Without using docker quickstart, make sure docker-machine_windows-amd64.exe (the latest 0.5.5 version) is in your path and type:
cd /path/to/docker-machine_windows-amd64.exe
docker-machine ls
docker-machine create -d virtualbox anewmachine
docker-machine ssh anewmachine
(if dokcer-machine is already in your PATH because of the docker Toolbox installation, you have nothing to download: just type docker-machine version to check its version)

Related

Docker Toolbox setup fails on Windows 8.1

After (successfully, I believe) installing the Docker Toolbox, I get the following error:
$ docker ps
error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.26/containers/json: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.
Also, when I try to run the docker quickstart terminal, it just prints the following error:
Docker Machine is not installed. Please re-run the Toolbox Installer and try aga
in.
Looks like something went wrong in step 'Looking for vboxmanage.exe'... Press an
y key to continue...
I searched through the docker troubleshooting but didn't find any hint.
I tried installing the toolbox both with and without checking the "Install VirtualBox with NDIS5 driver [default NDIS6]" checkbox.
Try this,
Check if the docker machine exists. Command to check this below.
docker-machine ls
If you still get error then execute step 2 below. If you see any machine listed and it has STATE stopped then execute docker-machine start machine_name eg. docker-machine start default
This step helps you to create a docker-machine.
docker-machine create --driver virtualbox default
I also face some problems like you and I troubleshoot the problem with the following steps in window 8.1.
Install Docker Toolbox
REGENERATE CERTIFICATES
$ docker-machine regenerate-certs default
Regenerate TLS machine certs? Warning: this is irreversible. (y/n): y
Regenerating TLS certificates
Create new machine default
$ docker-machine create default
Note: It may take a few minutes for downloading boot2docker.iso file.
UPGRADE docker-machine (Optional)
$ docker-machine upgrade
START Docker Quickstart Terminal (or) Run start.sh file under the location => C:\Program Files\Docker Toolbox
RUN HELLOWORLD
$ docker run hello-world
I hope it will help you :-)

Error in Docker: bad address to executables

I'm trying to something with Docker.
Steps I'm doing:
- Launch Docker Quickstart Terminal
- run docker run hello-world
Then I get error like:
bash: /c/Program Files/Docker Toolbox/docker: Bad address
I have to say that I was able to run hello-world image, but now I'm not. I don't know what happend.
I don't know if it matters however I had some problems at instalation step.
Since I have git installed in non standard location. However it seems git bash.exe working correctly for Docker.
My environment:
Windows 10
Git 2.5.0 (installed before Docker)
Docker Toolbox 1.9.1a
I have the same issue with bash: /c/Program Files/Docker Toolbox/docker: Bad address
I thought the problems is "bash doesn't support docker.exe".
SO I fix this problem by use powershell ,not the bash.
and if you use powershell maybe face this
An error occurred trying to connect: Get http://localhost:2375/v1.21/containers/json: dial tcp 127.0.0.1:2375: ConnectExenter code here
tcp: No connection could be made because the target machine actively refused it.
You can export variable from bash use export and import to powershell by this below
$env:DOCKER_HOST="tcp://192.168.99.100:2376"
$env:DOCKER_MACHINE_NAME="default"
$env:DOCKER_TLS_VERIFY="1"
$env:DOCKER_TOOLBOX_INSTALL_PATH="C:\\Program Files\\Docker Toolbox"
$env:DOCKER_CERT_PATH="C:\\Users\\kk580\\.docker\\machine\\machines\\default"
that's all
ps:I found this problem fixed by update git from 2.5.0 to 2.6.3.
Not entirely sure what the issue is, report it to the project on github. I find the docker mac and windows tools a bit flakey from time to time as they are still maturing. If you don't mind seeing what's underneath, you can try running docker-machine directly or set up your own host pretty quickly with Vagrant.
Docker Machine
Run a command or bash prompt to see what machines you have.
docker-machine ls
Create a machine if you don't have one listed
docker-machine create -d "virtualbox" default-docker
Then connect to the listed machine (or default-docker)
docker-machine ssh default-docker
Vagrant
If that doesn't work you can always use vagrant to manage VM's
Install VirtualBox (Which you probably have already if you installed the toolbox)
Reinstall Git, make sure you select the option for adding ALL the tools to your system PATH (for vagrant ssh)
Install Vagrant
Run a command or bash prompt
mkdir docker
cd docker
vagrant init debian/jessie64
vagrant up --provider virtualbox
Then to connect to your docker host you can run (from the same docker directory you created above)
vagrant ssh
Now your on the docker host, Install the latest docker the first time
curl https://get.docker.com/ | sudo sh
Docker
Now you have either a vagrant or docker-machine host up, you can docker away after that.
sudo docker run -ti busybox bash
You could also use PuTTY to connect to vagrant machines instead of installing git/ssh and running vagrant ssh. It provides a nicer shell experience but it requires some manual setup of the ssh connections.

Why is my docker machine not working under OSX?

I've installed Docker Toolbox v1.8.1b on OSX 10.10.5
This also installs VirtualBox v5.0.2
However, when the installation has finished and I run the Docker Quickstart Terminal, it does its thing, creates a new VM in virtualbox but then doesn't start it, finishing with the message that default is not running.
When I try to run the machine using docker-machine start default I get the message exit status 1.
When I go to VirtualBox and attempt to start the machine there, I get the following error message:
Failed to load VMMR0.r0 (VERR_VMM_SMAP_BUT_AC_CLEAR).
Result Code:
NS_ERROR_FAILURE (0x80004005)
Component:
ConsoleWrap
Interface:
IConsole {872da645-4a9b-1727-bee2-5585105b9eed}
So is anyone else getting this or am I not following the instructions properly?
I had exactly the same problem. It seems that there is a bug in recent versions of VirtualBox, which is fixed in the latest test build. See https://www.virtualbox.org/ticket/14412
I downloaded the latest VirtualBox test build from
https://www.virtualbox.org/wiki/Testbuilds
then used the uninstaller script provided in that installer to remove the buggy version before installing the new one.
Running the Docker QuickStart Terminal again got the default VM running, but it was missing a ca.pem file:
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
open /Users/justin/.docker/machine/machines/default/ca.pem: no such file or directory
VirtualBox confirmed that the VM was running.
I could create a new VM and use it with docker successfully (in a different Terminal window):
Justins-MacBook:~ justin$ docker-machine create --driver virtualbox dev
Creating VirtualBox VM...
Creating SSH key...
Starting VirtualBox VM...
Starting VM...
To see how to connect Docker to this machine, run: docker-machine env dev
Justins-MacBook:~ justin$ eval "$(docker-machine env dev)"
Justins-MacBook:~ justin$ docker run hello-world
...
I then deleted the default VM:
Justins-MacBook:.docker justin$ docker-machine stop default
Justins-MacBook:.docker justin$ docker-machine rm default
Successfully removed default
Running the Docker QuickStart Terminal created a new default VM, and docker is now working happily with it.
Update: There is an open issue for this at: https://github.com/docker/toolbox/issues/119
Just wanted to add: if you have docker for mac installed, they intentionally removed the docker-machine command starting from version 2.2.0.
You can find the discussion here: https://github.com/docker/for-mac/issues/4208
So, you need to install docker-machine separately, using the commands provided by #shivanikoko or using brew:
brew install docker-machine
ON Osx after installing docker or updating docker we have to reinstall the docker-machine again to make it work in CLI.
Running the command below helped me.
base=https://github.com/docker/machine/releases/download/v0.16.0 &&
curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/usr/local/bin/docker-
machine &&
chmod +x /usr/local/bin/docker-machine

Docker for Windows not working

I've installed Docker toolbox now and I get the error for everything:
Get http://127.0.0.1:2375/v1.20/version: dial tcp 127.0.0.1:2375: ConnectExtcp: No connection could be made because the target machine actively refused it..
* Are you trying to connect to a TLS-enabled daemon without TLS?
* Is your docker daemon up and running?
docker version output:
Client:
Version: 1.8.1
API version: 1.20
Go version: go1.4.2
Git commit: d12ea79
Built: Thu Aug 13 02:49:29 UTC 2015
OS/Arch: windows/amd64
Get http://127.0.0.1:2375/v1.20/version: dial tcp 127.0.0.1:2375: ConnectEx tcp: No connection could be made because the target machine actively refused it..
* Are you trying to connect to a TLS-enabled daemon without TLS?
* Is your docker daemon up and running?
But the VM is running under VirtualBox. I have searched everywhere but can't find a solution.
UPDATE1: I'm using Windows 8.1 and also tried to start through Kinematic also.
UPDATE2: Everything worked like charm when I tried Virtualbox Test Build 5.0.3 or later. You can download here: https://www.virtualbox.org/wiki/Testbuilds
Just run:
"C:\Program Files\Docker Toolbox\docker-machine" ls
get the machine name, and then run:
"C:\Program Files\Docker Toolbox\docker-machine" env <MACHINE_NAME_HERE> --shell=[cmd|powershell]
and you should get something like this:
"C:\Program Files\Docker Toolbox\docker-machine" env default --shell=cmd
set DOCKER_TLS_VERIFY=1
set DOCKER_HOST=tcp://192.X.X.X:2376
set DOCKER_CERT_PATH=C:\Users\X\.docker\machine\machines\default
set DOCKER_MACHINE_NAME=default
# Run this command to configure your shell:
# copy and paste the above values into your command prompt
I also get an error open C:\Users\X\.docker\machine\machines\default\server.pem: The system cannot find the file specified.
and solved it by upgrading my VirtualBox to version 5.0.3 (from their nightly builds)
Long version:
I got the same problem and after and the "Using Docker from Windows Command Line Prompt (cmd.exe)" section from the installation manual put me in the right direction
Basically, the way docker works is that the "docker " commands are passed to a docker service (running on port 2375). As you are running the docker from windows host, the service actually runs on the linux host created by docker (you can see it by opening the virtualbox ui).
The usual flow is the following:
default machine is created
the starter (kinamatic / "Docker Quickstart Terminal" / cmd) of the machine waits for the machine to boot, gets it's IP address and sets the linux ip:port as the service address (instead of 127.0.0.1:2375) in few enviremnt/powershell variables
from this point all docker ... commands are send to the linux host and everything works almost as native linux
The problem is that there is some issue with the machine setup (my guess the new virtual box but I am not sure and have the time to dig into it). You can see that by runnung the ls command and notice that (at least in my case) the state of the machine is "timeout" and there is no url, unlike the output shown in the manual.
This causes the enviorment values not to be set and the docker ... commands to fail.
Apart from running the command, you can also start the Docker Quickstart Terminal that does the same thing but with sh shell
Regarding the certificate error, I tried to regenrate the certificates from within the virtual machine using:
/usr/local/bin/generate_cert --overwrite --host=default,127.0.0.1,10.0.2.15,192.168.99.100 --ca=/var/lib/boot2docker/tls/ca.pem --ca-key=/var/lib/boot2docker/tls/cakey.pem --cert=/var/lib/boot2docker/tls/server.pem --key=/var/lib/boot2docker/tls/serverkey.pem
I got "protocol error"s when tried to copy the certificate to the host machine, which reminded me an old virtualbox shared folders bug, so this may not be a problem with docker but with virtualbox - I upgraded to the latest nightly version (5.0.3-102224), regenerated the default image and that seems to solve it. As windows 10 is not officially supported yet neither by docker nor by virtualbox, I am not sure if this is the same thing that causes you to get the certificate error, In any case can try to copy the certificates from the virtual machine (you have the paths in code block) to your local user directory (it is mapped to /c/Users/X/ in the virtual machine)
The following worked for me (Docker Toolbox 1.8.1b and Windows 7). It is a simplified version of what #baptiste-gaillard outlined in the comments above. Short answer: Use VirtualBox 5.03 or later from the get-go.
Download VirtualBox 5.03 (nightly build at the time of this post) and extension pack.
Reboot laptop. (Clears out running VirtualBox stuff.)
Install VirtualBox 5.03 and extension pack 5.03.
Delete the default VM entirely (remove files).
Re-run Docker Quickstart Terminal shortcut to generate the default VM.
The Quickstart script seems to get along better with VirtualBox 5.03 with regards to creating the requisite TLS keys.
Had the same issue as you showed and Just fixed it a few hours ago.
All need to do is disable Hyper-V. Run a command prompt with administrator rights and run the following command:
bcdedit /set hypervisorlaunchtype off
Restart your PC, open virtualbox and delete default vm after relaunch, go back to docker quickstart terminal and put the following in command:
docker run hello-world
and you're done! Hope it solves your problem
this works for me
1) start the command line tool first and get the machine ip address by running
docker-machine ls command
2) Re-generate certs
docker-machine regenerate-certs
3) Set the evn variables manually in my case the location of certs was different
set DOCKER_TLS_VERIFY=1
set DOCKER_HOST=tcp://machine_IP:2376
set DOCKER_CERT_PATH=C:\Users\X.docker\machine\certs
set DOCKER_MACHINE_NAME=default
Now run docker version
Here is the output in my case
Client:
Version: 1.8.1
API version: 1.20
Go version: go1.4.2
Git commit: d12ea79
Built: Thu Aug 13 02:49:29 UTC 2015
OS/Arch: windows/amd64
Server:
Version: 1.8.1
API version: 1.20
Go version: go1.4.2
Git commit: d12ea79
Built: Thu Aug 13 02:49:29 UTC 2015
OS/Arch: linux/amd64
The Docker Toolbox (in 1.8.x) installation configure by default your Docker Daemon to use secure connection via the TLS protocol (version 1.8).
If you were using an older version of the daemon that wasn't secured that means at least two things :
- the port number changed from 2375 to 2376
- your daemon client need to present a certificat to communicate with you docker engine/server.
So the reply of sandiindia indicates the environment variables that precise to the docker client the good configuration to connect to the docker server/engine:
#You're using a TLS secured daemon :
set DOCKER_TLS_VERIFY=1
# Precise the Docker Host IP and port, the TLS default is 2376
set DOCKER_HOST=tcp://*<docker_host_IP>*:2376
# The paths to the certificate and client key needed to authenticate to the daemon
# You should have 3 files in this directory : ca.pem, cert.pem and key.pem
# In my case the default path looks like :
set DOCKER_CERT_PATH=C:\Users\*<username>*\.docker\machine\machines\default
#the name of your Docker Host VM :
set DOCKER_MACHINE_NAME=default
The docker documentation about TLS configuration :
https://docs.docker.com/articles/https/
I hope it helps ;)
Close the virtual machine from Virtual Box (you don't have to delete it)
Close Kitematic
Close Docker Quickstart Terminal
Now do this in-order:
Open Kitematic
Open Docker Quickstart Terminal
Its important not to open Docker Quickstart Terminal before Kitematic, as Kitematic will initialize things for Docker Quickstart Terminal
I didn't need to execute any command line..
I hope this will help some body..
I too had the same problem, but I was able to solve it without having to type anything on the command line, it just worked out of the box.
It turns out a few initialization steps were missing, as pointed out in the accepted answer above. Why wasn't the default Docker installation already doing this? I also had missing certs. So, I uninstalled everything and restarted from scratch. However, after the installation completed, this time around do not open the Docker Quick Start terminal first, open Kitematic instead to do the first initialization for you.
Kitematic created the certs for me, set the missing env variables and then I opened the Docker Quick Start terminal. I typed docker run hello-world, then docker version and this time it worked as expected, no error messages.
Note that this didn't work when I opened the Quick Start terminal first.
I'm testing Docker inside VMWare 10 instances and I was able to duplicate this problem and its solution (workaround) in every case.
I hope this helps.
I fixed my issue by simply Removing the default VM in the VirtualBox manager, rebooting PC (just in case), and then re-running Docker Quickstart Terminal. That's it.
Docker 1.8.2 and Virtual Box 5.0.4
Update to the latest virtual box above 5.0.3
Restart the system
open virtual box and remove the default virtual machine
open the docker quick start terminal
run docker run hello-world
And you are done.
Delete and remove all old v.machines on your laptop:
1. Open VirtualBox, right click on 'default', Remove, 'Delete All files'.
2. Command Prompt (Run as Admin)> docker-machine rm default
Uninstall Virtualbox, Docker toolbox and Git.
Navigate to c:\Users\Vinita, and delete dirs. .docker and .Virtualbox
CClean files and registry.
Reboot.
Cleaning is done.
I. Download latest version of Docker tools for windows (1.10.2) from Docker Toolbox
Right click on the downloaded file and 'Run as administrator'
This will install - Docker Quickstart, Kitematic and Virtualbox.
II. Download latest test build of VirtualBox (5.01.15-105696-win.exe) from
Testbuilds – Oracle VM VirtualBox . Run as Administrator again.
(You can ignore any warnings and overwrite on the already Docker-installed VirtualBox).
So far, Nothing out of the ordinary. We just installed the software with Admin rights.
Now, Control Panel>Network and Sharing Center>Change adapter settings:
Right click VirtualBox Host-Only Network #2 for Properties.
Check> VirtualBox NDIS6 Bridged Networking Driver.
(If it is already checked, uncheck and check again.)
You are done. This is the only fix that we have employed!
Both Kitematic and Docker Quickstart should work now.
Right click on Kitematic and Run as admin the first time.
Tested on Windows 10.
I encountered exactly the same error when I run docker images after a system reboot. I used docker version 1.10 on Windows 7 64 bits with virtualbox 5.0.10 and mintty(the terminal come with Git for Windows)
Executing docker-machine ls showed me the virtual machine is in Timeout state.
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default virtualbox Timeout
So I restarted the virtual machine
$ docker-machine restart default
Then list the status again told me the cert is bound to an incorrect address:
$ docker-machine ls
Unable to query docker version: Get https://192.168.56.101:2376/v1.15/version: x509: certificate is valid for 192.168.99.101, not 192.168.56.101
Then I regenerate the cert
$ docker-machine regenerate-certs default
and finally
$ eval $(docker-machine env default --shell=bash)
Then docker is working again!
With Docker 1.8.1d had the same problem, having uninstalled 1.8.1c. Eventually fixed problem by installing latest Virtual Box (5.0.18), rebooting when prompted and starting Kitematic. Kitematic fails at first and offers option to remove and re-install the VM which I did. After that my QuickStart Terminal was OK.
It sounds like the problem with virtual box,
In my case, I have performed below steps to resolve the issue
Stop Docker machine by 'docker-machine stop'
Open Network and sharing Center in Windows OS
Click on Change Adapter settings
Disable the VirtualBox-Host Only Network
Start Docker machine by 'docker-machine start'
I had the same issue with Docker Toolbox on Windows 10 Home. The steps to fix the problem from here:
run docker-machine ls to get a list, you should probably see this:
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default - virtualbox Stopped Unknown
Optional step upgrading (be patient):
docker-machine upgrade
restart the default:
docker-machine start default
don't worry if says:
Machine "default" is already running.
now you should be able to run docker version and see something like:
Client:
Version: 19.03.1
API version: 1.40
Go version: go1.12.7
Git commit: 74b1e89e8a
Built: Wed Jul 31 15:18:18 2019
OS/Arch: windows/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.5
API version: 1.40 (minimum version 1.12)
Go version: go1.12.12
Git commit: 633a0ea838
Built: Wed Nov 13 07:28:45 2019
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.2.10
GitCommit: b34a5c8af56e510852c35414db4c1f4fa6172339
runc:
Version: 1.0.0-rc8+dev
GitCommit: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
docker-init:
Version: 0.18.0
GitCommit: fec3683
This has happened a few times for me on Windows 10 with VirtualBox 5.0.14.
It seems to be related with not shutting down VirtualBox correctly (I believe) - for example, a power cut!
Shutdown the Docker VM
Close Kitematic
Start the Docker Quickstart Terminal
Type in the terminal:
docker-machine.exe -D ls
Start Kitematic. VM's show up now.
If that does not work, try 1-3 again and this time try to regenerate
certs. Then do step 4.
One thing that is odd, is that in the terminal docker images does not list them but says it cannot connect to 127.0.0.1:2375 (but docker-machine ls shows the default machine running on 192.168.99.100:2376).
Just recreate the default machine, and then run
docker-machine env default
It works for me.
if you are using docker for windows(beta) follow this steps:
Disable the "DockerNAT" network adapter
Run the "Reset to factory defaults" via the taskbar / docker / settings / Reset to factory defaults"
On my non-virtual machine, I got same error. Below steps worked for me
Right click docker->Under Settings->General do you have Expose daemon on tcp://localhost:2375 without TLS enabled? You need to if you want to access the daemon as described. But please do keep in mind that this setting is insecure as explained in the warning.
My issue was "...error getting IP address" Thanks to all the people here who have contributed their solutions which I read through and performed these steps:
Close Docker
Open VirtualBox Manager
Delete default VM
Start Kitematic first (I think this is important)
Start Docker

docker-machine install fails due to 'Couldn't read CA cert' error

I am trying to setup docker-machine locally on my Windows machine and I followed the install instructions at the Docker Machine Page.
Per the instructions, I ran the following commands in my bash terminal
To install Docker client binary
$curl -L https://github.com/docker/machine/releases/download/v0.3.0/docker-machine_windows-amd64.exe > /bin/docker-machine
and to install Docker machine binary
$ curl -L https://github.com/docker/machine/releases/download/v0.3.0/docker-machine_windows-amd64.exe > /bin/docker-machine
when I try to run docker-machine -v I get the following error
FATAL[0000] Couldn't read ca cert 'C:\Users\Me\.boot2docker\certs\boot2doker-vm\ca.pm: open 'C:\Users\Me\.boot2docker\certs\boot2docker-vm'\ca.pem: The filename, directory name, or volume label syntax is incorrect.
I did some searching and came across a few posts, but can't really see any connection to what would be causing my issues...
https://github.com/hypriot/kitematic/pull/1
https://github.com/docker/machine/issues/908
I installed docker machine today on my Windows 7 machine and run the command without any problem.
Did you use boot2docker before on your machine? If you did, it might be related as mine is a clean machine without any pre-existing docker installations.
Its referring to boot2docker environment.
see this:
DOCKER_CERT_PATH="/Users//.docker/machine/machines/dev"
I got the same answer and was able to resolve it by changing the path pattern to be unix-style in the environment variable.
Inside msysgit bash shell:
export DOCKER_CERT_PATH=/C/Users/Me/.boot2docker/certs/boot2docker-vm
This resolved boot2docker.
Note that I also tried using docker-machine before using boot2docker which previously failed with the same error. That was not resolved the same way boot2docker could be resolved. For now only boot2docker is working for me.

Resources