Machine: docker-machine:Error with pre-create check: “exit status 126”

Created on 2 Aug 2016  ·  11Comments  ·  Source: docker/machine

When I'm type the code sudo docker-machine create --driver virtualbox default to create a new virtual machine. It can not worked. Here is the info:

xxxMacBook-Pro:~ xxx$ docker --version
Docker version 1.12.0, build 8eab29e
xxxMacBook-Pro:~ xxx$ docker-machine --version
docker-machine version 0.8.0, build b85aac1
xxxMacBook-Pro:~ xxx$ sudo docker-machine create --driver virtualbox default
Running pre-create checks...
Error with pre-create check: "exit status 126"

Please help me to figure this out.

Most helpful comment

First install Virtualbox with brew cask install virtualbox; then go ahead to run your command.

All 11 comments

OSX 10.11

docker --version
Docker version 1.11.2, build b9f10c9
docker-machine --version
docker-machine version 0.7.0, build a650a40
docker-machine create --driver virtualbox default
Running pre-create checks...
Error with pre-create check: "exit status 126"

This error indicates that you don't have VirtualBox installed – this is an installation separate from Docker

Can docker-machine maybe produce something a little more descriptive? Maybe this is bikeshedding, but IMO a GH issue is not where I should have ended up when trying to figure out what was going on.

Hi all,

I hit this problem this morning. I think that this functionality can easily be added by modifying drivers/virtualbox/vbm.go and adding a check on the exit status in the function vbmOutErrRetry.

On macOS, if virtual box has been deleted from the applications directory but the command-line entry point remains in the installation point then there will be an exit status of 126. If the entry point does not exist (so no runnable program is found) then there will be an exist status of 127.

I would be happy to add this functionality today and submit a PR, if this is the approach we should take.

First install Virtualbox with brew cask install virtualbox; then go ahead to run your command.

Could be helpful to add a note to that exit code telling you to install something!

How has this not been fixed in 2+ years?

@biggzlar It has been fixed, it's a missing dependency. Check the comment of @borenho.

@Marthyn sorry, was essentially just venting and not expressing myself clearly. What I meant to say is: why is the error message still not descriptive at all (i.e. the most likely reason why this issue is still open).

@biggzlar Ah absolutely, the error message could be improved, but I'm sure there's a lot off issues they have to deal with and this would be a minor thing ;)

@Marthyn true... -_____-

Was this page helpful?
0 / 5 - 0 ratings