Vagrant + Chef: Error in provision “Shared folders

2019-03-08 03:06发布

I've installed a Vagrant + Virtualbox using Chef (+library chef). When I do vagrant up first time, cookbooks get loaded correctly. However, when I do provision afterwards (be it vagrant provision, vagrant reload --provision or vagrant up --provisionI get this error:

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.

I searched everywhere and the only solution given is to do vagrant reload --provision, this worked up up to Vagrant 1.3.1.

2条回答
孤傲高冷的网名
2楼-- · 2019-03-08 03:52

That's a fairly common issue with the Vagrant plugins for both Berkshelf and Librarian. Just get used to running that command.

The way to avoid it is to use something like Test-Kitchen instead of the Vagrant plugins. That isn't a drop-in replacement though.

查看更多
贪生不怕死
3楼-- · 2019-03-08 03:53

it seems like there is a bug with sync folders, this clears the cache and fixed it for me. (from your project directory)

rm .vagrant/machines/default/virtualbox/synced_folders
vagrant reload --provision

https://github.com/mitchellh/vagrant/issues/5199

EDIT: this should be fixed in vagrant 1.7.4

查看更多
登录 后发表回答