docker-machine: no machine name, no "default" exists
Asked Answered
F

6

54

I downloaded and installed Docker for Windows 1.12.1 which in turn installed the docker-machine and docker-compose. I did not install "Docker Toolbox" since its a duplicate of what was installed and my system meets the requirements.

Everything seems to work fine except for docker-machine, I'm running through a tutorial and when I run various docker-machine commands like "ip" or "env" I get the following message.

Error: No machine name(s) specified and no "default" machine exists.

So when I do a "docker-machine ls" there is nothing in the list even though I do have a Hyper-V docker machine installed and docker commands work fine.

C:\tmp>docker-machine ls
NAME   ACTIVE   DRIVER   STATE   URL   SWARM   DOCKER   ERRORS
C:\tmp>

Am I missing something here? Did I miss something in the documentation? If so can someone please point me in the right direction to fix this?

Thanks for any help,

Jim

Folk answered 10/10, 2016 at 20:16 Comment(0)
P
18

You don't need docker-machine to manage the Hyper-V virtual machine. In fact you can't unless you configure it explicitly to do so. If you want to see your IP use the Docker for Windows GUI.

The Docker team wants you to use Docker for Windows like a regular Docker in Linux and not have to bother with virtual machine stuff.

Docker-machine is included in the same way you can install in Linux. It is for managing machines in the cloud for example, or accessing a remote Docker Engine. For example in Linux you issue your Docker commands in a natural way, but you can also have a virtual machine with Docker and manage it using docker-machine in your host. Now in Windows it works in the same way.

Regards

Peneus answered 11/10, 2016 at 1:18 Comment(3)
This should mark as the answer . I installed docker on windows 10 and couldn't create virtual machine but containers still working. I was wondering why containers working without a default docker machinePock
I'm a bit confused, perhaps this information is out of date. I am able to create docker machines in hyper-v using docker-machine commands.Bandaid
In fact you can. The question and answer is related with managing the Docker for Windows VMs with docker-machine as was previously done with Docker Toolbox. If you explicit configure your docker-machine to use Hyper-V you will be able to use docker commands against it, in the same way you use VirtualBox or remote. The person who asked the question installed docker for windows which works as it, and tried to use docker-machine and got surprised when no machines were listed but the docker itself was workingPeneus
I
30

Docker Machine is a tool that lets you install Docker Engine on virtual hosts

Docker machine just like building docker on a Vm, so first you have to create a Vm, in your case:

docker-machine create default
Interne answered 11/10, 2016 at 2:27 Comment(0)
P
18

You don't need docker-machine to manage the Hyper-V virtual machine. In fact you can't unless you configure it explicitly to do so. If you want to see your IP use the Docker for Windows GUI.

The Docker team wants you to use Docker for Windows like a regular Docker in Linux and not have to bother with virtual machine stuff.

Docker-machine is included in the same way you can install in Linux. It is for managing machines in the cloud for example, or accessing a remote Docker Engine. For example in Linux you issue your Docker commands in a natural way, but you can also have a virtual machine with Docker and manage it using docker-machine in your host. Now in Windows it works in the same way.

Regards

Peneus answered 11/10, 2016 at 1:18 Comment(3)
This should mark as the answer . I installed docker on windows 10 and couldn't create virtual machine but containers still working. I was wondering why containers working without a default docker machinePock
I'm a bit confused, perhaps this information is out of date. I am able to create docker machines in hyper-v using docker-machine commands.Bandaid
In fact you can. The question and answer is related with managing the Docker for Windows VMs with docker-machine as was previously done with Docker Toolbox. If you explicit configure your docker-machine to use Hyper-V you will be able to use docker commands against it, in the same way you use VirtualBox or remote. The person who asked the question installed docker for windows which works as it, and tried to use docker-machine and got surprised when no machines were listed but the docker itself was workingPeneus
P
16

Documentation docker-machine create

docker-machine create --driver virtualbox dev

or

docker-machine create -d virtualbox \
    --engine-label foo=bar \
    --engine-label spam=eggs \
    --engine-storage-driver overlay \
    --engine-insecure-registry registry.myco.com \
    foobarmachine
Protestation answered 7/12, 2016 at 4:21 Comment(0)
G
5

Two steps to find the IP address of the Hypervisor machine:

Step #1: Open Hyper-Visor Manager on Windows, then select the "MobyLinuxVM" virtual machine.

Step #2: On the bottom middle of the Hyper-V Manager there is a small tab labelled "Networking", click it.

Step #3: Take note of the MAC Address.

Step #4: Open a command prompt and write ipconfig /all to figure out the IP address for this mac address.

If anyone finds a simpler way to do this please let me know.

Gibeonite answered 20/4, 2018 at 11:20 Comment(0)
R
2

You need to create the machine.

docker-machine create

or

docker-machine create mymachinename
Rafe answered 11/10, 2016 at 0:38 Comment(2)
Error with pre-create check: "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path"Aurangzeb
sudo apt install virtualbox-qt install virtual boxCirri
B
1

All other answers didn't help, until I restart the machine! It could also mean, some of the command have done or created something. And the restart has just finalised those.

Bowlin answered 22/10, 2018 at 11:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.