50

i run CentOS in VirtualBox on physical Windows7. Now in centOS i have Docker and i need to run

docker-machine create --driver virtualbox host1

but i get error

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

so do i need to install VirtualBox once again and in the CentOS? If yes, how can i do that?

thanks lot

12 Answers 12

38

Yes you are absolutely correct. You need to install VirtualBox first of all.

You can do it by running yum install virtualbox for CentOS or

sudo apt-get install virtualbox for Ubuntu

Do so and then run your code and you will be good to go

3
  • "yum install virtualbox " will it work for amazon linuz also ? Commented May 2, 2018 at 12:39
  • $ sudo yum install virtualbox Loaded plugins: dkms-build-requires, priorities, update-motd, upgrade-helper amzn-main | 2.1 kB 00:00:00 amzn-updates | 2.5 kB 00:00:00 No package virtualbox available. Error: Nothing to do Commented May 2, 2018 at 12:40
  • If I got you correctly, you want to install virtualbox on aws ec2?
    – Ernest
    Commented May 3, 2018 at 13:03
17

It's an issue with permissions. You've installed docker as sudo. You need to run

sudo docker-machine create --driver virtualbox host1

OR

sudo docker-compose up 

to get around this.

1
  • 1
    sudo docker-compose up worked for me, did not have to try the first one
    – madan
    Commented Jan 4, 2022 at 12:51
6

I faced the same error in Ubuntu 18.04 but I realized that I had installed docker-machine using command : sudo snap install docker.

However install docker-machine using :

$ curl -L https://github.com/docker/machine/releases/download/v0.13.0/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine && \
chmod +x /tmp/docker-machine && \
sudo cp /tmp/docker-machine /usr/local/bin/docker-machine

Check your installation :

$ docker-machine version

Then install virtualbox using :

$sudo apt install virtualbox

Now you can create the docker-machine using the command :

$ docker-machine create --driver virtualbox dev

Hope this helps.

1
  • 3
    Error with pre-create check: "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path"
    – Gulzar
    Commented Oct 12, 2020 at 15:55
4

Being more specific about install VirtualBox on Mac Mojavi.

  1. After downloading the VirtualBox-6.0.6-130049-OSX.dmg, double-click to install

  2. Go to your applications folder and you will find the virtualbox.pkg like this:

    virtualbox.pkg

  3. Click on it to complete the installation.

  4. After install is complete, you should see VirtualBox in the applications folder like this:

    virtual box after installation completes

  5. Afterwards you should refresh your terminal and rerun your command.

    docker-machine create --driver virtualbox local-docker.
    
0
2

try to execute with superuser:

sudo docker-machine create -d virtualbox myvm1
2

For those who are using windows you can open the powershell command shell as an administrator and run the command below:

PS C:\Windows/system32> choco install virtualbox

if you don't have choco you can install it using this the command below:

PS C:\Windows/system32>

