pecigonzalo / docker-machine-vmwareworkstation

VMWare Workstation driver for Docker Machine https://github.com/docker/machine
Apache License 2.0
363 stars 67 forks source link

vmware not starting #37

Closed drschlaumeier closed 7 years ago

drschlaumeier commented 7 years ago

Hallo,

I tried to run docker toolbox together with vmware 11.

I did the following

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.

pecigonzalo commented 7 years ago

@drschlaumeier how are you? I have some questions before I can help you:

Let's first focus on getting docker-machine to work, then we can worry about docker-toolbox.

drschlaumeier commented 7 years ago

Hallo pecigonzalo, i'm fine. ...trying to learn more about docker :-)

Could you provide DEBUG logs? --> How do I produce debug logs? With --debug option? Why did you change the PATH? --> Because I'm getting "bash: vmrun.exe: command not found" in Docker Quickstart Terminal. --> If I change from /mnt/c/ to /c/ the error disappears What console are you executing this from? (cmd, powershell, msys/cygwin) --> I start the Docker Quickstart Terminal. i suppose it uses windows cmd shell. --> If I execute manually docker-machine, I'm using normal windows cmd shell.

Many thanks for your help DRS

pecigonzalo commented 7 years ago

To run with debug logs you need to do

docker-machine --debug <THE REST OF YOUR COMMAND>

Interesting about the path, maybe they changed the mount location, could you verify? If that is the case, ill update the docs.

drschlaumeier commented 7 years ago

OK, I deleted the .docker directory with all machines etc. Than I called "docker-machine.exe --debug create --driver=vmwareworkstation dev" from windows cmd promt in Docker Toolbox install directory. Interestingly, this time the vmx did start but still cannot connect. I checked with "vmrun.exe list" I did not do anything different except that I cleaned the .docker directory. Enclose please find the log

Docker Machine Version:  0.8.2, build e18a919
Found binary path at docker-machine-driver-vmwareworkstation.exe
Launching plugin server for driver vmwareworkstation
Plugin server listening at address 127.0.0.1:62325
() 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 docker-machine-driver-vmwareworkstation.exe
Launching plugin server for driver vmwareworkstation
Plugin server listening at address 127.0.0.1:62329
() Calling .GetVersion
Using API Version  1
() Calling .SetConfigRaw
() Calling .GetMachineName
(dev) Calling .GetMachineName
(dev) Calling .DriverName
(dev) Calling .GetCreateFlags
(dev) Calling .SetConfigFromFlags
Creating CA: C:\Users\drs\.docker\machine\certs\ca.pem
Creating client certificate: C:\Users\drs\.docker\machine\certs\cert.pem
Running pre-create checks...
(dev) Calling .PreCreateCheck
(dev) Image cache directory does not exist, creating it at C:\Users\drs\.docker\machine\cache...
(dev) No default Boot2Docker ISO found locally, downloading the latest release...
(dev) Latest release for github.com/boot2docker/boot2docker is v1.13.0
(dev) Downloading C:\Users\drs\.docker\machine\cache\boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v1.13.0/bo
ot2docker.iso...
(dev) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
(dev) Calling .GetConfigRaw
Creating machine...
(dev) Calling .Create
(dev) DBG | local Boot2Docker ISO version:  v1.13.0
(dev) Copying C:\Users\drs\.docker\machine\cache\boot2docker.iso to C:\Users\drs\.docker\machine\machines\dev\boot2docker.iso...
(dev) Creating SSH key...
(dev) Creating VM...
(dev) DBG | VixDiskLib: Invalid configuration file parameter. Failed to read configuration file.
(dev) Creating disk 'C:\Users\drs\.docker\machine\machines\dev\dev.vmdk'
(dev) Virtual disk creation successful.
(dev) Starting dev...
(dev) DBG | executing: C:/Program Files (x86)/VMware/VMware Workstation/vmrun.exe start C:\Users\drs\.docker\machine\machines\dev\dev.vmx nogui
(dev) Waiting for VM to come online...
(dev) DBG | MAC address in VMX: 00:0c:29:f3:6c:a2
(dev) DBG | Not there yet 1/60, error: IP not found for MAC 00:0c:29:f3:6c:a2 in DHCP leases
(dev) DBG | MAC address in VMX: 00:0c:29:f3:6c:a2
(dev) DBG | Not there yet 2/60, error: IP not found for MAC 00:0c:29:f3:6c:a2 in DHCP leases
(dev) DBG | MAC address in VMX: 00:0c:29:f3:6c:a2
(dev) DBG | Not there yet 3/60, error: IP not found for MAC 00:0c:29:f3:6c:a2 in DHCP leases
***
(dev) DBG | Not there yet 59/60, error: IP not found for MAC 00:0c:29:f3:6c:a2 in DHCP leases
(dev) DBG | MAC address in VMX: 00:0c:29:f3:6c:a2
(dev) DBG | Not there yet 60/60, error: IP not found for MAC 00:0c:29:f3:6c:a2 in DHCP leases
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]
pecigonzalo commented 7 years ago

