Vagrant is awesome. However, there’s one thing that really annoys me. Why in the world does it set up a default shared folder when no one asks it to. After some googling, I found out that all you have to do is to add the following line in your Vagrant file.
Vagrant.actions[:start].delete(Vagrant::Action::VM::ShareFolders) # <--add this line
Vagrant::Config.run do |config|
Unfortunately, there’s one more gotcha. The first time I ran
vagrant up, it crapped out on me and spilled out the following stacktrace.
/opt/vagrant/embedded/gems/gems/vagrant-1.0.6/lib/vagrant/action/builder.rb:87:in `delete_at': no implicit conversion from nil to integer (TypeError)
from /opt/vagrant/embedded/gems/gems/vagrant-1.0.6/lib/vagrant/action/builder.rb:87:in `delete'
from /home/lih/.vagrant.d/boxes/lucid32/include/_Vagrantfile:6:in `<top (required)>'
from /home/lih/.vagrant.d/boxes/lucid32/Vagrantfile:11:in `load
I sidestepped the above issue by surrounding it with begin and rescue.
print "Trying to get rid of the default shared folder. It's normal that this fails the first time when the vm is booted up. Ignore and proceed."
Hopefully, you’ll find this helpful. Enjoy.