[vagrant][chef] chef missing shared folder
Today I found issue after upgrading my virtualbox. I was using vagrant with chef as provisioner. after upgrading virtualbox and VBoxGuestAddons, and updating some component on cheffile, my chef provisioner returning error that Chef missing shared folder.
The error message is looked like this:
1 2 3 4 5 6 |
==> default: Running provisioner: chef_solo... ==> default: Detected Chef (latest) is already installed Shared folders that Chef requires are missing on the virtual machine. This is usually due to configuration changing after already booting the machine. The fix is to run a `vagrant reload` so that the proper shared folders will be prepared and mounted on the VM. |
then after googling for a while, I got the solutions. the problem is, vagrant cached the synced folder settings, after upgrading VirtualBox, this cache should be invalidated. To invalidate the cache, just run this command from your vagrant directory (The directory where your vagrantfile lies)
1 |
rm .vagrant/machines/default/virtualbox/synced_folders |
and re-run the provisioner
1 |
vagrant reload --provisioner |
solved, that’s how to solve when Chef missing shared folder when you re-run provisioner after upgrading virtualbox