config.vm.box - Operating System
config.vm.provider - virtualbox (default)
config.vm.network - How your host sees your box (configure ip-address, port)
config.vm.synced_folder - How you access files from your computer
config.vm.provision - What we want to pre-setup like lamp, apache
config.vm.synced_folder ".", "/var/www/html", :mount_options => ["dmode=777", "fmode=666"]
config.vm.synced_folder ".", "/var/www/html", :nfs => { :mount_options => ["dmode=777", "fmode=666"] }
dmode - directory mode fmode - file mode
config.vm.network "private_network", ip:"192.168.33.10"
code /etc/hosts 192.168.33.10 ajk.localhost.io
- Inline Bash Shell Command
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y apache2
SHELL
- Bash Shell File
config.vm.provision "shell", path: "./bootstrap.sh"
box
: manages boxes: installation, removal, etc.cloud
: manages everything related to Vagrant Clouddestroy
: stops and deletes all traces of the vagrant machineglobal-status
: outputs status Vagrant environments for this userhalt
: stops the vagrant machinehelp
: shows the help for a subcommandinit
: initializes a new Vagrant environment by creating a Vagrantfile loginpackage
: packages a running vagrant environment into a boxplugin
: manages plugins: install, uninstall, update, etc.port
: displays information about guest port mappingspowershell
: connects to machine via powershell remotingprovision
: provisions the vagrant machinepush
: deploys code in this environment to a configured destinationrdp
: connects to machine via RDPreload
: restarts vagrant machine, loads new Vagrantfile configurationresume
: resume a suspended vagrant machinesnapshot
: manages snapshots: saving, restoring, etc.ssh
: connects to machine via SSHssh-config
: outputs OpenSSH valid configuration to connect to the machinestatus
: outputs status of the vagrant machinesuspend
: suspends the machineup
: starts and provisions the vagrant environmentupload
: upload to machine via communicatorvalidate
: validates the Vagrantfileversion
: prints current and latest Vagrant versionwinrm
: executes commands on a machine via WinRMwinrm-config
: outputs WinRM configuration to connect to the machine