

However, I personally find myself simply checking the list inside VirtualBox, more out of habit than running / remembering yet another command. Vagrant status can be used if you are unsure what the current status of your available virtual machine is. Once a vagrant machine has been suspended, to resume you would run: This comes in handy more often than you might think. The advantage of this is that you can pause your server whilst it is doing something. Think of this like shutting the lid on your laptop - as soon as you open the lid again, your machine is up and running without needing to boot. This takes extra disk space on your local / development machine. Vagrant suspend also stops the running machine exactly where it is and also saves the entire contents of the RAM of the virtual machine also. Once the machine is powered down, the underlying virtualbox files remain on your hard disk until next required.

This is like holding down the power button on your physical machine. Which, as the command would imply, forces the shutdown regardless. If the machine can't gracefully / cleanly shut down, you can instead do a : Vagrant halt shuts down the Vagrant machine - as though you shut down the machine cleanly, for example running a sudo shutdown now from the terminal in Ubuntu. There are two ways to 'stop' a running Vagrant machine. Simple :) Shutting Down A Running Vagrant Machine You've done your vagrant up and then jumped on to your shiny new box with vagrant ssh.īut how do you exit your vagrant box, back to your dev machine? The following are the important commands I think all Vagrant users need to know about. Thin provisioning may work the same for other Providers, but I have no experience with them so can't say for sure. The numbers sound inconsequential given todays hard disk capacities, but if left unchecked, it can add up. However, if you spin up multiple instances of the same box, each one will consume that ~2.5gb minimum, and the box file itself will be ~500mb on average. We will only consume more space - up to 20gb - as we write files to our VM. This is a fancy term for saying that should we ask for a brand new Ubuntu server with a 20gb drive, the underlying file that really contains our server may only use ~2.5gb of space on disk. The virtual machines that Vagrant creates for us, assuming you are using VirtualBox or VMWare, should be thin-provisioned. This is pretty important if you are using a busy laptop with a relatively small hard disk (MBP users, I feel your pain.) In this video we will cover a few commands to manage your Vagrant environment, and recover disk space you may have entirely forgotten about. Before we move on, it's important to keep your Vagrant setup in check.