Set-ExecutionPolicy Bypass -Scope Process -Force; `
      iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
1

You just need to install the virtualbox :

sudo apt-get install virtualbox

then run this command:

docker-machine create --driver virtualbox default
1
  • Error with pre-create check: "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path"
    – Gulzar
    Commented Oct 12, 2020 at 15:56
1
  1. Reinstalled virtualbox

sudo snap remove virtualbox && sudo snap install virtualbox

  1. Renamed VBoxManage to match casing

sudo ln -s /usr/local/bin/VBoxManage /usr/local/bin/vboxmanage

  1. Reinstall Docker Machine with the command below.
base=https://github.com/docker/machine/releases/download/v0.16.0 &&
  curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/tmp/docker-machine &&
  sudo mv /tmp/docker-machine /usr/local/bin/docker-machine &&
  chmod +x /usr/local/bin/docker-machine
  1. Confirm the version and save scripts to /etc/bash_completion.d or /usr/local/etc/bash_completion.d
base=https://raw.githubusercontent.com/docker/machine/v0.16.0
for i in docker-machine-prompt.bash docker-machine-wrapper.bashdocker-machine.bash
do
  sudo wget "$base/contrib/completion/bash/${i}" -P /etc/bash_completion.d
done
  1. Rerun the command.

docker-machine create --driver virtualbox host1

0

1) Reinstall Virtualbox ... you can use this code : sudo apt-get install virtualbox

2) sudo docker-machine create --driver virtualbox default

0

Doing installation of Docker-Swarm using below steps:

$ base=https://github.com/docker/machine/releases/download/v0.16.0 &&
  mkdir -p "$HOME/bin" &&
  curl -L $base/docker-machine-Windows-x86_64.exe > "$HOME/bin/docker-machine.exe" &&
  chmod +x "$HOME/bin/docker-machine.exe"

Steps with ERROR:

$ base=https://github.com/docker/machine/releases/download/v0.16.0
$ mkdir -p "$HOME/bin"
$ curl -L $base/docker-machine-Windows-x86_64.exe > "$HOME/bin/docker-machine.exe"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   623  100   623    0     0   1236      0 --:--:-- --:--:-- --:--:--  1238
100 27.2M  100 27.2M    0     0   726k      0  0:00:38  0:00:38 --:--:--  593k

$ chmod +x "$HOME/bin/docker-machine.exe"
$ docker-machine version
docker-machine.exe version 0.16.0, build 702c****
$ docker-machine ls
NAME   ACTIVE   DRIVER   STATE   URL   SWARM   DOCKER   ERRORS

$ docker-machine create --driver virtualbox manager1
Creating CA: C:\Users\*****\.docker\machine\certs\ca.pem
Creating client certificate: C:\Users\*****\.docker\machine\certs\cert.pem
Running pre-create checks...
Error with pre-create check: "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path"

Resolution:

Then I installed VM from below link:Install VirtualBox Download VirtualBox and the corresponding Extension Pack: https://www.virtualbox.org/wiki/Downloads Install VirtualBox with the default settings Add the Extension Pack to VirtualBox (File -> Preferences -> Extensions)

$ docker-machine create --driver virtualbox manager1
Running pre-create checks...
Error with pre-create check: "This computer is running Hyper-V. VirtualBox won't boot a 64bits VM when Hyper-V is activated. 
Either use Hyper-V as a driver, or disable the Hyper-V hypervisor. (To skip this check, use --virtualbox-no-vtx-check)"

Then finally its created with below command:

$ docker-machine create --driver virtualbox  --virtualbox-no-vtx-check manager1
Running pre-create checks...
(manager1) Image cache directory does not exist, creating it at C:\Users\****\.docker\machine\cache...
(manager1) No default Boot2Docker ISO found locally, downloading the latest release...
(manager1) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%

(manager1) Creating VirtualBox VM...
(manager1) Creating SSH key...
(manager1) Starting the VM...
0

Also, if you installed virtualbox and vboxmanage on VM and still getting the same error:

Make sure your user is in the docker group. Otherwise you run docker as root and vbox as user and they can't see each other. Telltale sign that you're not in the group is that you have to sudo docker commands, e.g.:

sudo docker images

To fix, do:

sudo groupadd docker
sudo gpasswd -a <your-username> docker

Now check that user is added:

getent group docker

or:

grep /etc/group -e "docker"

Also restart docker daemon:

sudo service docker restart 

Log out and back into terminal (try restarting system if this does not work), and you should be able to run docker without sudo, e.g.:

docker images

docker machine and docker-compose should now run, too.

Fore more information, refer to this answer: Can't connect to docker from docker-compose

0

Run below commands:

  1. sudo apt-get install virtualbox To install virtual box and then.
  2. also make sure docker machine is installed. LINK
  3. docker-machine create --driver virtualbox default to create machine & link for the same

Not the answer you're looking for? Browse other questions tagged or ask your own question.