Running boot2docker
with the start
|info
|stop
|delete
arguments result in an error message:
snowch$ boot2docker start
error in run: Failed to get machine "boot2docker-vm": machine does not exist
snowch$ boot2docker info
error in run: Failed to get machine "boot2docker-vm": machine does not exist
snowch$ boot2docker stop
error in run: Failed to get machine "boot2docker-vm": machine does not exist
snowch$ boot2docker delete
error in run: Failed to get machine "boot2docker-vm": machine does not exist
The init
error was slightly different
snowch$ boot2docker init
error in run: Failed to initialize machine "boot2docker-vm": exit status 1
How can I fix this?
First execute the boot2docker application. This sets some variables, and creates the ~/.boot2docker directory. Once this is done, boot2docker up/down will work for you.
I had the same problem on my mac after restarting it. A restart of OS X made VirtualBox suspend all VMs (incl. boot2docker).
Opening VirtualBox and starting the suspended instance fixed the problem and I could reuse docker.
error in run: Failed to start machine "boot2docker-vm": exit status 1
// WARNING: this will delete all your images
rm -rfi ~/VirtualBox\ VMs/boot2docker-vm/
boot2docker init
boot2docker start
docker ps -a
The currently accepted answer to this question has you removing the boot2docker vm completely. That'll work, but it will also leave you without any of your docker cache or saved volume shares done through
vboxmanage sharedfolder add "boot2docker-vm" ...
That's obviously not ideal, especially if you're sharing a lot of volumes between your host system and your vm, or if your builds take a long time.
For me, the
error in run: Failed to get machine "boot2docker-vm": machine does not exist
appears on system restarts. VirtualBox is trying to be smart and "saves" the vm, which is a state boot2docker doesn't seem able to gracefully recover from. To fix this, go into VirtualBox, and power-down the vm. Then go back to boot2docker and runboot2docker up
. Now that the vm has been gracefully powered down, boot2docker should be able to bring it up just fine.