Vagrant VMware Utility driver - vagrant

First of all I'm sorry if someone already did this question, in this case please paste the link here because I didn't find anything.
I'm learning vagrant, using virtualbox i don't have problem in running VM, but if I would like to use VMware as provider. I encounter this message and I can't find a way to get out of this.
I think everything is well configured but obviously something is wrong.
When I launch vagrant up --provider=vmware_desktop, I have this error message:
Vagrant encountered an unexpected communications error with the
Vagrant VMware Utility driver. Please try to run the command
again. If this error persists, please contact support#hashicorp.com
I'm currently using Fedora 35
Operating System: Fedora Linux 35 (Workstation Edition)
Kernel: Linux 5.17.5-200.fc35.x86_64
Architecture: x86-64

I have followed this thread:
https://github.com/hashicorp/vagrant-vmware-desktop/issues/22
and someone had prepared a nice gist -- which I copied below just in case the gist link wasn't anymore.
My issue was mainly the Vagrant 2.2.19 which somehow was not ok with VMWare. 2.2.18 worked fine. Just make sure you follow the above gist step by step.
https://gist.github.com/sbailliez/f22db6434ac84eccb6d3c8833c85ad92
My issue was mainly the Vagrant 2.2.19 which somehow was not ok with VMWare. 2.2.18 worked fine. Just make sure you follow the above gist step by step.
Vagrant and VMWare Tech Preview on Apple M1 Pro
This document summarizes notes taken while to make the VMWare Tech preview work on Apple M1 Pro, it originated
from discussions in https://github.com/hashicorp/vagrant-vmware-desktop/issues/22
Installing Rosetta
First install Rosetta if not already done, this is needed to run x86 code:
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
Installing Vagrant
Install Vagrant via brew or install it manually. Note that I use 2.2.18 as 2.2.19 did not work for me. (YMMV)
brew install vagrant#2.2.18
Installing VMWare Fusion Tech Preview
You will need to create an account on vmware as it needs user and key information that are user specific.
The registration process is kinda convoluted. Be careful about passwords as the password needs to be less than 20 characters and there are no error messages for this.
You can download the tech preview via the download page.
Once this is installed you will NEED to create a symlink as the vagrant vmware utility etc.. assumes that vmware is installed in a specific directory and the tech preview is installed in a different one.
ln -s /Applications/VMWare\ Fusion\ Tech\ Preview.app /Applications/VMWare\ Fusion.app
Installing Vagrant VMWare provider
It requires two steps. This is detailed in the documentation but follow the steps below:
First go to Vagrant vmware Utility and download the binary and install it. It says x86_64 but it is fine.
The direct link is:
https://releases.hashicorp.com/vagrant-vmware-utility/1.0.21/vagrant-vmware-utility_1.0.21_x86_64.dmg
It needs to be version 1.0.21
Next install the provider:
vagrant plugin install vagrant-vmware-desktop
Create a Vagrant file
Create a file Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "spox/ubuntu-arm"
config.vm.box_version = "1.0.0"
end
Run vagrant
vagrant up
and then
vagrant ssh
Hopefully this should work and you should find yourself with mostly everything working.
Troubleshooting
I have observed various issues that makes the whole experience unstable or creating conflicts.
vagrant 2.2.19 is broken
I have had issues trying to run vagrant 2.2.19. Use 2.2.18
vagrant-vmware provider forwarded ports bound
If you declare forwarding port on your box, for some reasons the provider persists them and keeps it bound in LISTEN state even after you do a vagrant halt.
You can check this using something like:
sudo lsof -i -P | grep LISTEN | grep 'vagrant-v'
You can see the ports are stored in:
cat /opt/vagrant-vmware-desktop/settings/portforwarding.json
To stop the provider use:
sudo launchctl unload -w /Library/LaunchDaemons/com.vagrant.vagrant-vmware-utility.plist
To start it again, use load instead of unload.
nfs exports conflicts
If your vagrant box uses nfs, it seems to pollute the /etc/exports file with duplicate or stale entries over time which will cause vagrant to get angry at you at some point. You may need to prune the entries. It seems related to vagrant#11418

