Unable to run vagrant up due to Vbox error (MS 81.) - windows

I am on Windows 8.1
When i attempt to install vagrant and run it with virtual box i always get the following error.
"The provider 'virtualbox' that was requested to back the machine
'default' is reporting that it isn't usable on this system. The
reason is shown below:
Vagrant could not detect VirtualBox! Make sure VirtualBox is properly installed.
Vagrant uses the VBoxManage binary that ships with VirtualBox, and requires
this to be available on the PATH. If VirtualBox is installed, please find the
VBoxManage binary and add it to the PATH environmental variable."
I have tried different things such as uninstalling both virtual box and vagrant and re-installing them.
I have tried installing vagrant first then vbox and the other way around also but no change.
I am new to vagrant so if anyone can assist please.

I bet that you're using the latest VirtualBox version (4.3.12). If so, there's a known issue which will be addressed in Vagrant 1.6.3:
https://github.com/mitchellh/vagrant/issues/3852
As a workaround you can install VirtualBox 4.3.10 and it will work flawlessly.

As Emyl said, you can either downgrade your VirtualBox or upgrade your Vagrant to 1.6.3(as the issue has been fixed in this version).
But if you want to have a quick fix on this issue you can simply change the environmental variable name for the Virtual Box installation path from VBOX_MSI_INSTALL_PATH to VBOX_INSTALL_PATH
(This PC -> Advanced System Settings -> Environmental Variables -> Search for VBOX_MSI_INSTALL_PATH and change it to VBOX_INSTALL_PATH)
Make sure to restart your terminal before doing vagrant up again.
You are done!

changing VBOX_MSI_INSTALL_PATH and change it to VBOX_INSTALL_PATH in environment variables and then restarting terminal resolved my issue :)

I also had this problem on Windows 8.1 and solved it by restarting my computer. If you have just installed VirtualBox, you may need to restart your command prompt or Windows for the environment variables to get read correctly when you run "vagrant up".

i had to run the cmd.exe as administrator to make this work after using Sri Harsha Kappala solution

Related

How to remove cached non-existing Virtualbox machines, using Hyper-V as provider?

I was using Vagrant under Windows 10 Pro first with Virtualbox provider and created a few boxes. Then because I wanted to test Docker for Win, I had to switch to Hyper V and uninstall Virtualbox. After some time I manually deleted some Virtualbox machines or re-purposed the folders so they don't have Vagrantfile anymore in them.
When I try to run either
vagrant global-status --prune
or
vagrant destroy -f XXXYYYZZZ
I get this error:
The provider 'virtualbox' that was requested to back the machine 'default' is reporting that it isn't usable on this system. The reason is shown below:
Vagrant could not detect VirtualBox! Make sure VirtualBox is properly installed. Vagrant uses the VBoxManage binary that ships with VirtualBox, and requires this to be available on the PATH. If VirtualBox is installed, please find the VBoxManage binary and add it to the PATH environmental variable.
I understand what Vagrant is trying to say: Install virtualbox binary so it can manage the boxes. But actually there are no VMs to begin with so it should be enough to delete it from registry and for that no Virtualbox is necessary. Is there a way how to remove cached boxes from registry in my case?
vagrant is keeping the list of machines it manages under the following location (that is for Mac, you would need to find for windows as I am not fully sure about the path)
~/.vagrant.d/data/machine-index
and under this folder, you'll find a index file that will list all machines it has in cache. its a JSon file and the provider for the machine is listed so you can remove anything that is not VirtualBox
I got the similar situation when I try to install Docker on my Windows 10 machine with vagrant + virtual box.
I have uninstalled virtual box, but the same error continues every time I try to run "vagrant up"
The provider 'virtualbox' that was requested to back the machine
'default' is reporting that it isn't usable on this system. The reason
is shown below:
Vagrant could not detect VirtualBox! Make sure VirtualBox is properly
installed. Vagrant uses the VBoxManage binary that ships with
VirtualBox, and requires this to be available on the PATH. If
VirtualBox is installed, please find the VBoxManage binary and add
it to the PATH environmental variable.
So below process saved me from it.
step 1: Add below line in vagrantfile below line "config.vm.box"
config.vm.define "hyperv"
Step 2: start your vagrant box calling like below from powershell or cmd
vagrant up --provider=hyperv
It should work. I got the vagrant running after these steps.
It must be the provider which is saved as virtual box somewhere in cache or registry.enter code here
source: https://willmurphyscode.net/2017/01/16/a-very-simple-vagrant-deployment/

