Vagrant up does not work with VMWare provider - vagrant

I'm using Vagrant on the latest Linux Mint. It works fine with VirtualBox, however with VMWare it fails with this error: sudo helper setuid-wrapper must run as root.
The very few discussions about this issue I found on the net suggested to symlink ~/.vagrant.d to an not encrypted disk. This is what I tried, but unfortunately without any success at all. I also created symlinks for ~/vmware and ~/.vmware, but again without success.
Has anyone come across this error and found a solution?
Thank you very much.

This is still an issue today (Vagrant 1.9.3/Ubuntu 17.04/VMWare Workstation 12.5.5) if using an encrypted homedir. For me, the easiest solution was just to move the vagrant directory onto a non-encrypted filesystem as the OP suggested:
sudo mkdir /vagrant
sudo mv ~/.vagrant.d/ /vagrant/
ln -s /vagrant/.vagrant.d/ ~/.vagrant.d
Running in debug mode I can see the command its trying to run as root exists within the directory I moved:
INFO subprocess: Starting process: ["/home/geoff/.vagrant.d/gems/2.2.5/gems/vagrant-vmware-workstation-4.0.18/bin/vagrant_vmware_desktop_sudo_helper_wrapper_linux_amd64", "prune-forwarded-ports", "/tmp/vagrant-sudo-helper20170422-15385-brgg1q"]
And sure enough after vagrant up the VM now runs. Putting everything under /vagrant like this is a bit of a bodge and you would need to figure out something more elegant if you have more then one user, perhaps /vagrant/$USER. The directory I chose isn't Linux FHS compliant either but who cares ;-)
I wish this worked out the box but perhaps this will help someone

Related

Vagrant VMware Utility driver

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

Vagrant - Bash: Command not found

Looking for some assistance with Vagrant, for what I believe is a Server Variable issue.
I have been trying all weekend to get any kind of Vagrant install up and running. I have followed:
Laravel Homestead installation guide, and
Sitepoint Homestead Vagrant VM guide.
I am using the default folders for install. Whatever I do, after installing Vagrant, I am unable to run 'vagrant up' or vagrant init' because the command 'vagrant' cannot be found (bash: vagrant: command not found). I am trying to execute from the folder with Vagrantfile in it, as suggested by Sitepoint.
I found this Stack Overflow article: Vagrant Command Stopped Working: Command not Found on Windows, but with the current version doesn't work as that bin folder is empty (note that the 'embedded' folder beside it is full, with several 'bin' folders down within the subfolder structure).
I am not familiar enough with Vagrant to know to which folder I should set the server variable, if indeed that is the right answer. It has to be simple, as no sites address this particular issue anywhere. Any assistance will be greatly appreciated.
Win 7, Vagrant 2.1.2, Virtualbox 5.2.14
At the time of writing, Vagrant v2.1.2 is missing vagrant.exe in the i686.msi file.
There are two parts to this answer.
In GitBash, run commands with .\ preceeding the filename(ie .\vagrant up). See earlier comments for the credit for this answer.
Missing executable has been raised as an issue on Github. Without the executable, it, of course, was throwing a command not found error. https://github.com/hashicorp/vagrant/issues/10026?_pjax=%23js-repo-pjax-container
Thanks for your support Rohit.

HHVM with Homestead - HHVM refusing NFS

I'm trying to set up Homestead with VirtualBox and the HHVM option.
My host is Mac OS, and I'm not enabling the nfs option in Homestead.yaml.
However, as soon as I add a Hack file and run hh_client, hh_server dies because it refuses to run on NFS
I understand the rational of not supporting NFS but I'm wondering why is NFS actually involved here, and what could be done to workaround this?
VirtualBox shared folders are effectively a network folder, causing the same problems as NFS. This answer, and my comments on it, explain why hh_server (and thus Hack code) doesn't work on NFS -- the kernel doesn't provide the right inotify events to update its internal state.

Vagrant up fails due to lookup file id_rsa.pub

I have this problem on my machine, vagrant up --provision (suddenly only works with sudo prefix) hangs on the lookup for the file id_rsa.pub.
The file is created, in place, still gives me this error:
I checked this site explaining the error, no match for me
also this stackoverflow question is not relevant
So, why i'am getting this error, even the file is created, in place & exists.
The above error is rooted in the Ansible provisioning, not vagrant specifically. You mentioned that you are running vagrant provision as root, which means the relative path ~/.ssh/id_rsa.pub would be /var/root/.ssh/id_rsa.pub. I would revisit why you are using sudo to run vagrant provision as this is incorrect.
I was due to user access rights mismatch from so many different installs over the years that i had to re-install mac os-x, after that all worked like it should be.
Vagrant was not asking for sudo, no fails during setup Virtualbox.
Everything worked like a charm.

vagrant fails to start up in osx mountain lion

I am using Vagrant version 1.1.5 and virtual box 4.2.22. when i do vagrant up, It fails with the following error
Error: The VM failed to remain in the "running" state while attempting to boot. This is normally caused by a misconfiguration or host system incompatibilities. Please open the VirtualBox GUI and attempt to boot the virtual machine manually to get a more informative error message.
I check the virtual box logs, It says /Applications directory is writable by everyone. So I fixed it by removing the write permission for the work for /Applications directory.
But the problem is the permission gets reset almost daily. I have to redo the above the fix daily to use vagrant. Any body know why this is happening or any direction I could take to fix this ?
Regards
Rajesh
I dont think the issue is to do with the permissions - well probably not... that will probably just be a warning.
Try running vagrant in Gui mode to see if you can see any errors in the VM itself.
http://docs.vagrantup.com/v2/virtualbox/configuration.html
First check if you are able to do
VAGRANT_LOG=debug vagrant ssh
if not the following solution is most probable.
One of the common error is configuration of ssh key .which one the notice using.
VAGRANT_LOG=debug vagrant up
There if you see vagrant looping for ssh key.
you can easily fix that using following commands .
vkey() { sudo chown "$*":staff ~/.vagrant.d/insecure_private_key;
vkey <new_owner_username>
here vkey() is the zsh function.
credits: https://superuser.com/questions/612376/vagrant-vm-fails-to-boot
-let me know if problem still exists
Cheers

Resources