I ran the command, brew services start docker-machine
.
It says, "Successfully started docker-machine
". But, I got error when I ran docker ps -a
. Please help.
brew services start docker-machine
==> Tapping homebrew/services
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services'...
remote: Enumerating objects: 1488, done.
remote: Counting objects: 100% (367/367), done.
remote: Compressing objects: 100% (266/266), done.
remote: Total 1488 (delta 148), reused 267 (delta 93), pack-reused 1121
Receiving objects: 100% (1488/1488), 437.97 KiB | 3.04 MiB/s, done.
Resolving deltas: 100% (624/624), done.
Tapped 1 command (38 files, 540.5KB).
==> Successfully started `docker-machine` (label: homebrew.mxcl.docker-machine)
% docker ps -a
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
docker-machine create --driver virtualbox default
gives me the following errors:
docker-machine create --driver virtualbox default
Running pre-create checks...
(default) Image cache directory does not exist, creating it at /Users/perryluo/.docker/machine/cache...
(default) No default Boot2Docker ISO found locally, downloading the latest release...
(default) Latest release for github.com/boot2docker/boot2docker is v19.03.12
(default) Downloading /Users/perryluo/.docker/machine/cache/boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v19.03.12/boot2docker.iso...
(default) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
Creating machine...
(default) Copying /Users/perryluo/.docker/machine/cache/boot2docker.iso to /Users/perryluo/.docker/machine/machines/default/boot2docker.iso...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
(default) Starting the VM...
(default) Check network to re-create if needed...
(default) Found a new host-only adapter: "vboxnet0"
Error creating machine: Error in driver during machine creation: Error setting up host only network on machine start: /usr/local/bin/VBoxManage hostonlyif ipconfig vboxnet0 --ip 192.168.99.1 --netmask 255.255.255.0 failed:
VBoxManage: error: Code E_ACCESSDENIED (0x80070005) - Access denied (extended info not available)
VBoxManage: error: Context: "EnableStaticIPConfig(Bstr(pszIp).raw(), Bstr(pszNetmask).raw())" at line 242 of file VBoxManageHostonly.cpp
$ sudo docker-machine create --driver virtualbox default
Docker machine "default" already exists
$ docker-machine stop default
Stopping "default"...
Machine "default" is already stopped.
$ docker-machine start default
Starting "default"...
(default) Check network to re-create if needed...
(default) Found a new host-only adapter: "vboxnet2"
Error setting up host only network on machine start: /usr/local/bin/VBoxManage hostonlyif ipconfig vboxnet2 --ip 192.168.99.1 --netmask 255.255.255.0 failed:
VBoxManage: error: Code E_ACCESSDENIED (0x80070005) - Access denied (extended info not available)
VBoxManage: error: Context: "EnableStaticIPConfig(Bstr(pszIp).raw(), Bstr(pszNetmask).raw())" at line 242 of file VBoxManageHostonly.cpp
$ docker-machine env default
Error checking TLS connection: Host is not running
Same problem here. I have found that docker-machine
is trying to move its HostOnly
network
to 192.168.99.1/24
. This is outside the range VirtualBox allows on MacOS.
See https://www.virtualbox.org/manual/ch06.html#network_hostonly :
On Linux, Mac OS X and Solaris, Oracle VM VirtualBox will only allow IP addresses in the
192.168.56.0/21
range to be assigned to host-only adapters.
That range corresponds to 192.168.56.1
- 192.168.63.255
.
The solution that worked for me is:
docker-machine rm default
docker-machine create -d virtualbox --virtualbox-hostonly-cidr "192.168.63.1/24" default
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With