Vagrant laravel/homestead shared folders not mounting after 2.1.0 update

I have scoured the internet up and down for this issue and always consider asking here a last resort. That being said if this has been asked and solved before please point me in the right direction.
I am using Virtualbox 5.1.22 on macOS Sierra 10.12.5 with vagrant version 1.9.6
Yesterday I upgraded my homestead box from version 2.0.0 to 2.1.0. I only upgraded after running vagrant up and it did its thing and was fine until I come in today and turn my machine one and try booting up the vagrant machine again. I get the following error at the end of the normal stuff:
Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:
mount -t vboxsf -o uid=900,gid=900 vagrant /vagrant
The error output from the command was:
/sbin/mount.vboxsf: mounting failed with the error: No such device
I have tried vagrant reload, vagrant halt and then vagrant up, restarting the machine and re-running, vagrant reload --provision
Any help is greatly appreciated.
Thanks.
EDIT: Why the downvote? This seems like a perfectly reasonable question?
The box comes with VirtualBox Guest Addition for a given version of VirtualBox, which is not the one you're running on your host.
what you need to do is update the Guest Additions in your guest VM to the same version of VirtualBox that you run on your host machine.
The easy way as mentioned in my comments is to use the vagrant vbguest plugin, it will compare the version from your host and guest software and will automatically aligned if needed. I find it pretty convenient and there are options to disable the update if you need.
In case you do not want to run an additional plugin, you can make the update on the guest VM manually.
You will need to download the Guest Addition for the same version of your VirtualBox (5.1.22 in your case) and follow the instructions to install
So I found and installed this: https://github.com/dotless-de/vagrant-vbguest
I have no idea why I need a plugin now when it was working just fine before updating but hey...it works.

vagrant is not a recognised internal/external command

I have cloned a repository from Github following a course on Udacity. It contains a vagrant file and according to the tutorial I shoulld use vagrant up command to get the virtual machine started. But it says that vagrant is not a recognized internal/external command. How can I fix this?
Install Vagrant for Windows, if your machine OS is windows.
https://www.vagrantup.com/downloads.html
Restart computer.
Install Virtualbox from Virtualbox SDK
https://www.virtualbox.org/wiki/Downloads
VirtualBox 5.2.6 platform packages. The binaries are released under the terms of the GPL version 2.
Windows hosts
Once Virtual box is installed, run the command on the cmd prompt.
vagrant up --provision
I'm in the same course on Udacity and I think the issue you are having can be resolved by adding C:\Hashicorp\Vagrant\bin to your system variables path.
Instructions for editing your path can be found here: Where can I set path to make.exe on Windows?
This fixed the error for me.

Unable to vagrant up - how to set "providers"

