Welcome to the Treehouse Community
Looking to learn something new?
Hai Le Quang5,855 Points
Could you explain the difference between "vagrant halt" and "exit"?
I believe exit is the same as Ctrl-C, closing the connection to server? But Jason already use Ctrl-C before, so what's the point of "exit"?
Merritt Lawrenson13,477 Points
'exit' is the command that exits the virtual machine and brings your command line back to your local computer. At that point you have to run 'vagrant halt'. You can't halt vagrant before you exit the virtual machine because otherwise the virtual machine itself is looking for vagrant to shut down, but vagrant is running on your computer, not the vagrant's virtual machine. If you don't exit the virtual machine and halt vagrant (just closing the terminal window, for instance), then the virtual machine keeps running in the background. There's nothing wrong with that, especially if you intend to come back and work again shortly, but if you don't shut your vagrant virtual machine down it will keep using your memory and cpu in the background.
Kristopher Van SantCourses Plus Student 18,830 Points
I'm not sure what you mean by exit. Ctrl-C is used to "exit" out of things, but this would be for exiting out of something like NPM or Grunt, which means you'd be stopping the web server. If you close out of the terminal vagrant is still running. Vagrant halt, however, shuts down the machine.