I encountered this same issue you had with the architecture compatibility while trying to set up VM on my Mac M1. Found my solution in this GitHub thread
I just added this lines to the Vagrantfile
config.vm.provider :vmware_desktop do |v|
v.vmx["ethernet0.pcislotnumber"] = "160"
end

Related

Vagrant was unable to mount VirtualBox shared folders. ERROR: INVALID ARGUMENT

I know that other people during the years had met similar problems (like this ) however in my case the guest addition is installed (0.30.0 version) and I tried to reinstall it a lot of times.
I work on Windows10 and those are the version of VirtualBox and Virtual Machine.
Virtualbox on your host claims: 5.2.8
VBoxService inside the vm claims: 6.1.22
This is the code of the problem:
default: /vagrant => C:/Users/XXXX XXXX/Documents/src
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=1000,gid=1000,_netdev vagrant /vagrant
The error output from the command was:
/sbin/mount.vboxsf: mounting failed with the error: Invalid argument
I never found the error Invalid argument in similar cases so my question is if this need a particular procedure.
Thank you very much
Just had a similar problem after an update - was getting the same:
/sbin/mount.vboxsf: mounting failed with the error: Invalid argument
What I found in virtualbox startup was the message:
VirtualBox Guest Additions: Kernel headers not found for target kernel
5.4.0-81-generic. Please install them and execute
/sbin/rcvboxadd setup
Used "vagrant ssh" to access the virtualbox command line and ran:
sudo apt-get install linux-headers-$(uname -r)
After that restarted vagrant:
vagrant halt
vagrant up
Then it actually built the VirtualBox Guest Additions properly and mounted my shared folders.
Had the same exact error as you after making my second vagrant project - specifically after changing my public_network setting.
mount -t vboxsf -o uid=1000,gid=1000,_netdev vagrant /vagrant
The error output from the command was:
/sbin/mount.vboxsf: mounting failed with the error: Invalid argument
At I also tried several solutions from people's answers like the one mentioned here and updated my VirtualBox.
I'm not really sure how mine works but here's what I did:
I logged into the VM (vagrant ssh) and installed the guest additions manually
cd /opt
sudo wget -c
http://download.virtualbox.org/virtualbox/6.1.26/VBoxGuestAdditions_6.1.26.iso O VBoxGuestAdditions_6.1.26.iso
And then tried:
sudo mount VBoxGuestAdditions_5.1.28.iso -o loop /mnt
sudo sh /mnt/VBoxLinuxAdditions.run
But I got an error saying something like permission denied or no directory.
So I reload vagrant (vagrant reload), but the error still occurred. However, I still continued trying something else, so I thought maybe I should install the vbguest plugin and did this:
vagrant plugin install vagrant-vbguest
That removed the error for me after reload but when I logged into vagrant again, I still can't see my shared folders so I halted my vb and run provision:
vagrant up --provision
Then I got a message which said that there was an error while executing VBoxManage so on and so forth. So I paused all running machine in my VB, closed all running VB apps in my desktop, and run the command:
vagrant destroy
After recreating vagrant vagrant up, everything miraculously worked! I can now navigate to my shared folders' directory.
I'm still in the process of learning vagrant so I can't really explain what actually happened in my machine but I hope this can somehow be of help to you or to someone who have the same issue.
Step 1: open virtual box then right click on installation machine then ->close->power off.
Step 2: then run below command
vagrant halt
vagrant up
Finally got it working the following way (this related answer was of great help along with Paul_Z's answer in this same question).
Step 1:
Make sure VirtualBox Guest Additions Software is installed.
If this solved your Issue, then great! If not, continue on to step 2.
Step 2:
Read the VirtualBox Guest Additions installation output carefully.
(If no longer possible, you can rerun the setup by using cd to go to
/opt/VBoxGuestAdditions-*your-version-number-here*/init/
and then run:
sudo ./vboxadd setup)
Step 3:
Install the needed dependencies with the distribution's package manager that the error message shows. (In my particular case, it mentioned that the system couldn't perform kernel module builds because gcc make and perl were not present in the system).
Step 4:
Rerun the VirtualBox Guest Additions setup by going to
/opt/VBoxGuestAdditions-*your-version-number-here*/init/
and then run:
sudo ./vboxadd setup
(If more dependencies are requested, go back to step 3)
Step 5: Reboot
Step 6 (Optional):
Add user to vboxsf group so that it is able to access the shared folder if needed. (As explained in this answer).
sudo usermod -G vboxsf -a your_user_name
I have the issue i Ubuntu 20.04 and simply download a more recent version of VirtualBox, then extract the GuestAditions ISO and installed it
I ran just
vagrant plugin install vagrant-vbguest
and after this the box came up.

