2

I am pretty new to vagrant. I have installed an ubuntu 14.04 trusty box on my vagrant and will use it for my web development environment. I want to know which is the best way to disable/close/shutdown a vagrant box so that data in it remain safe in the next session? I mean when I want to shutdown my laptop (in windows 10, my host machine os is win10) there is a message telling me that virtualbox interface is open. so if I close the process then I cant access vagrant box anymore. I want a good way to close vagrant and run it in my next working session.

I read about vagrant halt before host shutdown and using vagrant up in next session but it takes too long to run a vagrant up.

**summary : I WANT A WAY TO DO THIS:

1- close a vagrant box without a data loss in it;

2- shutdown my laptop without seeing the message that tells virtualbox interface is open.

3- run vagrant box and access it with putty as fast as possible when I start working again.

is there a way to do this?**

thanks.

1 Answers1

1

I want to know which is the best way to disable/close/shutdown a vagrant box so that data in it remain safe in the next session

I would not necessarily to recommend vagrant halt which will completely stop your VM and will need to start up after you restart your host.

You can run vagrant suspend which will hold your data and you will retrieve your instance in the same state as it was before on your next startup

You can read more about the differences between halt and suspend

Community
  • 1
  • 1
Frederic Henri
  • 51,761
  • 10
  • 113
  • 139
  • is it something like hibernate in windows? then virtual box interface message wont show up? if so, then what command is used to restore last session? – mohammad fallah.rasoulnejad Mar 05 '17 at 13:59
  • yes its exactly like hibernate in windows - you restore the session by running `vagrant up` (same as if vagrant was halted, in the case of suspend, vagrant will detect it was suspended and will restore) – Frederic Henri Mar 05 '17 at 16:11