Table of Contents
Working with vagrant almost always means working on the command line. You really need to be comfortable working on a terminal window. Invoking the vagrant command shows a help file which also lists the most common commands like box, init, destroy, halt etc. Most of these commands though have their own sub-commands. It could be confusing at first but as you work with vagrant and get familiar with it, you’ll find that the commands (and sub-commands) are structured quite sensibly.
Let’s try out our first command.
vagrant box list
The command above will show you all the boxes you already have downloaded in your machine. Nothing will show up if you have just installed vagrant, so let’s get our first box.
![]() | Note |
---|---|
A box is some sort of an operating system image. If you have performed complete disk backups of your operating system before, a box is similar to that. It is a snapshot of an operating system. Snapshots are taken and saved typically because you would like to restore them at a later time, either on the same hardware or a different one. |
To get an existing box, we’ll use the vagrant box add command. The structure of that command looks like the one below
vagrant box add [what you want to call it] [url of box]
So, for our first box, we’ll get a 32 bit ubuntu box, we will call it precise32.
vagrant box add precise32 http://files.vagrantup.com/precise32.box