Unable to start a virtual machine on Virtualbox - Ubuntu 18.04 - infamous problem - no solution works

While trying to use Laravel's Homestead environment, I had to install vagrant and virtualbox.
I already had an older version of Virtualbox.
uninstalled it and installed a new one, then installed Vagrant.
While trying to start my virtual machine I've got a well known issue:
For the past 2 days I've tried EVERYTHING
I've tried
sudo /sbin/vboxconfig
which didn't work, So as suggested in a few posts, I've disabled secure boot from the BIOS.
It still didn't work.
I've tried every type of uninstalling with apt, apt-get and dpkg for everything that includes "virtualbox" in it's package name. Also purged, autoremove and autoclean everything possible.
I've checked the lists and seems like I'm all clean of virtualbox.
But when I'm installing it again directly from the VB website with an installer (version 6.1) it happens again and again.
Funny thing is that no matter how much I clean or purge, whenever I'm installing it again, all my virtual machines are still there. meaning there's still something I'm missing...
Please help. Thanks a LOT!
I've read just about everything about it including:
https://askubuntu.com/questions/1163267/virtual-box-works-no-longer-suspect-a-kernel-update-caused-this
http://mitreasorin.blogspot.com/2016/08/upgrade-virtualbox-rtr3initex-failed.html
https://forums.virtualbox.org/viewtopic.php?f=7&t=79035
Unable to start Vagrant VirtualBox on Ubuntu
https://askubuntu.com/questions/1163267/virtual-box-works-no-longer-suspect-a-kernel-update-caused-this
https://forums.linuxmint.com/viewtopic.php?t=292858 (for /sbin/vboxconfig that didn't work)
https://forum.manjaro.org/t/virtualbox-not-working-cant-rmmod-vboxdrv/86277
And a lot more. too many to mention, it's just about repeating the same things.

Vagrant dev build throwing errors

