22
votes

I try to run vagrant on my Ubuntu 14.04. So for, I did these steps:

-Install vagrant -Install virtualbox -added box for provider

then I run the

vagrant up

command.

After running the command, I take these output and at the and there is an error message which I cannot figure out how can I solve and run it correctly.

Bringing machine 'default' up with 'virtualbox' provider...

==> default: Checking if box 'udacity/ud381' is up to date...

==> default: Clearing any previously set forwarded ports...

==> default: Clearing any previously set network interfaces...

==> default: Preparing network interfaces based on configuration...

default: Adapter 1: nat

==> default: Forwarding ports...

default: 5000 (guest) => 5000 (host) (adapter 1)

default: 22 (guest) => 2222 (host) (adapter 1)

==> 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", "0399f946-6a87-4310-a22d-c1a4525ae2f0", "--type", "headless"]

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

What should I do to fix these error ?

12

12 Answers

7
votes

Important pre-amble:

Please note that I wrote this answer back in 2015/2016 and targeted VirtualBox and Vagrant and Ubuntu headless 14.04.

Your mileage may vary after a while.

If you have a similar problem but for a different version, feel free to edit this answer and append your answer above my answer for Ubuntu 14.04 Let's help everyone to progress together.

I myself will do the same and update this answer for newer versions when I start to use them.

Answers:

Ubuntu 14.04 Headless with Vagrant and VirtualBox

I found this page when I had the same issue.

Now I have solved mine. I hope that my solution can help you.

Download the latest AMD64 for virtualbox and install

  1. Go https://www.virtualbox.org/wiki/Linux_Downloads
  2. Choose the AMD64 which is a deb because I am trying to run vagrant on a 64 bit Ubuntu 14.04 server 64-bit edition (My original problem was that I had used the i386)
  3. Then as root, dpkg -i whatever_is_the_latest_version_virtualbox.deb
  4. apt-get -f install This will install the dependencies

Download the latest AMD64 for vagrant and install

  1. Go https://www.vagrantup.com/downloads.html
  2. Choose Debian 64 bit
  3. Then as root, dpkg -i whatever_is_the_latest_version_vagrant.deb
  4. apt-get -f install This will install the dependencies

Then do the rest of your vagrant box setup.

It should work now.

18
votes

On Ubuntu 16.04 make sure to uninstall any previous versions of virtualbox:

sudo apt-get purge virtualbox virtualbox-dkms virtualbox

The reinstall virtualbox as downloaded from virtualbox.org

sudo dpkg -i Downloads/virtualbox-5.1_5.1.22-115126-Ubuntu-xenial_amd64.deb

This fixed the error for me.

11
votes

It has to help:

sudo /sbin/vboxconfig

Then launch your virtual machine. It helped me ;-)

4
votes

I did following steps and it get fixed.

  1. Make sure Virtualization is enabled in BIOS. for e.g

http://www.sysprobs.com/disable-enable-virtualization-technology-bios

https://askubuntu.com/questions/410813/how-to-enable-virtualization-on-booting-ubuntu-13-10

  1. Install the virtualbox-5.0 but before you need to uninstall older version of virtualbox. Below link would help:

http://ubuntuhandbook.org/index.php/2015/07/install-virtualbox-5-0-ubuntu-15-04-14-04-12-04/

  1. Add v.gui = false at below line in Vagrantfile

    override.vm.network :private_network, ip: machine_type['ip']
    v.gui = false 
    
  2. Restart the Vagrant:

    vagrant reload
    

Hope it works.

2
votes

On my ubuntu 14.02 I switch to virtualbox-5.0 worked for me

sudo apt-get install virtualbox-5.0
1
votes

On Mac OS 10.12, reinstalling Virtual Box fixed this for me (Vagrant 2.0.0 and Virtual Box 5.1.28).

1
votes

The best solution :
sudo /sbin/vboxconfig

to fix the Error:

homestead up Bringing machine 'homestead-7' up with 'virtualbox' provider...
==> homestead-7: Checking if box 'laravel/homestead' is up to date...
==> homestead-7: A newer version of the box 'laravel/homestead' is
available! You currently
==> homestead-7: have version '1.0.1'. The latest is version '3.0.0'. Run
==> homestead-7: vagrant box update to update.
==> homestead-7: 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 71 of file VBoxManageHostonly.cpp

0
votes

Install all available plugins to container.

  1. Get plugin list- Execute

vagrant plugin list

   It will list all the plugins available.

  1. Install plugins- execute

vagrant plugin install

once done issue vagrant up

0
votes

On my ubuntu 16.04, I was using virtualbox-5.1 with BOSH-LITE same error came while doing

vagrant up --provider=virtualbox

I uninstall virtualbox-5.1 and install virtualbox-5.0 then it is working now.

0
votes

Just to add something new to this discussion, in my experience, this error gets thrown when trying to launch a non-headless VM in non-graphic capable terminal. Wrapper scripts like vagrant and packer tend to go for the simplest options and so by default it seems often their VMs (or boxes) launch a GUI unless it doesn't have one. Fix the graphic terminal problem (say with x11 forwarding) and everything works as expected.

0
votes

After upgrading the OS on my MAC, things stopped working with the same error as the OP. I upgraded all the other components as well.

I had this environment: - MacOS Mojave v10.14 - Vagrant 2.0.1 - VirtualBox-5.2.20-125813-OSX.dmg - VBoxGuestAdditions_5.2.20.iso

After that, I did "vagrant box update" to get the latest version of the box.

After that I was able to spin new VMs. If you have VMs already created, you may have to deal with Guest Additions version mismatch between Host and Guests.

0
votes

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