Vagrant stopped synching folders after upgrades - vagrant

I recently upgraded Vagrant to 1.8.4 and upgraded VirtualBox to 5.0.22 (Not sure if it is related) but Vagrant stopped synching my folders. I tried to downgrade and destroy and recreate the box but the problem remains.
When I run vagrant rsync-auto I get the following response:
There are no paths to watch! This is either because you have no
synced folders using rsync, or any rsync synced folders you have
have specified `rsync_auto` to be false.
This is what I have in my config.yml:
...
vagrant_synced_folders:
# The first synced folder will be used for the default Drupal installation, if
# build_makefile: is 'true'.
- local_path: ~/vagrant/xmd8/www
destination: /var/www
type: nfs
create: true
...

I downgraded to Vagrant 1.8.1 and ran vagrant reload on my vagrant box and that fixed my issue.
I believe I tried vagrant reload when on Vagrant to 1.8.4 but I could be wrong.

I had used 1.9.3 (I think) and rsync-auto worked, but some native syncing didn't for a codebase that was ported from Windows. So we had to use rsync for that.
I recently tried 1.9.7 and rsync-auto no longer worked and the native syncing still didn't work.
1.8.6 has functioning native vagrant syncing for the codebase that was from windows. This is the only version we have tried that actually works with the specific codebase (native syncing and not having to use rsync)
Adding this so that it ends up helping someone (which will probably be future me when my computer crashes again and I need to set up another new one).

Related

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 2.1.3 doensn't see plugin disksize

I upgraded from ubunutu 16 to Ubuntu 18.04.1 desktop (what i really did was reinstalled ubuntu, because i kinda destroy my system) yesterday, and now i want get vagrant back up and running, the problem is that vagrant doesn't recognize the plugin disksize any more. It is installed as you can see (with vagrant plugin list) but vagrant doesn't see it.
keep on getting * Unknown configuration section 'disksize'.
I also tried installing a older version of vagrant (1.8.5) but it looks like that doens't work with the new virtualbox (doesn't recognize the provider).
i saw the post Vagrant: * Unknown configuration section 'disksize' but that is the way i installed disksize so that doesn't help.
if more information is required let met know.
Today I updated both virtualbox and vagrant to their latest versions. Had the same problem like you just different plugin.
After downgrading vagrant to 2.10 it works again, no issue with virtualbox (no need to downgrade). Hopefully vagrant will fix this with its new release.

Vagrant was unable to mount VirtualBox shared folders error

This is my error and I couldn't fix it. I need help, my virtual box is on the lastest version.
The list of vagrant plugins:
I tried to update them but every time I restart my vagran, they get the default version. What do I need to do?
At the time of writing this, the latest version of VirtualBox (5.1.16) on Windows is having problems mounting any drives from Vagrant, and the only solution so far is to wait for an update that resolves this, or manually downgrade VirtualBox to 5.1.14.
There's more information about other people having similar problems in this GitHub issue: https://github.com/laravel/homestead/issues/510
You can update to the 5.1.18 version. It works in this version

Vagrant Phalcon variable $PTOOLSPATH is outdated

I'm installing the Phalcon Vagrant box through the official github documentation but I always stumble upon the same message:
vagrant#phalcon:/vagrant/www$ phalcon commands help
Your environment variable $PTOOLSPATH is outdated!
Current value: /opt/phalcon-tools
New value: /usr/bin
Exit.
Link to guide: Vagrant Phalcon Instructions
Why am I getting this error message?
This message prevents me from using the Phalcon dev-tools.
Things I've tried:
Re-install vagrant box
Update Vagrant to latest version
Update VirtualBox to latest version
Information about my system and software:
Vagrant 1.9.1
VirtualBox 5.1.12 r112440 (Qt5.6.2)
Windows 10 64-bit
[EDIT: This has been fixed in this commit: link to github commit]
The offical repository contains a bug that linked to the wrong file when using "phalcon commands".
The issue can be solved by editing the init.sh file in the cloned repository and changing ln -s /opt/phalcon-tools/phalcon.sh /usr/bin/phalcon to ln -s /opt/phalcon-tools/phalcon.php /usr/bin/phalcon
I also added chmod ugo+x /usr/bin/phalcon after this line (just to be sure). And behold it works now!
Keep in mind, for ease of use these changes need to be addressed before doing "vagrant up".

Vagrant synced folder type NFS with windows 10 error

I upgraded from Windows 8 to Windows 10, and I've solved many problems with this github issue:
https://laracasts.com/discuss/channels/general-discussion/windows-10-vagrant-virtualbox-homestead
But when I call vagrant up, vagrant says:
vagrant requested NFS version or transport protocol is not supported
My vagrantfile:
config.vm.synced_folder "data", "/vagrant", type:"nfs"
When I remove type: "nfs" it's work but I need that to speed up my vm....
Any ideas?
I had the same trouble - and have gone back to Windows 8.1 until I know this is resolved.
However, have you checked that your Vagrant installation under W10 has the winnfsd plugin installed?
Try:
vagrant plugin list
to see if it is installed.
If not,
vagrant plugin install vagrant-winnfsd
will install it.
Can't guarantee anything, but it's a useful first step.

Resources