Vagrant: Error while executing "VBoxManage" on vagrant up

Created on 15 Jun 2017  ยท  38Comments  ยท  Source: hashicorp/vagrant

Vagrant version

Vagrant 1.8.1

Host operating system

Ubuntu 16.04

Guest operating system

bento/ubuntu-16.04

Vagrantfile

host_port = 8000

Vagrant.configure("2") do |config|
  if ENV['http_proxy'] || ENV['HTTP_PROXY']
    system "vagrant plugin install vagrant-proxyconf" unless Vagrant.has_plugin?("vagrant-proxyconf")
  end

  config.vm.box = "bento/ubuntu-16.04"
  config.vm.define "devstack" do |devstack|
    devstack.vm.hostname = "devstack"
    config.vm.network "private_network", type: "dhcp"
      if Vagrant.has_plugin?("vagrant-proxyconf")
        devstack.proxy.http = (ENV['HTTP_PROXY'] || ENV['http_proxy'])
        devstack.proxy.https = (ENV['HTTPS_PROXY'] || ENV['https_proxy'])
        devstack.proxy.no_proxy = (ENV['NO_PROXY'] || 'localhost,127.0.0.1')
      end
    #setup port forwarding if required for horizon
    devstack.vm.network :forwarded_port, guest: 80, host: host_port+=1,
      auto_correct: true
    devstack.vm.network :forwarded_port, guest: 8888, host: host_port+=1,
      auto_correct: true
    devstack.vm.provider :virtualbox do |vb|
      vb.cpus = Integer(ENV['VAGRANT_CPUS'] || 2)
      vb.memory = Integer(ENV['VAGRANT_MEM'] || 5120)
    end
  end
end

Debug output

==> devstack: Booting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["startvm", "5166fcf8-e107-4e4c-9340-e1349f364a07", "--type", "headless"]

Stderr: VBoxManage: error: The virtual machine 'vagrant-devstack_devstack_1497477126329_30748' has terminated unexpectedly during startup with exit code 1 (0x1)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine

Has anyone seen this? Inputs appreciated

providevirtualbox question

Most helpful comment

For me "vboxreload" is actually sudo /sbin/vboxconfig

All 38 comments

My VirtualBox is 5.1.20r114628

Hi there,

This is generally caused by a failure to allocate resources on the host machine required by the defined guest. You can inspect the VirtualBox logs to find more information which should help resolve your issue. The following link can help you determine where your log files may be:

https://blogs.oracle.com/fatbloke/virtualbox-log-files

Cheers!

I was able to resolve the problem by purging any old Virtualbox and reinstalling it. Also I got vagrant 1.8.5 from 1.8.6. I don't think the vagrant version was a problem, it was basically due to VBox

For anyone who finds this issue in the future - sometimes this is caused by the virtualbox kernel modules loaded not matching the virtualbox client/UI version installed. For example, if after upgrading virtualbox you forget to run "vboxreload" (or to reboot), then you'd be using the same vboxdrv.ko, etc. as the previous version prior to the upgrade. Some package managers don't reload modules properly. If this happens to you, try "vboxreload", or reloading the vboxdrv, vboxpci, vbox* kernel modules directly if you can't find the vboxreload script (i.e.: modprobe -r vboxwhatever; modprobe vboxwhatever).

For me "vboxreload" is actually sudo /sbin/vboxconfig

I had the same issue on my Ubuntu. Looked like I had multiple versions of VirtualBox. No idea how.

So I checked all the packages using
sudo dpkg -l | grep virtualbox

Then removed everything by
sudo dpkg --purge <package name>

Also deleted VirtualBox VMs folder by sudo rm ~/"VirtualBox VMs" -Rf

Then installed the latest version of VirtualBox (_5.2 in my case_) by doing the process mentioned here.

I got this error after upgrading from Virtualbox 5.1 to 5.2, as installed on Ubuntu from the Virtualbox PPA. I solved it by purging config files for 5.1 as well as uninstalling virtualbox-dkms 5.1:

sudo dpkg --purge virtualbox-5.1
sudo dpkg --purge virtualbox-dkms

For me, the solution came from this answer:

sudo apt-get autoremove virtualbox-dkms
sudo apt-get install build-essential linux-headers-`uname -r` dkms virtualbox-dkms

I encountered this error on a Windows 10 host and am currently lost on any resolution.

Windows 10 x64
Vagrant 2.0.4
VirtualBox 5.2.8 r121009

Does anyone have any ideas?

If you're running on windows try the following, from VirtualBox forum post

Go to C:\Program Files\Oracle\VirtualBox\drivers\vboxdrv directory, right click on VBoxDrv.inf and select Install.

Go to console and enter 'sc start vboxdrv'.

Then try 'vagrant up'. Worked for me issue.

I am still facing the problem while making the vagrant up on windows 10. I have tried vagrant version 1.7.2 with VM 4.3.12 also with vagrant 2.0.2 with VM 5.1.2/5.2.6/5.2.12... none of the combinations work.. Any help will be highly appreciable.

Getting the below error :

