Now that we have a configured vagrant file we can go ahead and start our
vagrant box on our machine you use vagrant by using the terminal or the git
bash and you can start the vagrant server for our project by changing to
our project location so that's the root of our project and typing vagrant up
what this will do is it will download the base image that we've specified in
our vagrant file and then it will use VirtualBox to create a new virtual
machine and then run our provisioning script when it stars the machine we can
then use our development server and connect to it using the vagrant tool
which I'll show you right after the machine has been created
once the vagrant box has been started we can then connect to the vagrant server
by using the vagrant SSH command since our box is a completely different
isolated box on our machine so it's a guest operating system we need to
connect to it using SSH the way that you do this is you type vagrant SSH and then
vagrant will handle the connection to the machine for you you can see that
you're on the machine because the input changes for your git bash or your
terminal window you can see that we're now on vagrant at Ubuntu Bionic to
disconnect from the machine simply type exit and this will take you outside of
the machine back onto your local machine so if you type vagrant SSH and you
connect to the machine any command that you run in the terminal while you're
connected to the machine will be ran on your guest operating system or the
development server instead of your local machine okay so that's how you connect
to the server with vagrant