Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run "docker-machine create" in OS X?

Tags:

docker

macos

I started Docker and am now following the tutorial, but for all I know I couldn't run the docker-machine command on OS X.

The documentation states that you run the following command to create a local virtual machine:

docker-machine create --driver virtualbox manager

However, this command doesn't work in OS X (11.6), with the following error:

Running pre-create checks...
Error with pre-create check: "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path"

I tried to install the virtualbox; however, another page clearly states that you must not install it on your local machine:

VirtualBox prior to version 4.3.30 must NOT be installed (it is incompatible with Docker for Mac)

Note: If your system does not satisfy these requirements, you can install Docker Toolbox, which uses Oracle VirtualBox instead of HyperKit.

So I only installed Docker for Mac and not virtualbox. So what am I missing here? The example page says you can run the tutorial on OS X, so I wonder how I can proceed...

You can follow along and run this example using Docker for Mac, Docker for Windows or Docker for Linux.

like image 352
Blaszard Avatar asked Feb 07 '17 00:02

Blaszard


People also ask

Does Docker on macOS use a VM?

On MacOS, Docker is run using a Linux Virtual Machine and relies on sub-components: HyperKit, VPNKit, and DataKit to support its functionalities. The following is a writeup to enable the use of docker-machine as an alternate solution to start a VM with the docker components to get access to CLI.

What is Docker machine on Mac?

Docker Machine was the first approach to run Docker on either Mac or Windows. It is essentially a set of CLI tools that start a boot2docker virtual machine inside a provided hypervisor (like VirtualBox, Parallels, and VMWare).


1 Answers

I had the same issue today and resolved it by installing VirtualBox as an additional step after installing Docker for Mac (I did so with brew install --cask virtualbox)

I don't recall having to do the extra install previously, but maybe I already had VirtualBox already installed because of another tool (like Vagrant). Anyway, this is explained in the Docker Machine documentation:

If you are using Docker for Mac

Docker for Mac uses HyperKit, a lightweight macOS virtualization solution built on top of the Hypervisor.framework in macOS 10.10 Yosemite and higher.

Currently, there is no docker-machine create driver for HyperKit, so you will use virtualbox driver to create local machines. (See the Docker Machine driver for Oracle VirtualBox.) Note that you can run both HyperKit and Oracle VirtualBox on the same system. To learn more, see Docker for Mac vs. Docker Toolbox.

  • Make sure you have the latest VirtualBox correctly installed on your system (either as part of an earlier Toolbox install, or manual install).
like image 96
awolski Avatar answered Oct 14 '22 07:10

awolski