@drschlaumeier Can you confirm you have an IP on the VM? (by using the VMware console, you can add the machine by adding the VMX file on VMWare Workstation)

drschlaumeier commented 7 years ago

@pecigonzalo, you are right...the boot2docker image has no ip. If I start the vmx in vmware, there is no ip address for eth0 00:0c:29:f3:6c:a2. No idea why. There is another network called docker0 with IP 172.17.0.1

Any idea?

drschlaumeier commented 7 years ago

Ahhh, I think I know whats the problem:

The vmx is configured for NAT. The vmx does not receive the IP. No Idea why.

If I configure for Bridged, than I receive IPv6 address. However, my entire network is IP 4 based. All IP6 is disabled. No Idea why/where boot2docker image gets a IP6 address.

drschlaumeier commented 7 years ago

After researching a bit: I believe the problem lies in my machine is managed by company admin. The internet sharing connection of LAN/WIFI card has been disabled by admin....so, no NAT available. I could use bridge mode but the start.sh script is overwrting the VMX settings everytime ??? I tested bridge mode manually in VM console which was working, I mean I got IP in VM.

pecigonzalo commented 7 years ago

Yeah, that seems likely. When start.sh runs, the VMX that we the driver generates overwrites the one you modify. Ill submit a PR over the weekend to add the option to use Bridge mode.

drschlaumeier commented 7 years ago

@pecigonzalo Hold on...I believe that there will be still a problem with bridge mode. docker-machine searches for local dhcp leases (probably with ipconfig /all) but in bridge mode the VM receives IP from external DHCP router. So the error will still exist

(dev) DBG | MAC address in VMX: 00:0c:29:f3:6c:a2
(dev) DBG | Not there yet 2/60, error: IP not found for MAC 00:0c:29:f3:6c:a2 in DHCP leases

The mac 00:0c:29:f3:6c:a2 is only inside the VM and windows host does not see it. Instead it sees the mac mapped by "VMware Network Adapter VMnetx" which is different.

There are probable solutions for that:

EDIT: In addition, It would be good to have additional option to prevent overwriting the VMX

drschlaumeier commented 7 years ago

@pecigonzalo Sorry, you can close that issue. I reinstalled vmware workstation and it solved all my issues. Maybe I messed up something with the network adaper. Also the start.sh script works now.

Many thanks for the help.

I will open new question regarding kitematic.

pecigonzalo commented 7 years ago

Thanks for reporting back. This is great news :D

VAllens commented 7 years ago

Hi, all. Each time the “Docker Quickstart Terminal” is executed, the "default" instance is recreated and the previous "default" instance is covered. Can you tell me why?

pecigonzalo commented 7 years ago

@VAllens Please open a new issue for that as its not related to this and provide a description of the issue.

VAllens commented 7 years ago

@pecigonzalo fine, look issue : https://github.com/pecigonzalo/docker-machine-vmwareworkstation/issues/49

WheelmanK commented 6 years ago

I realize this is a relatively old topic and is reported as being resolved but I wanted to add some information that might prove useful to others with the same problem. I fought with the exact same issue reported by the OP and after reading this thread realized I had deleted one of the virtual networks that's installed as part of a default Workstation installation. The critical virtual net is installed as VMNet8 and is configured to use NAT. After reading this thread I examined the VMware virtual nets using the Virtual Network Editor and finding none configured to use NAT I added VMNet8 back in and configured it to use NAT with the same defaults a standard Workstation install uses. After performing these steps I deleted the partially installed boot2docker VM and created a new copy of it. This time everything worked as expected. Another option is to reset the virtual network configurations back to the defaults using the Virtual Network Editor and then recreate the "default" Docker machine.