#Vagrant
Creates and downloads if necesary a vm with Ubuntu 12.04 LTS
vagrant init hashicorp/precise32Runs the VM of current directory
vagrant upTo check the status of a vm:
vagrant statusTo stop the VM
vagrant haltStops the VM and starts it again
vagrant reloadSuspend VM stores guest RAM on host disk and frees the resources
vagrant suspendTo restore the suspended VM
vagrant resumeConnects to current directory vm
vagrant sshTo delete the VM
vagrant destroyPrints current running vms
vboxmanage list runningvms##Vagrantfile To not run headless, uncomment
vb.gui = trueThis will open a Virtual Box window when running the vm, the user and password are vagrant
To forward ports from guest to host
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "forwarded_port", guest: 80, host: 8080, id: "nginx", guest_ip: "X.X.X.X", host_ip: "X.X.X.X", protocol: "udp", auto_correct: trueAuto correct parameter fixes protocol collisions
###Provisioning To declare provisions on Vagrant file:
config.vm.provision "shell", path: "provision.sh"Provisions are called on VM creation, but not subsecuent calls (ups), to force them use:
vagrant provision