Tools of the trade: vagrant-scp

For this first quick tip, I chose vagrant-scp; it is the “cousin” of vagrant-ssh, and there are many use cases when you need to copy to or from a virtual machine defined in Vagrant, vagrant-scp can help you achieve that task with ease.

Assuming your VM lives on /home/johndoe/vagrant/roboxesubuntu1604, the installation steps are:

cd /home/johndoe/vagrant/roboxesubuntu1604
vagrant plugin install vagrant-scp

vagrant-scp in action

Send files to the VM:

vagrant scp myphpproject.tgz roboxesubuntu1604:/var/www/html

Retrieve files from the VM:

vagrant scp :/backups/mysql.tgz /home/johndoe/backups

Vagrant-scp is such a convenient tool to have. I made it part of my daily workflow, and hopefully, it will help someone out there.