Copy file from host to vagrant


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


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

$ vagrant ssh-config
Host default
  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@

Taken from the answer here