There was an error while executing VBoxManage, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["startvm", "4418f31e-9a9a-40e5-abe3-a61327193024", "--type", "headless"]

Stderr: VBoxManage.exe: error: The virtual machine 'dev-image_xdevimg_1526537235269_3388' has terminated unexpectedly during startup with exit code 1 (0x1). More details may be available in 'C:\Users\sinbmm\VirtualBox VMs\dev-image_xdevimg_XXXXXXXX\Logs\VBoxHardening.log'
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component MachineWrap, interface IMachine

Got this error consistently when I set VirtualBox to use the root of a drive to store VMs in. When I set my default machine folder to be a subfolder somewhere, it worked. It's 2018 and we still have errors like this.

@shukriadams this is likely a permissions issue, drive roots being protected. You will likely need to update permissions for the drive root location or stick to using a subdirectory.

This error just started out of the blue for me. I've not had any updates other than Windows 10. Nothing else has been touched, then boom - error. Can't fix.

Turns out IBM's Rapport software that I installed caused the issue. Any idea how to fix other than uninstalling?

After uninstalling IBM Trusteer Rapport software, things were back to normal on Windows 10 as the host.

On Windows 10, I installed everything as ADMINISTRATOR and only the following configuration worked for me:

Vagrant 1.9.2 : Download Vagrant 1.9.2

Oracle VM VirtualBox 5.1.30 : Download Oracle VM VirtualBox 5.1.30

For older versions of VirtualBox, the virtual machine has terminated unexpectedly.

For newer versions of VirtualBox, the host-only adapter cannot be created.

When you upgrade or downgrade, make sure that you permanently delete (Shift + Delete) the following folders from C:\Users\your-user : .vagrant, .VirtualBox and Virtual VM Machines. When using vagrant up, these folders will be created again.

After each program install and uninstall, make sure to restart your computer. Old files from VirtualMachine and Vagrant are persistent until the OS boots up again.

I got the same error in Mac OS High Sierra 10.13.6 with following installed:

  • VirtualBox ( 5.2.18 r124319 (Qt5.6.3) )
  • Vagrant (2.1.2)

I resolved it by opening System Preferences -> Security & Privacy and Click on Lock to Make Changes

That'll make all the programs to run without user authorization required for performing operations.

I resolved it by opening System Preferences -> Security & Privacy and Click on Lock to Make Changes

How to do that?
Thanks!

I resolved it by opening System Preferences -> Security & Privacy and Click on Lock to Make Changes

How to do that?
Thanks!

screen shot 2018-09-29 at 3 30 11 am

  1. Open System Preferences
  2. Goto Security & Privacy
  3. Under General tab, you will see _Click on Lock to Make Changes_ on bottom-left. Double click on it will prompt you for the system password, enter that, and you have enabled all the apps to change the system configuration as per need.

This happens because macOS by default blocks any change to system performed by third-party apps (Vagrant for example). And, those request from third-party apps is listed on the mentioned screen when the lock is not opened, below _"Allow apps downloaded from"_ section.

That's why you need to unlock macOS to enable changes made by third-party apps.

Also got this issue.

macOS Mojave Version 10.14
VirtualBox 5.2.20 r125813
vagrant 2.2.0

ubuntu/bionic64 (virtualbox, 20181018.0.0)

vagrant init and replace "base" with "ubuntu/bionic64" image, then vagrant up shows:

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/bionic64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/bionic64' is up to date...
==> default: Setting the name of the VM: Vbox_default_1540287275119_48374
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["startvm", "6ac560c7-0db5-4e2f-8603-8a6f2cbe6896", "--type", "headless"]

Stderr: VBoxManage: error: The virtual machine 'Vbox_default_1540287275119_48374' has terminated unexpectedly during startup with exit code 1 (0x1)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine

I'm getting a similar error

macOS Mojave 10.14.1
VirtualBox Version 5.2.22 r126460 (Qt5.6.3)
vagrant 2.2.0
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/xenial64' is up to date...
==> default: Resuming suspended VM...
==> default: Booting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["startvm", "5330425f-3f07-4f30-8d23-ab8a00a21e08", "--type", "headless"]

Stderr: VBoxManage: error: The VM session was closed before any attempt to power it on
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component SessionMachine, interface ISession

Simple fix for macOS, open VirtualBox Manager GUI, select the problem VM and choose the option "Discard" to delete the saved state.

Worked for my issue, found the solution by opening VirtualBox logs (ctrl click VM-> show logs), which had more verbose error message:

00:00:00.030015 ERROR [COM]: aRC=VBOX_E_FILE_ERROR (0x80bb0004) aIID={872da645-4a9b-1727-bee2-5585105b9eed} aComponent={ConsoleWrap} aText={VM cannot start because the saved state file '/Users/foo/VirtualBox VMs/devbox_default_1539634291772_96302/Snapshots/2018-11-09T19-52-25-230696000Z.sav' is invalid (VERR_FILE_NOT_FOUND). Delete the saved state prior to starting the VM}, preserve=false aResultDetail=0

