how to copy files from virtual machine to local machine in Linux.  sometimes we need to copy files from host machine to virtual machine or vice versa. In this blog post we are going to learn two methods for copying files and folders between host machine to guest machine or from guest machine to host machine.

(Method 1) how to copy files from virtual machine to local machine

how to copy files from virtual machine to local machine

Finally after selecting both option from setting menu press ok. This allows you to drag and drop files between the host and guest machines.

(Method 2) how to copy files from virtual machine to local machine

Sometimes virtualbox behaves abnormal and drag’n drag does not work. In this case we will use scp method to copy from guest to host or from host to guest.

From guest to host copy using scp

  • Open Linux terminal of host machine.
  • Run command ifconfig.
  • From if command output find ip of host machine.
  • Find user name of host machine using echo $USER.
  • Go to guest machine and open linux terminal.
  • Run command ‘scp /pathtofiletobecopy hostname@ipaddresshostmachine:/pathfordestinationfolder’

From host to guest copy using scp

 

  • Open Linux terminal of guest machine.
  • Run command ifconfig.
  • From if command output find ip of guest machine.
  • Find user name of guest machine using echo $USER.
  • Go to host machine and open linux terminal.
  • Run command ‘scp /pathtofiletobecopy guestmachineuser@ipaddressofguestmachine:/pathfordestinationfolder’

 




Related Contents to follow