Code Monkey home page Code Monkey logo

docker-machine-vmwareworkstation's Introduction

Docker Machine VMware Workstation Driver

Join the chat at https://gitter.im/pecigonzalo/docker-machine-vmwareworkstation Windows Build Status

This plugin for Docker Machine creates Docker hosts locally on a VMware Workstation.

This is a placeholder and collaboration point to add a VMware workstation driver for Docker Machine. This driver reuses part of the code from the fusion driver bundled with Docker Machine (as both have the same executable) and includes additional code from Packer VMware driver to detect the location of the files on Windows systems.

This is still a work-in-progress (WIP). I'm working to add the functionality listed on the TODO list. Suggestions and contributions are welcome.

TODO

  • drivers/vmwareworkstation/workstation.go: Rework file for vmware workstation
  • add windows support
  • add cmd/machine-driver-vmwareworkstation.go
  • Add Linux/OSX support
  • Add dhcplease file discovery on windows
  • Add tests cases
  • Create makefile
  • Add docs/drivers/vm-workstation.md

Requirements

Installation

The latest version of docker-machine-driver-vmwareworkstation binary is available on the "Releases" page.

Place the executable in the directory containing docker-machine.exe, or else add it to your $PATH.

Installing with Docker Toolbox

  1. Install Docker Toolbox without VirtualBox

    DockerToolbox-.exe /COMPONENTS="Docker,DockerMachine"

  2. Replace contents of C:\Program Files\Docker Toolbox\start.sh with this script.

    #!/bin/bash
    
    export PATH="$PATH:/mnt/c/Program Files (x86)/VMware/VMware Workstation"
    
    trap '[ "$?" -eq 0 ] || read -p "Looks like something went wrong in step ´$STEP´... Press any key to continue..."' EXIT
    
    VM=${DOCKER_MACHINE_NAME-default}
    DOCKER_MACHINE=./docker-machine.exe
    
    BLUE='\033[1;34m'
    GREEN='\033[0;32m'
    NC='\033[0m'
    
    
    if [ ! -f "${DOCKER_MACHINE}" ]; then
      echo "Docker Machine is not installed. Please re-run the Toolbox Installer and try again."
      exit 1
    fi
    
    vmrun.exe list | grep \""${VM}"\" &> /dev/null
    VM_EXISTS_CODE=$?
    
    set -e
    
    STEP="Checking if machine $VM exists"
    if [ $VM_EXISTS_CODE -eq 1 ]; then
      "${DOCKER_MACHINE}" rm -f "${VM}" &> /dev/null || :
      rm -rf ~/.docker/machine/machines/"${VM}"
      #set proxy variables if they exists
      if [ -n ${HTTP_PROXY+x} ]; then
        PROXY_ENV="$PROXY_ENV --engine-env HTTP_PROXY=$HTTP_PROXY"
      fi
      if [ -n ${HTTPS_PROXY+x} ]; then
        PROXY_ENV="$PROXY_ENV --engine-env HTTPS_PROXY=$HTTPS_PROXY"
      fi
      if [ -n ${NO_PROXY+x} ]; then
        PROXY_ENV="$PROXY_ENV --engine-env NO_PROXY=$NO_PROXY"
      fi  
      "${DOCKER_MACHINE}" create -d vmwareworkstation $PROXY_ENV "${VM}"
    fi
    
    STEP="Checking status on $VM"
    VM_STATUS="$(${DOCKER_MACHINE} status ${VM} 2>&1)"
    if [ "${VM_STATUS}" != "Running" ]; then
      "${DOCKER_MACHINE}" start "${VM}"
      yes | "${DOCKER_MACHINE}" regenerate-certs "${VM}"
    fi
    
    STEP="Setting env"
    eval "$(${DOCKER_MACHINE} env --shell=bash ${VM})"
    
    STEP="Finalize"
    clear
    cat << EOF
    
    
                            ##         .
                      ## ## ##        ==
                   ## ## ## ## ##    ===
               /"""""""""""""""""\___/ ===
          ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
               \______ o           __/
                 \    \         __/
                  \____\_______/
    
    EOF
    echo -e "${BLUE}docker${NC} is configured to use the ${GREEN}${VM}${NC} machine with IP ${GREEN}$(${DOCKER_MACHINE} ip ${VM})${NC}"
    echo "For help getting started, check out the docs at https://docs.docker.com"
    echo
    cd
    
    docker () {
      MSYS_NO_PATHCONV=1 docker.exe "$@"
    }
    export -f docker
    
    if [ $# -eq 0 ]; then
      echo "Start interactive shell"
      exec "$BASH" --login -i
    else
      echo "Start shell with command"
      exec "$BASH" -c "$*"
    fi
    

    Credit for the above script to @gtirloni

Usage

Official documentation for Docker Machine is available here.

To create a VMware Workstation based Docker machine, just run this command:

$ docker-machine create --driver=vmwareworkstation dev

Options

  • --vmwareworkstation-boot2docker-url: The URL of the Boot2Docker image.
  • --vmwareworkstation-disk-size: Size of disk for the host VM (in MB).
  • --vmwareworkstation-memory-size: Size of memory for the host VM (in MB).
  • --vmwareworkstation-cpu-count: Number of CPUs to use to create the VM (-1 to use the number of CPUs available).
  • --vmwareworkstation-ssh-user: SSH user
  • --vmwareworkstation-ssh-password: SSH password
  • --vmwareworkstation-no-share: Disable the mount of your home directory
  • --vmwareworkstation-share-folder: Mount the specified directory instead of the default home location. Format: name:dir
  • --vmwareworkstation-guest-share-link: Additional link to the shared mount in the guest

The --vmwareworkstation-boot2docker-url flag takes a few different forms. By default, if no value is specified for this flag, Machine checks locally for a Boot2Docker ISO. If one is found, that will be used as the ISO for the new machine. If one is not found, the latest ISO release available on boot2docker/boot2docker will be downloaded and stored locally for future use. Note that this means you must run docker-machine upgrade deliberately on a machine if you wish to update the "cached" Boot2Docker ISO.

This is the default behavior (when --vmwareworkstation-boot2docker-url=""), but the option also supports specifying ISOs by the http:// and file:// protocols.

Environment variables and default values:

CLI option Environment variable Default
--vmwareworkstation-boot2docker-url WORKSTATION_BOOT2DOCKER_URL Latest boot2docker url
--vmwareworkstation-cpu-count WORKSTATION_CPU_COUNT 1
--vmwareworkstation-disk-size WORKSTATION_DISK_SIZE 20000
--vmwareworkstation-memory-size WORKSTATION_MEMORY_SIZE 1024
--vmwareworkstation-ssh-user WORKSTATION_SSH_USER docker
--vmwareworkstation-ssh-password WORKSTATION_SSH_PASSWORD tcuser
--vmwareworkstation-no-share WORKSTATION_NO_SHARE false
--vmwareworkstation-share-folder WORKSTATION_SHARE_FOLDER Linux: /home Windows: C:\Users\
--vmwareworkstation-share-compat WORKSTATION_SHARE_COMPAT Windows: /c/Users

Development

Build from Source

If you wish to work on VMware Workstation Driver for Docker machine, you'll first need:

  • Go installed (version 1.6+ is required).

    • Make sure Go is properly installed, including setting up a GOPATH.
  • MSYS

    • Make We well need to use pacman to install make
  • Currently, the build only works on Windows (WIP to get it to work on other platforms)

To build the plugin executable binary, run these commands:

$ go get -d github.com/pecigonzalo/docker-machine-vmwareworkstation
$ cd $GOPATH/github.com/pecigonzalo/docker-machine-vmwareworkstation
$ make

The build creates the binary as bin/docker-machine-driver-vmwareworkstation. If you want, copy it to ${GOPATH}/bin/.

Authors

Credits

docker-machine-vmwareworkstation's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-machine-vmwareworkstation's Issues

Is this plugin support an windows7 32bit ?

i'm using an windows7 (32bit)
is this plugin support an windows7 32bit ?
if no so, are there other ways to working?

C:\Users\Nils> docker-machine.exe create --driver=vmwareworkstation DockerHostVM
Error starting plugin binary: fork/exec C:\Windows\docker-machine-driver-vmwareworkstation.exe: 
This version of %1 is not compatible with the version of Windows you're running. 
Check your computer's system information to see 
whether you need a x86 (32-bit) or x64 (64-bit) version of the program, 
and then contact the software publisher.
Error attempting to get plugin server address for RPC: Failed to dial the plugin server in 10s

what ‘s wrong

C:\Users\Administrator>docker-machine create --driver=vmwareworkstation dev
Error starting plugin binary: open NUL: The system cannot find the file specified.
Error attempting to get plugin server address for RPC: Failed to dial the plugin server in 10s

Docker Host VM re-deployed if the VM is not running.

vmrun list only lists running VMs. It cannot detect if a Docker Host VM is existing but stopped.

So, if the Docker Host VM is not configured as a autostart shared VM, after a system reboot, Docker Host VM will be re-deployed.

vmware not starting

Hallo,

I tried to run docker toolbox together with vmware 11.

I did the following

  • installed docker toolbox without virtualbox
  • copied docker-machine-driver-vmwareworkstation.exe
  • copied start.sh
  • in start .sh changed export PATH="$PATH:/mnt/c/Program Files (x86)/VMware/VMware Workstation"
    to export PATH="$PATH:/c/Program Files (x86)/VMware/VMware Workstation"

However, it failed during creation since it did not start the default.vmx. The default VM was created.
Error message is "Error creating machine: Error in driver during machine creation: Machine didn't return an IP after 120 seconds, aborting"
If I start manually "docker-machine.exe create --driver=vmwareworkstation dev" than same issue.
Machines are created but did not start.

The "docker-machine.exe start dev" fails with endless "Starting "dev"..."

If I run manually "vmrun.exe start dev.vmx" it starts the VM but above command fails with "Too many retries waiting for SSH to be available. Last error: Maximum number of retries (60) exceeded"

Please Help! What is wrong?

EDIT: "docker-machine.exe stop dev" works and shutdowns the VM.

Machine didn't return an IP after 120 seconds, aborting

Hi I just tried this setup but I can't seem to get it working.

History:

docker-machine create --driver=vmwareworkstation dev
Running pre-create checks...
Creating machine...
(dev) Copying C:\Users\niels\.docker\machine\cache\boot2docker.iso to C:\Users\niels\.docker\machine\machines\dev\boot2docker.iso...
(dev) Creating SSH key...
(dev) Creating VM...
(dev) Creating disk 'C:\Users\niels\.docker\machine\machines\dev\dev.vmdk'
(dev) Virtual disk creation successful.
(dev) Starting dev...
(dev) Waiting for VM to come online...
Error creating machine: Error in driver during machine creation: Machine didn't return an IP after 120 seconds, aborting

Versions:

docker --version
Docker version 1.12.1, build 23cf638
docker-compose --version
docker-compose version 1.8.0, build d988a55
docker-machine --version
docker-machine.exe version 0.8.1, build 41b3b25
VMWare workstation: 12.5.0 build-4352439

You probably want some extra debugging output, but how do I get this? I tried running this with a --debug flag, but that gave me:

docker-machine create --driver=vmwareworkstation dev --debug
Docker Machine Version:  0.8.1, build 41b3b25
Found binary path at C:\Program Files\Docker Toolbox\docker-machine-driver-vmwareworkstation.exe
Launching plugin server for driver vmwareworkstation
Plugin server listening at address 127.0.0.1:51102
() Calling .GetVersion
Using API Version  1
() Calling .SetConfigRaw
() Calling .GetMachineName
(flag-lookup) Calling .GetMachineName
(flag-lookup) Calling .DriverName
(flag-lookup) Calling .GetCreateFlags
Invalid command line. Found extra arguments [--debug]

Connection deny when trying to connect to container with postgres, get boot2docker IP

Hello everyone,

After I start a container with

docker run -p 5432:5432 --name postgres -e POSTGRES_PASSWORD=admin -e POSTGRES_USER=admin -e POSTGRES_DB=postgres -d postgres

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
32e99cf9ca64 postgres "docker-entrypoint.s…" 5 days ago Up 8 minutes 0.0.0.0:5432->5432/tcp postgres

But when I try to connect on localhost, I`m getting a connection refused. I saw that the boot2docker image is able to be managed but there is an option only for Virtualbox. I have look at this tutorial.
How can I get boot2docker IP?

[v1.0.0] ssh key not being created

docker-machine : v0.7.0
docker-machine-vmwareworkstation: v 1.0.0
VMWare Workstation: Licensed v 10.0.7
Windows 7 64-bit

VM is created and started but server.pem ssh key is never created. Rand create with --debug and nothing was output in regards to the ssh key. Keep receiving message, waiting on ssh service. Below is the full output of the log.

Start interactive shell

me@mymachine MINGW64 ~
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default * virtualbox Running tcp://192.168.99.100:2376 v1.11.1

me@mymachine MINGW64 ~
$ docker-machine --debug create --driver=vmwareworkstation dev
Docker Machine Version: 0.7.0, build a650a40
Found binary path at X:\Programs\Docker Toolbox\docker-machine-driver-vmwareworkstation.exe
Launching plugin server for driver vmwareworkstation
Plugin server listening at address 127.0.0.1:26935
() Calling .GetVersion
Using API Version 1
() Calling .SetConfigRaw
() Calling .GetMachineName
(flag-lookup) Calling .GetMachineName
(flag-lookup) Calling .DriverName
(flag-lookup) Calling .GetCreateFlags
Found binary path at X:\Programs\Docker Toolbox\docker-machine-driver-vmwareworkstation.exe
Launching plugin server for driver vmwareworkstation
Plugin server listening at address 127.0.0.1:26939
() Calling .GetVersion
Using API Version 1
() Calling .SetConfigRaw
() Calling .GetMachineName
(dev) Calling .GetMachineName
(dev) Calling .DriverName
(dev) Calling .GetCreateFlags
(dev) Calling .SetConfigFromFlags
Running pre-create checks...
(dev) Calling .PreCreateCheck
(dev) DBG | local Boot2Docker ISO version: v1.11.1
(dev) Calling .GetConfigRaw
Creating machine...
(dev) Calling .Create
(dev) DBG | local Boot2Docker ISO version: v1.11.1
(dev) Copying X:\myhome.docker\machine\cache\boot2docker.iso to X:\myhome.docker\machine\machines\dev\boot2docker.iso...
(dev) Creating SSH key...
(dev) Creating VM...
(dev) Creating disk 'X:\myhome.docker\machine\machines\dev\dev.vmdk'
(dev) DBG | VixDiskLib: Invalid configuration file parameter. Failed to read configuration file.
(dev) Virtual disk creation successful.
(dev) Starting dev...
(dev) DBG | executing: X:/Programs/VMware/VMware Workstation/vmrun.exe start X:\myhome.docker\machine\machines\dev\dev.vmx nogui
(dev) Waiting for VM to come online...
(dev) DBG | MAC address in VMX: 00:0c:29:e5:84:5c
(dev) DBG | IP found in DHCP lease table: 192.168.204.130
(dev) DBG | Got an ip: 192.168.204.130
(dev) DBG | SSH Daemon not responding yet: dial tcp 192.168.204.130:22: ConnectEx tcp: i/o timeout
.......
(dev) DBG | MAC address in VMX: 00:0c:29:e5:84:5c
(dev) DBG | IP found in DHCP lease table: 192.168.204.130
(dev) DBG | Got an ip: 192.168.204.130
(dev) DBG | SSH Daemon not responding yet: dial tcp 192.168.204.130:22: ConnectEx tcp: i/o timeout

me@mymachine MINGW64 ~
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default * virtualbox Running tcp://192.168.99.100:2376 v1.11.1
dev - vmwareworkstation Running tcp://192.168.204.130:2376 Unknown Unable to query docker version: Unable to read TLS config: open X:\myhome.docker\machine\machines\dev\server.pem: The system cannot find the file
specified.

me@mymachine MINGW64 ~
$

Attempted regenerate certs and still no go:

Docker Machine Version: 0.7.0, build a650a40
Regenerate TLS machine certs? Warning: this is irreversible. (y/n): y
Regenerating TLS certificates
Found binary path at X:\Programs\Docker Toolbox\docker-machine-driver-vmwareworkstation.exe
Launching plugin server for driver vmwareworkstation
Plugin server listening at address 127.0.0.1:27467
() Calling .GetVersion
Using API Version 1
() Calling .SetConfigRaw
() Calling .GetMachineName
command=configureAuth machine=dev
Waiting for SSH to be available...
Getting to WaitForSSH function...
(dev) Calling .GetSSHHostname
(dev) DBG | executing: X:/Programs/VMware/VMware Workstation/vmrun.exe list
(dev) DBG | MAC address in VMX: 00:0c:29:e5:84:5c
(dev) DBG | IP found in DHCP lease table: 192.168.204.130
(dev) Calling .GetSSHPort
(dev) Calling .GetSSHKeyPath
(dev) Calling .GetSSHKeyPath
(dev) Calling .GetSSHUsername
Using SSH client type: external
&{[-F /dev/null -o BatchMode=yes -o PasswordAuthentication=no -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o Co
titiesOnly=yes -i X:\myhome.docker\machine\machines\dev\id_rsa -p 22] C:\Program Files\Git\usr\bin\ssh.exe }
About to run SSH command:
exit 0
SSH cmd err, output: exit status 255:
Error getting ssh command 'exit 0' : Something went wrong running an SSH command!
command : exit 0
err : exit status 255
output :

Machine didn't return an IP after 120 seconds, aborting - even with HyperV disabled

Hi, guys,

I've tried all the approaches discussed previously and I'm still getting a "Machine didn't return an IP after 120 seconds, aborting". [The same was mentioned in #29 but any information there fixed my problem]

About what I've done:

docker --version
Docker version 17.03.0-ce, build 60ccb22

docker-compose --version
docker-compose version 1.11.2, build f963d76f

docker-machine --version
docker-machine.exe version 0.10.0, build 76ed2a6

VMware Workstation version: 12.5.7 build-5813279
After that as admin and as ordinary user I tried (the following command was executed with and without disk size):

docker-machine -D create --driver=vmwareworkstation --vmwareworkstation-disk-size 30000 dev

Docker Machine Version:  0.10.0, build 76ed2a6
Found binary path at C:\dev\docker-machine\docker-machine-driver-vmwareworkstation.exe
Launching plugin server for driver vmwareworkstation
Plugin server listening at address 127.0.0.1:50186
() DBG | Unable to read registry key SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\vmware.exe\Path
() DBG | Error finding VMware root: The system cannot find the file specified.
() DBG | File not found: 'vmrun.exe'
() DBG | Unable to read registry key SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\vmware.exe\Path
() DBG | Error finding VMware root: The system cannot find the file specified.
() DBG | File not found: 'vmware-vdiskmanager.exe'
() Calling .GetVersion
Using API Version  1
() Calling .SetConfigRaw
() Calling .GetMachineName
(flag-lookup) Calling .GetMachineName
(flag-lookup) Calling .DriverName
(flag-lookup) Calling .GetCreateFlags
Found binary path at C:\dev\docker-machine\docker-machine-driver-vmwareworkstation.exe
Launching plugin server for driver vmwareworkstation
Plugin server listening at address 127.0.0.1:50190
() DBG | Unable to read registry key SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\vmware.exe\Path
() DBG | Error finding VMware root: The system cannot find the file specified.
() DBG | File not found: 'vmrun.exe'
() DBG | Unable to read registry key SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\vmware.exe\Path
() DBG | Error finding VMware root: The system cannot find the file specified.
() DBG | File not found: 'vmware-vdiskmanager.exe'
() Calling .GetVersion
Using API Version  1
() Calling .SetConfigRaw
() Calling .GetMachineName
(dev) Calling .GetMachineName
(dev) Calling .DriverName
(dev) Calling .GetCreateFlags
(dev) Calling .SetConfigFromFlags
Running pre-create checks...
(dev) Calling .PreCreateCheck
(dev) DBG | local Boot2Docker ISO version:  v17.06.0-ce
(dev) Calling .GetConfigRaw
Creating machine...
(dev) Calling .Create
(dev) DBG | local Boot2Docker ISO version:  v17.06.0-ce
(dev) Copying C:\Users\fernando.barbeiro\.docker\machine\cache\boot2docker.iso to C:\Users\fernando.barbeiro\.docker\machine\machines\dev\boot2docker.iso...
(dev) Creating SSH key...
(dev) Creating VM...
(dev) Starting dev...
(dev) DBG | executing:  start C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx nogui
(dev) Waiting for VM to come online...
(dev) DBG | Not there yet 1/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 2/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 3/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 4/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 5/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 6/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 7/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 8/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 9/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 10/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 11/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 12/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 13/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 14/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 15/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 16/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 17/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 18/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 19/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 20/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 21/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 22/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 23/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 24/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 25/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 26/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 27/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 28/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 29/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 30/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 31/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 32/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 33/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 34/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 35/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 36/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 37/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 38/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 39/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 40/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 41/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 42/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 43/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 44/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 45/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 46/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 47/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 48/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 49/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 50/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 51/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 52/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 53/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 54/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 55/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 56/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 57/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 58/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 59/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
(dev) DBG | Not there yet 60/60, error: couldn't find MAC address in VMX file C:\Users\fernando.barbeiro\.docker\machine\machines\dev\dev.vmx
Error creating machine: Error in driver during machine creation: Machine didn't return an IP after 120 seconds, aborting
notifying bugsnag: [Error creating machine: Error in driver during machine creation: Machine didn't return an IP after 120 seconds, aborting]

As shown, the log Error finding VMware root: The system cannot find the file specified presents some info that could be useful. [Silly question] Could it related to the fact that VMWare is installed in a non-usual path?

Apart from that,

image

Hyper-V is disabled, so I don't think this could be causing much trouble as aforementioned in #29 .

The dev.vmx:

.encoding = "UTF-8"
config.version = "8"
displayName = "dev"
ethernet0.present = "TRUE"
ethernet0.connectionType = "nat"
ethernet0.virtualDev = "vmxnet3"
ethernet0.wakeOnPcktRcv = "FALSE"
ethernet0.addressType = "generated"
ethernet0.linkStatePropagation.enable = "TRUE"
pciBridge0.present = "TRUE"
pciBridge4.present = "TRUE"
pciBridge4.virtualDev = "pcieRootPort"
pciBridge4.functions = "8"
pciBridge5.present = "TRUE"
pciBridge5.virtualDev = "pcieRootPort"
pciBridge5.functions = "8"
pciBridge6.present = "TRUE"
pciBridge6.virtualDev = "pcieRootPort"
pciBridge6.functions = "8"
pciBridge7.present = "TRUE"
pciBridge7.virtualDev = "pcieRootPort"
pciBridge7.functions = "8"
pciBridge0.pciSlotNumber = "17"
pciBridge4.pciSlotNumber = "21"
pciBridge5.pciSlotNumber = "22"
pciBridge6.pciSlotNumber = "23"
pciBridge7.pciSlotNumber = "24"
scsi0.pciSlotNumber = "160"
usb.pciSlotNumber = "32"
ethernet0.pciSlotNumber = "192"
sound.pciSlotNumber = "33"
vmci0.pciSlotNumber = "35"
sata0.pciSlotNumber = "36"
floppy0.present = "FALSE"
guestOS = "other3xlinux-64"
hpet0.present = "TRUE"
sata0.present = "TRUE"
sata0:1.present = "TRUE"
sata0:1.fileName = "C:\Users\fernando.barbeiro\.docker\machine\machines\dev\boot2docker.iso"
sata0:1.deviceType = "cdrom-image"

vmci0.present = "TRUE"
mem.hotadd = "TRUE"
memsize = "1024"
powerType.powerOff = "soft"
powerType.powerOn = "soft"
powerType.reset = "soft"
powerType.suspend = "soft"
scsi0.present = "TRUE"
scsi0.virtualDev = "pvscsi"
scsi0:0.fileName = "dev.vmdk"
scsi0:0.present = "TRUE"
virtualHW.productCompatibility = "hosted"
virtualHW.version = "10"
msg.autoanswer = "TRUE"
uuid.action = "create"
numvcpus = "1"
hgfs.mapRootShare = "FALSE"
hgfs.linkRootShare = "FALSE"

P.S.: I reinstalled the whole environment in order to try to overcome this, but so far I'm not being capable to solve.
Any clue on this issue would be more than appreciated.

Thanks in advance,
Regards.
Fernando Barbeiro

Failed to run with Vmware Workstation 14

Virtual machine is created but do no run. (It do not appear in vmware gui)

C:\Users\giova.docker\machine\machines\dev\dev.vmx /bin/sh [ ! -d /Users ]&& sudo mkdir /Users;[ ! -d /c ]&& sudo mkdir -p /c;[ ! -d /c/Users ]&& sudo ln -s /Users /c/Users;[ -f /usr/local/bin/vmhgfs-fuse ]&& sudo /usr/local/bin/vmhgfs-fuse -o allow_other .host:/Users /Users || sudo mount -t vmhgfs .host:/Users /Users
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list
(dev) Calling .GetState
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe list

Documentation or example for Cloud-init usage?

Looking through the code, there's an option for specifying a cloud-init configuration. Judging from the rest of the code, it's not as simple as passing a cloudinit file and some of the setup, like mounting of shared drives, seems to be skipped if this parameter is specified.

I was wondering if there's any documentation on this feature or an example of a working configdrive? I've used cloudinit scripts to setup EC2 VMs on AWS, and it would be great if we could leverage cloud-init to setup our docker machine as well.

Regards,
Carlo

Merge with upstream?

First, thank you very much for working on this. It makes life more bearable for some of us using VMware.

I can report it worked great with VMware Workstation 12.1 on Windows 10 (AU).

Are you considering submitting this upstream to Docker?

Upload both 32/64bit binaries to GH releases

At the moment both 32bit and 64bit windows exefiles have the same name and so they will be overwritten in the github release step.

We should name the plugins like docker-machine itself https://github.com/docker/machine/releases

  • docker-machine-driver-vmwareworkstation_windows-386.exe
  • docker-machine-driver-vmwareworkstation_windows-amd64.exe

Proposal to update the appveyor.yml:

  - go build -i -o ./bin/docker-machine-driver-vmwareworkstation_windows-%GOARCH%.exe ./cmd/

# Deploy
artifacts:
  - path: bin/docker-machine-driver-vmwareworkstation_windows-%GOARCH%.exe

But for the artifact I'm not sure if %GOARCH% works here.

For the chocolatey package the name of the exe at the github releases is no problem, the choco installer can rename the plugin to its correct name.

And adding windows to the filename there is room for the linux version of this plugin ;-)

Disk not created

Hi,

I doesn't start as the default.wmdk disk is not created.
I am using the VMWare-Vix-1.6.2

Cdt,

SK

vmware player requires separate download for vmware-vdiskmanager.exe and the driver can't find it

https://my.vmware.com/group/vmware/get-download?downloadGroup=VDDK65

() DBG | Unable to read registry key SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\vmware.exe\Path
() DBG | Error finding VMware root: The system cannot find the file specified.
() DBG | File not found: 'vmrun.exe'
() DBG | Unable to read registry key SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\vmware.exe\Path
() DBG | Error finding VMware root: The system cannot find the file specified.
() Calling .GetVersion
() DBG | File not found: 'vmware-vdiskmanager.exe'
Using API Version 1
() Calling .SetConfigRaw
() Calling .GetMachineName
(flag-lookup) Calling .GetMachineName
(flag-lookup) Calling .DriverName
(flag-lookup) Calling .GetCreateFlags
Found binary path at docker-machine-driver-vmwareworkstation.exe
Launching plugin server for driver vmwareworkstation
Plugin server listening at address 127.0.0.1:50650
() DBG | Unable to read registry key SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\vmware.exe\Path
() DBG | Error finding VMware root: The system cannot find the file specified.
() DBG | File not found: 'vmrun.exe'
() DBG | Unable to read registry key SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\vmware.exe\Path
() DBG | Error finding VMware root: The system cannot find the file specified.
() DBG | File not found: 'vmware-vdiskmanager.exe'

the path detection logic needs improvement to accomodate vmware player which has the player, vmrun (from vmware VIX SDK) and vmware-vdiskmanager (from VDDK) all in different locations

vmrun.exe missing error

VMware workstation 12.5 pro doesn't include vmrun.exe anymore. You have to download and install the VIX API SDK (VMware-VIX-1.15.0-2985596.exe) from their website to get it. You then need another path entry on start.sh like below:

export PATH="$PATH:/c/Program Files (x86)/VMware/VMware Workstation:/c/Program Files (x86)/VMware/VMware VIX"

Cannot initiate docker machine in symlink path

OS: Windows 10 build 14393 x64
VMware Workstation Pro v12.5.2
docker-machine-vmwareworkstation v1.0.10

Using symlink for path C:\Users{USER}.docker\machine will get Error creating machine: Error waiting for machine to be running: Maximum number of retries (60) exceeded.

log

Improve error reporting when no NAT/DHCP based virtual network exists

I recently installed the docker-machine and vmware workstation driver using chocolatey and attempted to create a VM using the following command:

docker-machine --native-ssh create -d vmwareworkstation default

with the result being a VM that would not connect using SSH.
Consequently it was impossible to connect to the instance using docker commands

After running the process with debug enabled and doing research into other people reporting the same issue and that they accidently "fixed" it by reinstalling or resetting VMware Workstation I realized the issue stemmed from the fact I had deleted the default virtual network VMNet8 which is installed with Workstation.
VMNet8 is configured to use NAT and DHCP by default.

When this driver is used to create a new docker machine it sets up the workstation environment to use a NAT based virtual network and assumes DHCP is enabled. If a network with this configuration does not exist in the local VMware virtual network environment the setup of a new docker VM fails while waiting for SSH to connect.
The VM is created and will execute but it is impossible for docker to connect to it.

I request more thorough checking be performed on the VMware virtual network environment and if a network with the required setup is not present an error message be displayed informing the user of the discrepancy.
An alternative solution is to provide the ability to the user to specify the virtual network the driver should use when creating the VM instance.

Cannot create RancherOS machines

My Docker & Docker-Machine versions are:
docker --version:
Docker version 17.06.0-ce, build 02c1d87
docker-machine --version:
docker-machine.exe version 0.12.2, build 9371605
And when I try to create a RancherOS machine (as here says):
docker-machine create --driver "vmwareworkstation" --vmwareworkstation-boot2docker-url "https://releases.rancher.com/os/latest/rancheros.iso" rancheros
Its outputs are like these:
Running pre-create checks...
(rancheros) Boot2Docker URL was explicitly set to "https://releases.rancher.com/os/latest/rancheros.iso" at create time, so Docker Machine cannot upgrade this machine to the latest version.
Creating machine...
(rancheros) Boot2Docker URL was explicitly set to "https://releases.rancher.com/os/latest/rancheros.iso" at create time, so Docker Machine cannot upgrade this machine to the latest version.
(rancheros) Downloading C:\Users\SXY\.docker\machine\cache\boot2docker.iso from https://releases.rancher.com/os/latest/rancheros.iso...
(rancheros) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
(rancheros) Creating SSH key...
(rancheros) Creating VM...
(rancheros) Creating disk 'C:\Users\SXY\.docker\machine\machines\rancheros\rancheros.vmdk'
(rancheros) Virtual disk creation successful.
(rancheros) Starting rancheros...
(rancheros) Waiting for VM to come online...
It keeps waiting all the time and I have to Ctrl+C it.
So is there any resolutions? Or what should I do?

Unable connect to docker machine

OS: Windows 10 1511 x64
VMware v12

C:\Users\Fes\Downloads
λ DockerToolbox-1.12.0.exe /COMPONENTS="Docker,DockerMachine"

C:\Users\Fes\Downloads
λ docker-machine create --driver=vmwareworkstation dev
Running pre-create checks...
(dev) Default Boot2Docker ISO is out-of-date, downloading the latest release...
(dev) Latest release for github.com/boot2docker/boot2docker is v1.12.1
(dev) Downloading C:\Users\Fes\.docker\machine\cache\boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v1.12.1/boot2docker.iso...
(dev) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
Creating machine...
(dev) Copying C:\Users\Fes\.docker\machine\cache\boot2docker.iso to C:\Users\Fes\.docker\machine\machines\dev\boot2docker.iso...
(dev) Creating SSH key...
(dev) Creating VM...
(dev) Creating disk 'C:\Users\Fes\.docker\machine\machines\dev\dev.vmdk'
(dev) Virtual disk creation successful.
(dev) Starting dev...
(dev) Waiting for VM to come online...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Error creating machine: Error detecting OS: Too many retries waiting for SSH to be available.
  Last error: Maximum number of retries (60) exceeded

C:\Users\Fes\Downloads
λ dm ls
NAME   ACTIVE   DRIVER              STATE     URL                         SWARM   DOCKER    ERRORS
dev    -        vmwareworkstation   Running   tcp://192.168.30.129:2376           Unknown   Unable to query docker version: Get https://192.168.30.129:2376/v1.15/version: x509: certificate signed by unknown authority

shart.sh bug

1.Path error

export PATH="$PATH:/mnt/c/Program Files (x86)/VMware/VMware Workstation"
should be changed to
export PATH="$PATH:/c/Program Files (x86)/VMware/VMware Workstation"

2.Syntax error

vmrun.exe list | grep \""${VM}"\" &> /dev/null
should be changed to
vmrun.exe list | grep "${VM}" &> /dev/null

This full code:

    #!/bin/bash

    export PATH="$PATH:/c/Program Files (x86)/VMware/VMware Workstation"

    trap '[ "$?" -eq 0 ] || read -p "Looks like something went wrong in step ´$STEP´... Press any key to continue..."' EXIT

    VM=${DOCKER_MACHINE_NAME-default}
    DOCKER_MACHINE=./docker-machine.exe

    BLUE='\033[1;34m'
    GREEN='\033[0;32m'
    NC='\033[0m'


    if [ ! -f "${DOCKER_MACHINE}" ]; then
      echo "Docker Machine is not installed. Please re-run the Toolbox Installer and try again."
      exit 1
    fi

    vmrun.exe list | grep "${VM}" &> /dev/null
    VM_EXISTS_CODE=$?

    set -e

    STEP="Checking if machine $VM exists"
    if [ $VM_EXISTS_CODE -eq 1 ]; then
      "${DOCKER_MACHINE}" rm -f "${VM}" &> /dev/null || :
      rm -rf ~/.docker/machine/machines/"${VM}"
      #set proxy variables if they exists
      if [ -n ${HTTP_PROXY+x} ]; then
        PROXY_ENV="$PROXY_ENV --engine-env HTTP_PROXY=$HTTP_PROXY"
      fi
      if [ -n ${HTTPS_PROXY+x} ]; then
        PROXY_ENV="$PROXY_ENV --engine-env HTTPS_PROXY=$HTTPS_PROXY"
      fi
      if [ -n ${NO_PROXY+x} ]; then
        PROXY_ENV="$PROXY_ENV --engine-env NO_PROXY=$NO_PROXY"
      fi  
      "${DOCKER_MACHINE}" create -d vmwareworkstation $PROXY_ENV "${VM}"
    fi

    STEP="Checking status on $VM"
    VM_STATUS="$(${DOCKER_MACHINE} status ${VM} 2>&1)"
    if [ "${VM_STATUS}" != "Running" ]; then
      "${DOCKER_MACHINE}" start "${VM}"
      yes | "${DOCKER_MACHINE}" regenerate-certs "${VM}"
    fi

    STEP="Setting env"
    eval "$(${DOCKER_MACHINE} env --shell=bash ${VM})"

    STEP="Finalize"
    clear
    cat << EOF


                            ##         .
                      ## ## ##        ==
                   ## ## ## ## ##    ===
               /"""""""""""""""""\___/ ===
          ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
               \______ o           __/
                 \    \         __/
                  \____\_______/

    EOF
    echo -e "${BLUE}docker${NC} is configured to use the ${GREEN}${VM}${NC} machine with IP ${GREEN}$(${DOCKER_MACHINE} ip ${VM})${NC}"
    echo "For help getting started, check out the docs at https://docs.docker.com"
    echo
    cd

    docker () {
      MSYS_NO_PATHCONV=1 docker.exe "$@"
    }
    export -f docker

    if [ $# -eq 0 ]; then
      echo "Start interactive shell"
      exec "$BASH" --login -i
    else
      echo "Start shell with command"
      exec "$BASH" -c "$*"
    fi
    ```

Add mfsymlinks SMB option to support symlinks on bind mounted folder

Docker for Windows 1.12.1 has a new feature to allow mfsymlinks SMB option to support symlinks on bind mounted folder. This allows making sym links in linux when binding a linux guest volume to a windows host volume.

https://docs.docker.com/docker-for-windows/release-notes/#docker-for-windows-1121-2016-09-16-stable

Here is a discussion of the problem on the Docker forum before they added support in Docker for Windows: https://forums.docker.com/t/symlinks-on-shared-volumes-not-supported/9288/21

Can we get support for this in Docker Machine VMware?

Allow custom ip address and adapter type

Could you please add parameters to set the network connection type for the VM and also the ip address or hostname to utilize?

On my dev box the firewall is locked down on all adapters so I can't ping or ssh to the NAT device. I can trick it into finishing now by changing the VM to bridged and then manually set the ip address in the dhcp leases file.

Our dhcp server will always create a dns entry based on the hostname so I can use that in the start.sh if the additional driver parameters were added.

Unable to create machine with custom SSH user

λ docker-machine create --driver=vmwareworkstation --vmwareworkstation-disk-size 40000 --vmwarework station-ssh-user festum --vmwareworkstation-ssh-password mypassword --vmwareworkstation-memory-size 1536 vm0
Running pre-create checks...
Creating machine...
(f) Copying C:\Users\Festum\.docker\machine\cache\boot2docker.iso to C:\Users\Festum\.docker\machine\machines\f\boot2docker.iso...
(f) Creating SSH key...
(f) Creating VM...
(f) Creating disk 'C:\Users\Festum\.docker\machine\machines\f\f.vmdk'
(f) Virtual disk creation successful.
(f) Starting f...
(f) Waiting for VM to come online...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Error creating machine: Error detecting OS: Too many retries waiting for SSH to be available.  Last error: Maximum number of retries (60) exceeded

Trouble mounting a volume

Hi There,

We got your driver working out of the box on our Windows 8, VMWare Workstation 10.0.1 environment (which was awesome, BTW), but we are having trouble seeing our mounted volumes inside the container. The mount appears to be happening, but none of the files are appearing in the container FS.

Could this be an issues with VMWare Workstation and not your driver? When we inspect the image, the Mounts object is populated with our config, it's seems that the files simply aren't being shared.

Thanks for any help that you can provide.

about add parameter or environment variable "--engine-registry-mirror=my_url" problem

Hi, pecigonzalo.

Can I add some custom parameters (--engine-registry-mirror=my_url) after this sentence?

"${DOCKER_MACHINE}" create -d vmwareworkstation $PROXY_ENV "${VM}"

Samples

"${DOCKER_MACHINE}" create -d vmwareworkstation $PROXY_ENV "${VM}" --engine-registry-mirror=my_url

But I don't want to modify your start.sh code directly. I want to pass in external parameters. Do you have better suggestions?

Anyway, thank you so much.

How to get Kitematic running?

Hallo,
I installed Docker Toolbox together with Kitematic in order to automate the docker images.
However, Kitematic starts and drops error:
Error: connect ENOENT //./pipe/docker_engine

There is same error if I press RETRY.
If I press Use Virtualbox the error is

Virtualbox not installed. Please install it via the Docker Toolbox.

Any help is apprechiated.

Machine name issue (boot2docker vs default)

Thanks for this piece of software, it helped us a lot. I'm chasing an intermittent situation that might originate in this driver.

THE ENVIRONMENT

  • windows 7 x64, docker is installed and configured using this driver, our machine is called "default" and everything works, running 4 containers inside, using VMware Workstation 10 with default DHCP settings, manually configured some port forwarding rules
  • there is a startup batch file that calls the start.sh (.sh code copied from the vmwareworkstation driver readme): bash.exe --login -i start.sh docker login -u xx -p xx; docker-compose -f ~/xx/docker-compose.yml up -d

THE PROBLEM

  • sometimes after a system restart the start.sh gets stuck on docker-machine commands - last one "waiting for SSH"... it took quite some time to notice what's going on - docker cannot SSH to the machine, because VMnet8 network adapter has wrong IP address (169.254.x.x). Addresses from this range are used by Windows in case of network issues e.g. IP address conflict.
  • digging deeper, the VMware's DHCP table entries show that tere are 2 devices having the same mac address and IP, but different host name: one is called "default" and the other is called "boot2docker"

THE QUESTIONS
Now how did that happen? The start.sh uses $VM variable for setting the machine name. The variable is populated on this line: VM=${DOCKER_MACHINE_NAME-default}, meaning it's either the existing machine name from $DOCKER_MACHINE_NAME or "default".

There are 2 theories:

  1. there is a bug in the stack somewhere that would fill the docker machine name variable with "boot2docker" string - either docker-machine or this driver or the .sh script
  2. the name of the virtual machine is "boot2docker" initially and it gets replaced only later by some script, meaning our issues are based on random timing of the 2 events (setting the name and getting the address from DHCP)

Any ideas??

VM does not mount the Users directory

Similarly to #19, I'm seeing the docker host coming up without the /c/Users/ file share.

I'm running on Windows 10 Pro with
vmware workstation 12.1.1 build-3770994
docker-machine 0.7.0 and docker 1.11.1

On the docker host VM, I only see one vmhgfs mount:

$ mount | grep vm
vmhgfs-fuse on /mnt/hgfs type fuse.vmhgfs-fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)

The only command I've run at that point docker-machine create --driver vmwareworkstation default. On a previous attempt I created a container with a volume mount /c/Users/Jett:/testtest. It looks like that step can create the /c/Users/... path in the boot2docker VM.

This is (what I think is) the relevant part of the create debug output:

(default) DBG | Creating Tar key bundle...
(default) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe  directoryExistsInGuest C:\Users\Jett\.docker\machine\machines\default\default.vmx /var/lib/boot2docker
(default) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe  CopyFileFromHostToGuest C:\Users\Jett\.docker\machine\machines\default\default.vmx C:\Users\Jett\.docker\machine\machines\default\userdata.tar /home/docker/userdata.tar
(default) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe  runScriptInGuest C:\Users\Jett\.docker\machine\machines\default\default.vmx /bin/sh sudo /bin/mv /home/docker/userdata.tar /var/lib/boot2docker/userdata.tar && sudo tar xf /var/lib/boot2docker/userdata.tar -C /home/docker/ > /var/log/userdata.log 2>&1 && sudo chown -R docker:staff /home/docker
(default) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe  enableSharedFolders C:\Users\Jett\.docker\machine\machines\default\default.vmx
(default) Calling .GetConfigRaw
(default) Calling .DriverName
(default) Calling .DriverName
Waiting for machine to be running, this may take a few minutes...

when I run vmrun enableSharedFolders directly, it fails, saying an error occurred on the guest operating system. I'm not sure why the next step with vmhgfs-fuse is skipped though.

Anyway - that's as far as I got digging into the debug output from re-running docker-machine provision or docker-machine create. If there are other details that could help debug, let me know.

Thanks.

Windows 10 not share my home dir

Hi i used this with my vmware workstation and after it start the container when i ssh into the new machine i see that there is no mount of my host home directory.
VmWareworkstation version: 12.1.0 build-3272444
docker-machine: 0.5.6, build 61388e9 also tested it with 0.5.5
When using the virtualbox i got the home directory in my /c/Users

Mount location for the user home directory in the vm is not compatible with docker-compose

According to docker & docker-compose the default location for user directory in windows is /c/Users/ thus when you use from your host machine the docker-compose it converts the path to that /c/Users/ folder and by mount the volumes, now this docker-machine driver mounts it to /Users/ thus making it impossible to bymount a directory inside the docker container.

The existing virtualbox implementation for docker-machine here (https://github.com/docker/machine/blob/master/drivers/virtualbox/virtualbox_windows.go#L93-L95) uses this path for the user home mount.

Related docker documentation: https://docs.docker.com/engine/userguide/containers/dockervolumes/
Related issue #8

[v1.0.0] Default SSH user does not get created in the VM

Hi,

I've noticed that after creating a brand new Docker Machine using this driver, the specified default SSH user B2DUser does not get created in the virtual machine. Fortunately, user docker still does, so it doesn't appear to be that big of a problem.

Sorry if I'm confusing SSH users with some other kind of users.

Docker: 1.10.0
Docker Machine: 0.6.0
VMware® Workstation 12 Pro 12.1.0 build-3272444
OS: Windows 8

P.S. The driver works really well overall, great job!

Network adaptor not found: B2D 18.09 , Vmware W. Pro 15

Docker Machine Version: 0.14.0, build 89b8332
Boot2Docker: v18.09.0
VMWare: Workstation Pro 15
vmrun version 1.17.0 build-10737736

Steps to Reproduce:

docker-machine -D create --driver=vmwareworkstation vmware

Issue:

Timeout waiting for IP address

(vmware) DBG | MAC address in VMX: 00:0c:29:53:00:37
(vmware) DBG | Not there yet 58/60, error: IP not found for MAC 00:0c:29:53:00:37 in DHCP leases
(vmware) DBG | MAC address in VMX: 00:0c:29:53:00:37
(vmware) DBG | Not there yet 59/60, error: IP not found for MAC 00:0c:29:53:00:37 in DHCP leases

Root Cause:

NIC is missing:

image

Notes

Editing the generated VMX file and setting

ethernet0.virtualDev = "e1000"

Allows the machine to start and detect the network card.

Workstation version needed ?

Thx again for this nice piece of code, performances of virtualbox volumes on windows are aweful and VMWare workstation is far better !

I'm currently evaluating this driver with VMWare Workstation 12 Pro but the README file is not clear about which version of VMWare Workstation is needed ? (pro ? player ? free player ?).

Docker machine VM re-deployed every time.

In start.sh

vmrun.exe list | grep \""${VM}"\" &> /dev/null
VM_EXISTS_CODE=$?

There are duplicated " in grep \""${VM}"\" makes grep cannot match the host name.
Please correct it as grep $VM or grep "${VM}"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.