Copy file from host to vagrant

Problem

You would like to quickly copy a file from the local host to the vagrant machine.

Solution

Find the private key, ssh and IP port with ssh-config:

$ vagrant ssh-config
Host default
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile /path/to/private/key
  IdentitiesOnly yes
  LogLevel FATAL

Copy the file using the private key as a parameter to scp:

scp -P 2222 -i /path/to/private/key /path/to/file vagrant@127.0.0.1:~

Taken from the answer here