So I am having some issues with vagrant. I had initially tried to report this as an issue on the vagrant github issue boards, but they kept closing the issues without responding to them. I guess they decided I wasn't worth their time, or they were just behaving unprofessionally. Anyway, Here is the problem: I use vagrant with virtualbox, and a new version of virtualbox was recently released that is, unfortunately, not compatible with the latest vagrant installation.
However, the people at hashicorp have already updated the source code so that it is compatible with the new version of virtualbox, but you have to build the vagrant executable from the source repo (instructions here). So I followed the instructions and vagrant is working just like it used to.....when the only command I need to run is vagrant up. I should also mention ahead of time that, in order to run the vagrant dev build, the current working directory needs to be the root of the source code repo and the dev build can only be run using the following command with ruby:
bundle exec vagrant
With that being said, I needed to update one of my custom boxes, so I built a vm in the updated version of virtualbox and ran the below command
bundle exec vagrant package --base go --vagrantfile ../../vagrant/vagrantfile
After an extended period of time, vagrant spat back out the following error
The executable 'bsdtar' Vagrant is trying to run was not found in the %PATH% variable. This is an `error. Please verify this software is installed and on the path.`
I should also note that I use a windows machine and that this error never occurred when using the installed version of vagrant. At this point, I had posted the issue on github to get some input from the devs, but they (very unprofessionally) decided to ignore my requests for help and close the issues without providing any response. I used the GNUwin32 project to make numerous unix commands available to my Windows environment and added the folder to my PATH environment variable. I then run the same command again to create my new box and it works!! So then I upload it to the vagrant cloud and attempt to update the vagrant box that is stored on my system by running the following command:
bundle exec vagrant box update
Then, after waiting for a while, vagrant then spat this error out at me:
The box failed to unpackage properly. Please verify that the box
file you're trying to add is not corrupted and that enough disk space
is available and then try again.
The output from attempting to unpackage (if any):
C:\gnuwin32\bin/bsdtar.EXE: invalid option -- s
Usage:
List: bsdtar.EXE -tf <archive-filename>
Extract: bsdtar.EXE -xf <archive-filename>
Create: bsdtar.EXE -cf <archive-filename> [filenames...]
Help: bsdtar.EXE --help
Another error, and still involving this bsdtar tool. It does not appear that anyone else is reporting the issue I am running into because I think they are just waiting for hashicorp to release the new official installation, but, just to give you a look into their priorities, the version of virtualbox that was released which no longer worked with vagrant was released back on December 10. It has been over a month since and there is still no updated release.
So, I am hoping that someone out there might be able to find out why I keep running into these errors when trying to use vagrant's dev build and provide a solution. If not, then maybe if someone else is able to reproduce the issue and report it to hashicorp, maybe they will listen to someone else.
If you are on Ubuntu 20.04 then bsdtar was removed. Try to install libarchive-tools package.
$ sudo apt-get install libarchive-tools
I figured it out. My original hypothesis was correct: since vagrant is a tool that was built primarily to be run on linux machines, then vagrant runs in windows, the installation includes a mingw environment with all of the dependencies vagrant needs to function and which the installed vagrant executable imports into the console session when run. This why the dev build kept failing: because it was not importing this mingw environment. So, in order to fix the issue, I first cloned the vagrant source code repo from github and followed the instructions I linked to above to build the executable from the source repo. I then copied all of the files in the source repo into the following folder:
<hashicorp install folder root>\Vagrant\embedded\gems\2.2.6\gems\vagrant-<version num>
So, for me, the destination directory is C:\HashiCorp\Vagrant\embedded\gems\2.2.6\gems\vagrant-2.2.6
This directory is identical to the source code repo, and copying the source code repo to the above folder replaces the installation version of vagrant with the dev build. After I did this, running the vagrant commands which had failed previously normally (as in, without using ruby or bundle) worked. I hope this helps someone else out there who Hashicorp has decided is not worth their time.

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.

mlstate/opa vagrant box installation issue

I stumble upon the OPA framework for Javascript and decided to give it a shot.
Prefering a Vagrant Box, I did as suggested:
vagrant init mlstate/opa
vagrant up
but unfortunately it failed: Allegedly the box file is corrupted as bsdtar.exe couldn't even recognize the format while unpacking it.
What can I do, I need an official OPA Vagrant Box up and running on my Win7 machine to harness it.
I have the same problem on my Mac laptop. Installing the Vagrant Box from Vagrant Cloud does not seem to be working...
In alternative, you can try downloading the box file using the torrent on this link : http://opalang.org/Opa%20vagrant%20box.torrent
Once the box file is downloaded, issue the following commands :
vagrant box add opa-box file:///your_path_to_downloaded_file/opa.box
vagrant init opa-box
vagrant up
vagrant ssh
This works on my machine.
It's because the link leads to a redirect page to Google Drive. Bsdtar cannot open the archive because it's an HTML file. You can download it and add it using imikael21's instructions.
Here's the link it leads to: https://drive.google.com/uc?export=download&id=0B1UEOBxsn2GiN3ZpbFdMek1FNjQ
The attempted link: https://vagrantcloud.com/mlstate/opa/version/1/provider/virtualbox.box

Resources