I am trying to transfer files from my Host OS (Windows 7) to Guest OS (CentOS) running on VirtualBox.

I tried using pscp but it gives the error: More than one remote source not supported

I tried ftp but it doesn't connect and I don't know why.

migrated from stackoverflow.com Aug 16 '12 at 22:25

This question came from our site for professional and enthusiast programmers.


You can install Guest Additions: http://www.virtualbox.org/manual/ch04.html

and then use Shared Folders: https://forums.virtualbox.org/viewtopic.php?t=15868


You can do it with "scp" command, then the ssh daemon (sshd) has to be running on the Windows box as well.

Or use one of the windows scp clients to talk to the centos VM. You can transfer files either way using scp.

  • 1
    how do you identify the IP and credentials of the guest machine for the scp command? – ted.strauss Jan 7 '14 at 19:25

I have the exact same setup (Windows 7 Host OS, CentOS 6.5 Guest OS)...

(if you have SSH working on an IP address for CentOS, then you can skip this paragraph below)
I set Virtualbox to use bridged network adapter (Settings > Network > Adapter 1: set to bridged) and after installing Apache (set a hostname, and also turn off firewall with: service iptables stop). You can view the IP address given to you with ifconfig eth0 or narrow the ouput with ifconfig eth0 | grep 'inet addr' | awk '{print $2}'. This is the IP address that should also be in your /etc/hosts file on the same line with your hostname. For testing purposes, put an index.html file in /var/www/html (your web root). Then you should be able to browse to the VM at a local IP address: 192.168.x.x from a browser on your Windows 7 OS.

To transfer files back and forth, you can use WinSCP on your Windows 7 host OS. Create a new session with these settings in WinSCP:

File protocol: SFTP (this means you will be connecting via SSH)
Host name: 192.168.x.x (this is the ip address of your VM)
User name: root
Password: (leave this blank for security reasons...
           but when prompted during connecting you'll enter your root password 
           you set for CentOS)
Private Key file: (leave blank...you will be prompted to say 'yes' to accept the key)

You can use Samba for transferring files. Just install Samba, and then choose the Host OS and then the OS where the files are to be transferred.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy