Vagrant Cheatsheet
Vagrant commands
- vagrant init, destroy
- vagrant up, halt
- vagrant suspend, resume
- vagrant provision - manually triggger, else only happens on UP
- vagrant reload - remember this whenever config changes made
- vagrant login - log into vagrantcloud (Atlas)
- vagrant share - do form folder with Vagrantfile
- vagrant share --ssh (password protected TLS share, expires ~ 1hr)
- vagrant connect --ssh name-of-share (client does this to connect to your vbox)
- vagrant status
- vagrant global-status (list ALL vms status anywhere on system)
Virtualbox commands (ignore if using vmware or parallels)
- vboxmanage list vms
- vboxmanage list runningvms
Reusing provisioning
- Shell / File / CM Tools (puppet, chef, ansible, salt, docker)
- these provisioner can be mixed and matched, run in order specified
- provisioning runs on UP only, or
vagrant provision
, vagrant reload --provision
vagrant up --no-provision
- box is pre-provisioned with OS and tools
- create your own boxes with vagrant or packer
vagrant box
add, list, remove
- use dpkg (Debian) to check if installed before apt-get installing
- use command to check if npm module installed
-
Vagrant Synced Folders
- rsync - use
rsync-auto
on vagrant box to watch for changes
- NFS, plugins can be used too
Vagrant Packages
vagrant package <vmname> --output <boxname>
- only works with virtualbox VM currently
vagrant box
- use packages, wildcards:
vagrant up /mongo*/
example files