How to transfer files from Host OS to guest OS running on VirtualBox?

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.


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)