docker / machine

Machine management for a container-centric world
https://docs.docker.com/machine/
Apache License 2.0
6.63k stars 1.97k forks source link

Error creating machine: Error with pre-create check: VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path #4589

Open pdavis68 opened 6 years ago

pdavis68 commented 6 years ago

I'm running Ubuntu 18.04.1 LTS

I've installed VirtualBox 5.2. VBoxManage is in my path and I can run it no problem. But I get the above error message when I try to create a machine:

> sudo docker-machine create -d virtualbox ubuntu1
Running pre-create checks...
Error with pre-create check: "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path"

> vboxmanage
Oracle VM VirtualBox Command Line Management Interface Version 5.2.18
(C) 2005-2018 Oracle Corporation
All rights reserved.

Usage: ...

Am I doing something wrong?

pdavis68 commented 6 years ago

I ran it in debug mode. here's the log. Not a whole lot in terms of additional information:

Docker Machine Version:  0.15.0, build b48dc28
Found binary path at /snap/docker/321/bin/docker-machine
Launching plugin server for driver virtualbox
Plugin server listening at address 127.0.0.1:33913
() 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 /snap/docker/321/bin/docker-machine
Launching plugin server for driver virtualbox
Plugin server listening at address 127.0.0.1:37421
() Calling .GetVersion
Using API Version  1
() Calling .SetConfigRaw
() Calling .GetMachineName
(default) Calling .GetMachineName
(default) Calling .DriverName
(default) Calling .GetCreateFlags
(default) Calling .SetConfigFromFlags
Reading certificate data from /home/pete/snap/docker/321/.docker/machine/certs/ca.pem
Decoding PEM data...
Parsing certificate...
Reading certificate data from /home/pete/snap/docker/321/.docker/machine/certs/cert.pem
Decoding PEM data...
Parsing certificate...
Running pre-create checks...
(default) Calling .PreCreateCheck
(default) DBG | COMMAND: VBoxManage --version
(default) DBG | STDOUT:
(default) DBG | {
(default) DBG | }
(default) DBG | STDERR:
(default) DBG | {
(default) DBG | }
Error with pre-create check: "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path"
open /home/pete/snap/docker/321/.docker/machine/machines/default/default/Logs/VBox.log: no such file or directory
notifying bugsnag: [Error with pre-create check: "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path"]

Of course, I can run Vboxmanage --version no problem. It tells me: 5.2.18r124319

vboxmanage is in /usr/bin

running sudo cat /proc/979/environ | tr '\0' '\n' (979 is the dockerd pid) shows that the path is:

PATH=/snap/docker/321/usr/sbin:/snap/docker/321/usr/bin:/snap/docker/321/sbin:/snap/docker/321/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

So /usr/bin is there. Why can't docker find it?

atlep commented 6 years ago

I have the same problem. Any solution yet?

I've tried editing the target script of the symlink /usr/bin/VBoxManage -> /opt/VirtualBox/VBox.sh, and it doesn't seem to be executed at all.

Reading the code, I found this in machine/drivers/virtualbox/vbm.go, which seems related and OK:

func (v *VBoxCmdManager) vbmOutErrRetry(retry int, args ...string) (string, string, error) {
    cmd := exec.Command(vboxManageCmd, args...)
    log.Debugf("COMMAND: %v %v", vboxManageCmd, strings.Join(args, " "))

But testing exec.Command, it shows similar behavior. Strange coincidence? https://golang.org/pkg/os/exec/#example_Command

parvezshah commented 5 years ago

Had the same issue on ubuntu 18.04, had installed docker using snap i removed that and installed docker and docker-compse using apt and docker-machine using $ base=https://github.com/docker/machine/releases/download/v0.16.0 && curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/tmp/docker-machine && sudo install /tmp/docker-machine /usr/local/bin/docker-machine difference is snap will install docker-machine v0.15 and we will be installing v0.16