What is Vagrant? Vagrant is the command line utility for managing the lifecycle of virtual machines. Isolate dependencies and their configuration within a single disposable and consistent environment.
Vagrant is a tool for building complete development environments. With an easy-to-use workflow and focus on automation, Vagrant lowers development environment setup time, increases development/production parity, and makes the "it works on machine" excuse a relic of the past.
vagrant validate
- This command validates your Vagrantfile.vagrant up
- Start all VMs using Vagrantfile (please enter into vagrant-cluster/ folder before run this command)vagrant status
- Check the status of the VM'svagrant ssh vm
- Open ssh on target VMvagrant destroy
- Destroy specific instance or destroy all instances, without VM namevagrant suspend
- A suspend effectively saves the exact point-in-time state of the machine, so that when you resume it later, it begins running immediately from that point, rather than doing a full boot.
You need to transfer file or folder from your PC to Vagrant host and you need a solution. Here some good example summirized :
-
Using vagrant plugin :
vagrant plugin install vagrant-scp
vagrant scp /data/examples/spring-boot webserver:/home/vagrant
vagrant scp <some_local_file_or_dir> [vm_name]:<somewhere_on_the_vm>
-
Using classic scp command (findout the correct forward port in Virtualbox VM Settings > Network > First adapter > Forwarderd port) :
- File :
scp -P 2222 /data/examples/spring-boot/gs-spring-boot-master.zip [email protected]:/home/vagrant
- Folder :
scp -P 2222 -r /data/examples/spring-boot [email protected]:/home/vagrant
- File :
-
Using Vagrantfile provisioner