I made changes to my Vagrantfile (added config.vm.share_folder
, config.vm.customize
lines) and now I want them to show up on the box. Do I need to run
vagrant destroy && vagrant up
Or is it sufficient to run
vagrant reload
? I am unclear about whether vagrant reload will read anything from the Vagrantfile, since it seems to shutdown the VM and run the provisioner.
Explore the synced folder Tip: When you vagrant ssh into your machine, you're in /home/vagrant , which is a different directory from the synced /vagrant directory. Believe it or not, the Vagrantfile that you see inside the virtual machine is actually the same Vagrantfile that is on your actual host machine.
Command: vagrant status [name|id] This will tell you the state of the machines Vagrant is managing. It is quite easy, especially once you get comfortable with Vagrant, to forget whether your Vagrant machine is running, suspended, not created, etc. This command tells you the state of the underlying guest machine.
I don't think you need to destroy your VM. You can make changes to VM configuration when the VM is not running and powered down.
Try using vagrant halt
and then vagrant up
.
It should make the modifications to the VM as specified in Vagrantfile.
and you could also do vagrant up --no-provision
to avoid re-provisioning as you bring up the VM.
and vagrant reload [vm-name] --no-provision
should do the same trick.
vagrant reload
is same as running vagrant halt
followed by vagrant up
please refer the doc for reload. Here is an excerpt from the doc
"This command is usually required for changes made in the Vagrantfile to take effect. After making any modifications to the Vagrantfile, a reload should be called." So in your case, I would suggest you to only use,
vagrant reload
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With