16

Ran "vagrant up" and did some changes. Want to go back to a clean installation. How do you reset vagrant back to it's original state? Do you run "vagrant destroy" and then "vagrant up" or do you "vagrant box remove" and then "vagrant up"

  • 7
    vagrant destroy && vagrant up should do it. – ceejayoz Sep 24 '15 at 19:27
  • @ceejayoz does it redownload the image? – Albert T. Wong Sep 25 '15 at 19:44
  • I believe it'll cache box files and reuse them. As long as you don't blow away your ~/.vagrant.d/boxes folder it'll be there. – ceejayoz Sep 25 '15 at 19:49
  • @ceejayoz It doesnt cache the file!! if your box file is hosted somewhere outside yor lan, it could take quite a long time to re-download. – Paolo Vigori Jan 25 '17 at 18:30
  • 1
    @PaoloV Ah. My box config is the config.vm.box = "ubuntu/trusty64" sort from the public registry. – ceejayoz Jan 25 '17 at 19:24
16

@ceejayoz's comment is right:

vagrant destroy && vagrant up

worked for me.

  • Yes, destroy (according to the Vagrant book) returns everything back to the pristine state, as if you never ran up in the first place. – Geremia Sep 16 '16 at 21:50
  • 1
    @Geremia but also remove it from local computer so if hosted outside the lan you have to consider that too – Paolo Vigori Jan 25 '17 at 18:31
  • This does not always work: vagrant destroy Vagrant failed to initialize at a very early stage: The plugins failed to load properly. The error message given is shown below. cannot load such file -- vagrant/share – Alexander Nov 9 '18 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.