virtualbox: Hangs on Waiting for VM to start
Tried starting a VM via docker-machine start and it hung on:
INFO[0000] Waiting for VM to start...
Check the VirtualBox GUI and the VM state was aborted.
The underlying cause here was that my VM image was corrupted, but as a user I'd expect machine to be aware of this and provide an appropriate error message.
Hmm I haven't seen that before -- thanks for reporting. How were you able to tell it was corrupted?
I was guessing at "corrupted". On manual start of the VM from the virtualbox GUI it got mid-way through the boot process and then the state changed to "aborted". A little digging suggests it could be related to a bug in virtualbox....
Still, it would be great for machine to notify the user about these type of errors when they occur.
This happens in with boot2docker image also. If you stop the vm for the image and choose stop (instead of option sending signal to stop, it will show aborted and probably not restart from virtual machine or boot2docker cli. Recommended fix (and it worked for me) is simply rebooting windows or whatever os you are running boot2docker on. Hope this helps.
Same problem after installing from https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_darwin-amd64:
~ >docker-machine create --driver virtualbox dev
INFO[0000] Creating CA: /Users/sshaw/.docker/machine/certs/ca.pem
INFO[0000] Creating client certificate: /Users/sshaw/.docker/machine/certs/cert.pem
INFO[0001] Creating SSH key...
INFO[0001] Image cache does not exist, creating it at /Users/sshaw/.docker/machine/cache...
INFO[0001] No default boot2docker iso found locally, downloading the latest release...
INFO[0001] Downloading latest boot2docker release to /Users/sshaw/.docker/machine/cache/boot2docker.iso...
INFO[0024] Creating VirtualBox VM...
INFO[0034] Starting VirtualBox VM...
INFO[0035] Waiting for VM to start...
VBoxHeadless is running.
In my case opening VirtualBox shows the dev image as Running and the docker ASCII art + command prompt in the Preview section.
- OS X 10.9.5
- docker-machine 0.2.0
- VirtualBox 4.3.25 r98716
Also note that the aforementioned bug was supposed to be fixed in 4.3.24 but I was running 4.3.25. Tried with 4.3.26 too, same problem.
Same thing here I'm on
- OS X 10.9.5
- VirtualBox v4.3.26-r98988
- docker-machine 0.2.0 when running
docker-machine create --driver virtualbox mymachine
it hangs
@sshaw @DavideDelVecchio can you post the output of both VBoxManager list hostonlyifs and netstat -nr?
~ >VBoxManage list hostonlyifs
Name: vboxnet0
GUID: 786f6276-656e-4074-8000-0a0027000000
DHCP: Disabled
IPAddress: 192.168.99.1
NetworkMask: 255.255.255.0
IPV6Address:
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: 0a:00:27:00:00:00
MediumType: Ethernet
Status: Up
VBoxNetworkName: HostInterfaceNetworking-vboxnet0
~ >netstat -nr
Routing tables
Internet:
Destination Gateway Flags Refs Use Netif Expire
default 192.168.1.1 UGSc 25 1 en0
127 127.0.0.1 UCS 0 126 lo0
127.0.0.1 127.0.0.1 UH 2 1772668 lo0
127.94.0.1 127.94.0.1 UH 0 0 lo0
127.94.0.2 127.94.0.2 UH 0 0 lo0
192.168.1 link#4 UCS 1 0 en0
...
192.168.1.130 127.0.0.1 UHS 0 88 lo0
192.168.99 link#9 UC 1 0 vboxnet
Note that deleting the route and replacing it with:
route add -net 192.168.99 -interface vboxnet0
still results in a route to the interface vboxnet.
Maybe this is the problem?
I saw the same behaviour last night - I installed the latest VirtualBox from the official website, installed docker and docker-machine via brew, and it hung on "Waiting for VM to start". I didn't get a chance to try rebooting the machine.
I finally got it work this way I have previously installed Kitematic that hanged upon startup installed then docker-machine via brew and had "Waiting for VM to start" then removed all the VMs and installed docker-machine this way curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_darwin-amd64 > /usr/local/bin/docker-machine chmod +x /usr/local/bin/docker-machine docker-machine create --driver virtualbox mymachine I have all my route on interface on vboxnet as well
@sshaw thanks for the feedback. if the route (as shown in the table) is using vboxnet and not the vboxnet0 interface, this looks like the issue. i was able to reproduce this behavior by manually removing my routing entries. i'm not sure why this would be messed with -- are you using any VPN software by chance? @pugnascotia are you using vpn?
Nope, no VPN for me. I'll try to dig into this more.
@ehazlett yes, seems so but when I delete the route and do:
route add -net 192.168.99 -interface vboxnet0
The route gets added as vboxnet. Does this happen for you -or anyone else?
@sshaw the way i was to fix was to delete the route and then ifconfig vboxnet0 down and ifconfig vboxnet0 up. the route was back up and i was able to connect.
@sshaw ok this is a difference between OS X and Linux -- on Linux it shows as the exact name but on OS X i see it as vboxnet.
Ah yes, I thought you were testing on OS X too...
+1
@sshaw can confirm deleting vboxnet then adding the vboxnet0 results in vboxnet present, again
So before I added a VM via boot2docker
Internet:
Destination Gateway Flags Refs Use Netif Expire
default 192.168.0.1 UGSc 72 1 en1
127 127.0.0.1 UCS 0 0 lo0
127.0.0.1 127.0.0.1 UH 256 17176 lo0
169.254 link#5 UCS 0 0 en1
192.168.0 link#5 UCS 1 0 en1
192.168.0.1/32 link#5 UCS 1 0 en1
192.168.0.1 c4:27:95:b5:13:9 UHLWIir 74 24 en1 1141
192.168.0.15/32 link#5 UCS 0 0 en1
192.168.0.255 ff:ff:ff:ff:ff:ff UHLWbI 0 1 en1
192.168.99
and after...
Internet:
Destination Gateway Flags Refs Use Netif Expire
default 192.168.0.1 UGSc 34 7 en1
127 127.0.0.1 UCS 0 0 lo0
127.0.0.1 127.0.0.1 UH 3 21645 lo0
169.254 link#5 UCS 0 0 en1
192.168.0 link#5 UCS 0 0 en1
192.168.0.1/32 link#5 UCS 1 0 en1
192.168.0.1 c4:27:95:b5:13:9 UHLWIir 36 24 en1 383
192.168.0.15/32 link#5 UCS 0 0 en1
192.168.59 link#11 UC 1 0 vboxnet
192.168.59.103 8:0:27:bc:84:0 UHLWIi 1 19 vboxnet 1196
192.168.99 link#10 UCSc 1 0 vboxnet
The new 192.168.59.103 entry looks different to the 192.168.99
Hope this helps :+1:
Does anyone have a definitive explanation or solution to this? It's become an issue for me and I know so little about virtualbox and docker that I an unable proceed.