WEBVTT

00:06.330 --> 00:09.790
There are more commands to manage vagrant boxes.

00:09.810 --> 00:15.540
As you might remember, I've already typed a command to add vagrant box.

00:15.540 --> 00:20.070
The add sub command allows you to add a new box.

00:20.070 --> 00:24.540
It makes a single argument and a number of optional flags.

00:24.540 --> 00:29.610
The argument is a name your URL or path to a box file.

00:29.610 --> 00:34.640
If a name is provided, Vagrant will download the box from Vagrant Cloud.

00:34.650 --> 00:43.280
If we provide a URL or path to a box stored elsewhere, we need to give Vagrant a name to use.

00:43.290 --> 00:48.360
This is provided with this dash name optional flag.

00:48.360 --> 00:57.240
Some other optional flags that might be used include force, which will tell Vagrant to remove a preexisting

00:57.240 --> 00:59.040
box with the same name.

00:59.040 --> 01:07.290
Another flag is clean, which will tell Vagrant to clean any temporary downloaded files and provider

01:07.290 --> 01:12.590
flag, which allows us to specify another provider.

01:12.600 --> 01:17.250
As you might remember, the default provider is virtual box.

01:17.250 --> 01:22.670
However, you can use any other available providers like Hyper-V.

01:22.680 --> 01:31.500
Now let's add a Hashicorp slash size 64 box to our vagrant environment.

01:31.500 --> 01:39.330
I'll type vagrant box add and the name of the box Hashicorp slash brew size 64.

01:39.360 --> 01:45.920
Now let's list the boxes with lists of command and file type vagrant box list.

01:45.930 --> 01:54.810
Now the boxes might be regularly updated and we can use the outdated sub command to see whether there

01:54.810 --> 01:56.400
are updates available.

01:56.400 --> 02:05.070
I'll type vagrant box outdated and the output will be that the vagrant is checking if the box you need

02:05.070 --> 02:06.280
is up to date.

02:06.280 --> 02:13.800
In this case, CentOS version 19 02.01 is up to date.

02:13.830 --> 02:21.780
Of course you can remove the boxes as you might remember, with remove sub command and update the current

02:21.780 --> 02:23.400
environments box.

02:23.400 --> 02:29.250
With the update sub command you could type vagrant box update.

02:29.280 --> 02:37.020
Alternatively, we can update a specific box which isn't tied to the current environment using the slash

02:37.020 --> 02:37.650
slash.

02:37.650 --> 02:42.230
Sorry, there's this flag to provide the name of the box.

02:42.240 --> 02:50.190
Now once you start several environments in different projects, you need to know which projects are

02:50.190 --> 02:54.720
running, which boxes are suspended or stopped.

02:54.750 --> 03:01.290
As you might remember, to check the status of the box, you should use vagrant status.

03:01.290 --> 03:07.320
Let's type it and you'll get the status of the current project box.

03:07.320 --> 03:16.470
But if there are several projects and several boxes, you should use Vagrant Global Status Command to

03:16.470 --> 03:21.000
check all the projects and boxes running on your machine.

03:21.000 --> 03:24.780
Let's type it Vagrant Global status.

03:24.780 --> 03:33.090
And in this case we'll get the idea of the box, the name of the box provider and state, and the directory

03:33.090 --> 03:36.500
in which this box is currently running.

03:36.510 --> 03:44.330
Now you can copy the idea of the box and suspended or destroy it or start it.

03:44.340 --> 03:54.210
So I'll type the command vagrant to find the option which we can use with this box ID as an example,

03:54.210 --> 04:04.530
Let's say that we want to reload this box, so I'll type vagrant, then I'll copy the ID and type reload

04:04.530 --> 04:10.970
and after a low tile paste the idea of the box I want to reset.

04:10.980 --> 04:19.500
If you don't need this box anymore, you can type vagrant destroy and the idea of the machine you don't

04:19.500 --> 04:20.370
need anymore.
