How Do You Share Files Between an Oracle VirtualBox Linux Guest and a Windows Host without Using vboxsf?

Problem scenario:  You have Oracle VirtualBox running on a Windows 7 computer as the host.  You have a Linux CentOS guest supported by Oracle VirtualBox.  You want to have a file share that does not rely on vboxsf.  What do you do?

1.  On the Windows host desktop, create a folder.  For this example, we'll use "foobar" for the name.
2.  Right click this new folder,  go to "Properties" -> "Sharing" -> "Advanced Sharing..."
3.  Check the box for "Share this folder" then click "OK"
4.  Open a command prompt and run "ipconfig" to know the IP address.
5.  Go to the Linux guest, install the Samba client (as root, run this command: yum -y install samba-client).  
6.  Run this command:

smbclient // -U jdoe

# This assumes that "foobar" is the name of the folder created in step #1.
# This assumes is the IP address found in step #4.
# This assumes jdoe is a username of the Windows host.  
# Replace foobar, and jdoe accordingly.

7.  Enter the password for the jdoe user.
8.  Now files you create in the folder in step #1 will be viewable in your Linux guest. 
9.  You are done.  This "step" simply provides basic usage tips of the smb prompt.  At the smb: prompt you can create directories that will appear on the Windows host.  You can use get foo.txt to retrieve from the Windows host a file named foo.txt (assuming it is in the folder that was created in step #1).  You can use put contint.txt to transfer a file named "contint.txt" from the Linux guest (assuming it exists in the directory you issued the command in step #6) to the Windows host (specifically to the folder that was created in step #1).

Leave a comment

Your email address will not be published. Required fields are marked *