Easiest way to copy a single file from host to Vagrant guest?

前端 未结 19 1731
暖寄归人
暖寄归人 2020-12-22 15:15

I have a use case where I occasionally want to copy a single file from my host machine to the Vagrant guest.

I don\'t want to do so via traditional provisioners (Pup

19条回答
  •  失恋的感觉
    2020-12-22 15:26

    If someone wants to transfer file from windows host to vagrant, then this solution worked for me.

    1. Make sure to install **winscp** on your windows system
    2. run **vagrant up** command
    3. run **vagrant ssh-config** command and note down below details
    4. Enter Hostname, Port, Username: vagrant, Password: vagrant in winscp and select **SCP**, file protocol 
    5. In most cases, hostname: 127.0.0.1, port: 2222, username: vagrant, password: vagrant.
    

    You should be able to see directories in your vagrant machine.

提交回复
热议问题