I followed the procedure specified by @ritwikjamuar .It worked for me for the following system specifications.
macOS Mojave 10.14.1
VirtualBox Version 5.2.22 r126460 (Qt5.6.3)
vagrant 2.2.0

Thank you!

If you updated system to macOS Mojave and it shows this error:

  1. Check you can launch VirtualBox GUI app
  2. If not - reinstall VirtualBox

this works for me, I got this error after macOS update

I resolved it by opening System Preferences -> Security & Privacy and Click on Lock to Make Changes

How to do that?
Thanks!

screen shot 2018-09-29 at 3 30 11 am

  1. Open System Preferences
  2. Goto Security & Privacy
  3. Under General tab, you will see _Click on Lock to Make Changes_ on bottom-left. Double click on it will prompt you for the system password, enter that, and you have enabled all the apps to change the system configuration as per need.

This happens because macOS by default blocks any change to system performed by third-party apps (Vagrant for example). And, those request from third-party apps is listed on the mentioned screen when the lock is not opened, below _"Allow apps downloaded from"_ section.

That's why you need to unlock macOS to enable changes made by third-party apps.

  • virtualbox version: 6.0.0 r127566
  • system: mojave 10.14.2 (18C54)

Resolved after following this https://medium.com/@Aenon/mac-virtualbox-kernel-driver-error-df39e7e10cd8.

You probably have virtualization disabled in your bios. To enable virtualisation follow the guide here for different laptop types/makes.

For me, the solution came from this answer:

sudo apt-get autoremove virtualbox-dkms
sudo apt-get install build-essential linux-headers-`uname -r` dkms virtualbox-dkms

This worked for me

I resolved it by opening System Preferences -> Security & Privacy and Click on Lock to Make Changes

How to do that?
Thanks!

screen shot 2018-09-29 at 3 30 11 am

  1. Open System Preferences
  2. Goto Security & Privacy
  3. Under General tab, you will see _Click on Lock to Make Changes_ on bottom-left. Double click on it will prompt you for the system password, enter that, and you have enabled all the apps to change the system configuration as per need.

This happens because macOS by default blocks any change to system performed by third-party apps (Vagrant for example). And, those request from third-party apps is listed on the mentioned screen when the lock is not opened, below _"Allow apps downloaded from"_ section.

That's why you need to unlock macOS to enable changes made by third-party apps.

It worked. Allowing the third party applications to make changes to the system worked.
Thanks

I resolved it by opening System Preferences -> Security & Privacy and Click on Lock to Make Changes

How to do that?
Thanks!

screen shot 2018-09-29 at 3 30 11 am

  1. Open System Preferences
  2. Goto Security & Privacy
  3. Under General tab, you will see _Click on Lock to Make Changes_ on bottom-left. Double click on it will prompt you for the system password, enter that, and you have enabled all the apps to change the system configuration as per need.

This happens because macOS by default blocks any change to system performed by third-party apps (Vagrant for example). And, those request from third-party apps is listed on the mentioned screen when the lock is not opened, below _"Allow apps downloaded from"_ section.
That's why you need to unlock macOS to enable changes made by third-party apps.

Thanks, worked for me!

I am facing the same issue on Ubuntu 16.04. I tried everything above. I am using latest versions.
virtualbox version 6.0.8
vagrant version 2.2.5
I think I need to downgrade my versions ?
Help ??

I experienced this on MacOS 10.14.6 after I used Migration Assistant to migrate to a new Mac. Restarting VirtualBox's internal cache fixed the issue. I first discarded any saved state on the VM, then followed the instructions here.

Additionally, I needed to update any files that were still referring to a different user account's UID from the previous Mac. I believe this was the /etc/exports file; make sure it only has entries referring to the new user account.

Tried all mentioned "solutions", none worked (OS X Mojave). Still get an error at this step after vagrant up:

==> default: Clearing any previously set network interfaces...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["hostonlyif", "create"]

Stderr: 0%...
Progress state: NS_ERROR_FAILURE
VBoxManage: error: Failed to create the host-only adapter
VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
VBoxManage: error: Context: "RTEXITCODE handleCreate(HandlerArg *)" at line 94 of file VBoxManageHostonly.cpp

bye bye vagrant
welcome docker

Actually this is a Virtualbox error, not Vagrant. Docker is fine, but it takes at least 1.5GB of RAM. Vagrant and Vbox about 650k

@ritwikjamuar Thanks it worked for me.

But for that, I have reinstalled the virtual machine then the message for allowing oracle came

Mojave folks should check this out and reinstall virtualbox http://osxdaily.com/2018/12/31/install-run-virtualbox-macos-install-kernel-fails/

For me, the solution came from this answer:

sudo apt-get autoremove virtualbox-dkms
sudo apt-get install build-essential linux-headers-`uname -r` dkms virtualbox-dkms

Worked for me!!! thanks totymedli

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

StefanScherer picture StefanScherer  ยท  3Comments

RobertSwirsky picture RobertSwirsky  ยท  3Comments

jazzfog picture jazzfog  ยท  3Comments

barkingfoodog picture barkingfoodog  ยท  3Comments

tomhking picture tomhking  ยท  3Comments