BugHunterUK
BugHunterUK

Reputation: 8948

Why does Vagrant require you to reinstall a plugin after running vagrant destroy?

I'm using the Vagrant SSHFS plugin instead of rsync. I installed the plugin:

vagrant plugin install vagrant-sshfs

Below is my Vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.box = "debian/jessie64"
  config.vm.synced_folder "./live-build", "/home/vagrant/live-build", type: "sshfs"
  config.vm.provision "shell", path: "./provision/setup.sh"
  config.vm.provision "shell", path: "./provision/build.sh"
end

When I run vagrant up the host live-build directory is linked, and I can see the files from the guest.

Now if I run: vagrant destroy and then vagrant up synced_folder tries to default to rsync which results in the following error:

Host path: /Users/jake/OZYProject/
Guest path: /vagrant
Command: "rsync" "--verbose" "--archive" "--delete" "-z" "--copy-links" "--no-owner" "--no-group" "--rsync-path" "sudo rsync" "-e" "ssh -p 2222 -o LogLevel=FATAL  -o ControlMaster=auto -o ControlPath=/var/folders/lp/qxycffd53lxdhbhvy34lymrh0000gn/T/ssh.180 -o ControlPersist=10m  -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i '/Users/jake/OZYProject/.vagrant/machines/default/virtualbox/private_key'" "--exclude" ".vagrant/" "/Users/jake/OZYProject/" "[email protected]:/vagrant"
Error: symlink has no referent: "/Users/jake/OZYProject/whonix-live-build/config/hooks/0010-disable-kexec-tools.hook.chroot"
...

What's strange is the plugin is already installed:

vagrant plugin list
vagrant-share (1.1.6, system)
vagrant-sshfs (1.3.0)
vagrant-vbguest (0.14.2)

If I attempt to install vagrant plugin install vagrant-sshfs (even though it's already installed) and retry vagrant up it will install correctly using sshfs. It seems I have to install vagrant-sshfs after running destroy.

Is this normal?

Upvotes: 0

Views: 677

Answers (1)

Frederic Henri
Frederic Henri

Reputation: 53733

It seems the issue appears for the default /vagrant folder, you can disable this folder by adding the following in your Vagrantfile

config.vm.synced_folder ".", "/vagrant", disabled: true

Upvotes: 1

Related Questions