Deep Into

You have the possibility to create your own box ,create a a new dir or go to an existing project folder , do vagrant init , this will create a vagrantfile , this file is your box configuration file , just like the homestead.yaml we see before.

If you dont want to have the work of building a virtual machine from scratch vagrant have a base box that you may want to use , precise32.

vagrant box add hashicorp/precise32

Now to use it edit the vagrant file

Now you can vagrant up and ssh your box with vagrant ssh

If you want the same environment on all your team members machine this file cant be ignored by the version control system used to control the versions of yours projects.

This is why Vagrant agile your software development life cycle , one configuration file , multiple machines , a start up command and we spare multiple hours and errors.

Multiple Sites

We dont need to create a box to every project , we can use Homestead sites to handle with xNumber of projects ,we just need to add an entry on sites configuration on the yaml fille.

  1. Add another entry to /etc/hosts with the box ip
  2. Add another site configuration to map your application with the host

Vagrant Available commands

When you look at the list of available commands, it’ll look a lot like what you had available through vagrant:

  • box manages boxes: installation, removal, etc.
  • connect connect to a remotely shared Vagrant environment
  • destroy stops and deletes all traces of the vagrant machine
  • global-status outputs status Vagrant environments for this user
  • halt stops the vagrant machine
  • help shows the help for a subcommand
  • init initializes a new Vagrant environment by creating a Vagrantfile
  • login log in to HashiCorp's Atlas
  • package packages a running vagrant environment into a box
  • plugin manages plugins: install, uninstall, update, etc.
  • port displays information about guest port mappings
  • powershell connects to machine via powershell remoting
  • provision provisions the vagrant machine
  • push deploys code in this environment to a configured destination
  • rdp connects to machine via RDP
  • reload restarts vagrant machine, loads new Vagrantfile configuration
  • resume resume a suspended vagrant machine
  • share share your Vagrant environment with anyone in the world
  • snapshot manages snapshots: saving, restoring, etc.
  • ssh connects to machine via SSH
  • ssh-config outputs OpenSSH valid configuration to connect to the machine
  • status outputs status of the vagrant machine
  • suspend suspends the machine
  • up starts and provisions the vagrant environment
  • version prints current and latest Vagrant version

results matching ""

    No results matching ""