I am trying run vagrant but after vagrant up error appears:
No usable default provider could be found for your system.
Vagrant relies on interactions with 3rd party systems, known as
"providers", to provide Vagrant with resources to run development
environments. Examples are VirtualBox, VMware, Hyper-V.
The easiest solution to this message is to install VirtualBox, which
is available for free on all major platforms.
If you believe you already have a provider available, make sure it
is properly installed and configured. You can see more details about
why a particular provider isn't working by forcing usage with
`vagrant up --provider=PROVIDER`, which should give you a more specific
error message for that particular provider.
I installed before VirtualBox version 4.3.26 r989888 and Linux Ubuntu (64 bit)
After:
vagrant box add precise32 http://files.vagrantup.com/precise32.box
==> box: Adding box 'precise32' (v0) for provider:
box: Downloading: http://files.vagrantup.com/precise32.box
box: Progress: 100% (Rate: 1425k/s, Estimated time remaining: --:--:--)
==> box: Successfully added box 'precise32' (v0) for 'virtualbox'!
when I list
vagrant box list
lucid32 (virtualbox, 0)
precise32 (virtualbox, 0)
What is wrong with "provider"
vagrant package --base vagrant-ubuntu64
Vagrant could not detect VirtualBox! Make sure VirtualBox is properly installed.
Vagrant uses the `VBoxManage` binary that ships with VirtualBox, and requires
this to be available on the PATH. If VirtualBox is installed, please find the
`VBoxManage` binary and add it to the PATH environmental variable.
How to help him detect VirtualBox ?
Quick note - Vagrant 1.8.4 and Virtualbox 5.1.X aren't compatible on MacOS 10.11 (can't set a provider).
Virtualbox 5.0.10 works just fine.
I was able to fix this simply by installing the latest version of Vagrant (as of this writing 1.7.4).
simply try to bring vagrant up and specify provider you want to use:
vagrant up --provider virtualbox
As per screenshot below, it will tell you the reason why specified provider is not working. In my case, it was an unsupported version of VirtualBox 5.2. I had to downgrade it to v 5.1
There seems to have been an issue reported since VirtualBox 4.3.12:
VirtualBox automatically create the following environment variable VBOX_MSI_INSTALL_PATH
However, vagrant (if you look for the base.rb file) uses the variable VBOX_INSTALL_PATH
So you can
- update the variable name VBOX_MSI_INSTALL_PATH and change it to VBOX_INSTALL_PATH
- create a new variable name VBOX_INSTALL_PATH with the same value as VBOX_MSI_INSTALL_PATH
Reminder on windows go to My Computer (right click) --> Properties --> Advanced System Settings --> Environment Variables and look for the variable you need to manage
ok so I was having the same issue with windows, vagrant and virtualbox and did this.
click on "This PC" / "My Computer" on windows desktop
Select "Properties"
Go to "Advanced" tab
Click "Environment Variables..." at the bottom
Under System Variables click "New..."
Set "Variable name" to "VBOX_INSTALL_PATH"
Set "Variable value" to "C:\Program Files\Oracle\VirtualBox\"
Select "OK" and close all the other settings windows
credit goes to here:
https://github.com/mitchellh/vagrant/issues/3852
I am assuming that there is a Environment Variable ( or PATH for linux users I think :P) that needs the "path" to the virtualbox executable.
I'm running macOS 10.12 and installed vagrant 5.1 using homebrew.
I got the same error as the OP and fixed it by downloading the latest version of VirtualBox (v5.1.6).
N.B. This version is labeled amd64 on the download page, this is just the name of the 64 bit standard and will install fine on Intel macs.
I had installed Virtualbox 6.1 and Vagrant 2.2.6 and got this error on a Mac. I had to revert Virtualbox to 6.0 and then vagrant up worked with ubuntu/trusty64. See #Serge Voloshenko's answer above for how to discover if it's a compatibility issue.
It is just the Version problems either it can be problem from vagrant or from Virtual box to connect
Try this : vagrant up --provider virtualbox
Above command will help if the version of virtual box is compatible or not and it will also suggest which are the current linkable versions of Virtual box
Currently : 4.0,4.1,4.2,4.3,5.0,5.1,5.2 are the versions of virtual box that are working
By the way, If you are worrying about version of Vagrant, I have tried current version : 2.0.3

Vagrant Connection Refused Error

Virtual Box 4.3.14
Vagrant 1.6.3
and when I vagrant up I get this error
default: warning: connection refused. Retying...
it goes on and on until it gives up and says
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
I am on windows 7, I even tried running cmd on administrator mode same thing
I even tried vagrant reload as I read on on other web resources, still same thing, it outputs the same thing
I did not tweak my virtualbox after install, basically just install virtualbox and install vagrant then run vagrant up
and oh by the way my vagrantfile and provisioning script is from here
https://gist.github.com/JeffreyWay/9244801
https://gist.github.com/JeffreyWay/9244714
Been googling and unfurtunately I can't find clear answer
Tnx in advance
It seems its a virtual box / vagrant version incompatibility issue
I uninstalled Virtual Box 4.3.14 and installed Virtual Box 4.3.12 and it worked. Basically I downgraded virtual box.
I hope this gets fixed soon.
Hope this helps anyone.
Open your vagrantfile using notepad and edit it so that it looks like this:
Please tally your vagrantfile with this one word by word. Then open BIOS and turn on virtualisation. Watch this video to learn how to do it. It is a very short video.
PS: You may need to uninstall vagrant before doing this. And in your Users folder in C:, there will be a folder named .vagrant.d, please delete that as well before following these steps.
Uninstalling vagrant will require that you run your machine as administrator. You can right click on Command Prompt (search cmd in windows search box) and click run as administrator. Type the following command: net user administrator /active:yes
You will get a message called command completed successfully. Now you can log off and see that there are two accounts, one of them is admin. You can log in from that and uninstall vagrant.

Resources