# Filesharing with FreeBSD 10.x as Virtualbox Guest on Win7-64bit Host



## Kurt Ludikovsky (Apr 8, 2015)

After several days of trial and error, reading dozens of hints I am not able to solve my challenge.
*The challenge*
Getting filesharing to work between a:
win7-64 Home Premium host (4 CPU / 8GB)
and a virtualized FreeBSD 10.1 64 bit Guest
using Virtualbox 4.3.26

In addition Copy & Paste between the host and the Guest Console (not GUI) would be helpful as well.
Drag & Drop would be just nice add-on.

To save me further searching without any success I would like to you could help me clarifying
*My Questions:*

Is this possible at all?
With 10.x
if not:  with 9.3+

What needs to be done (Step by step HOW TO would be nice)
Using the standard tools/extensions (Guest Extensions (OSE), etc)
An alternative with Samba
Other alternatives giving file sharing locally (means within my machine; No Dropbox, Cloud, etc.)

How to do copy & paste from the host to the console (keystrokes, etc.)
*What I don't need:*

Hints to use different Virtualisation, OS's, etc.
Manual solutions (winscp, GUI based, etc.)
Assumptions, but not proven solutions
*What have I done so far:*

I used a 10.1 FreeBSD package from OSboxes
Have VB OSE-Additions installed (pkg add)
Followed various installation instructions like those  

Any help appreciated.
Thanks


----------



## wblock@ (Apr 8, 2015)

Last I knew, file sharing through VirtualBox was not yet supported on FreeBSD guests.  It might be on hosts, but I confess I have not tried.


----------



## bsd777 (Apr 18, 2015)

File sharing through VirtualBox virtual folders is not yet supported on FreeBSD guests. 

However, you can use Samba for these purposes:

Ensure that you have configured sharing on the Windows folder to the user you wish to use to share on FreeBSD.
First test mounting the folder:


```
mount_smbfs -I ip_address //username@nameofwindowsbox/foldername /mnt
```

For example, my Windows host has IP address *192.168.200.50*, the user name is *bsd777*, the Windows computer name is *W530* and the name of share on Windows computer is *repos*. I would mount the shared folder by typing the below command:

```
mount_smbfs -I 192.168.200.50 //bsd777@W530/repos /mnt
```

If everything is correct you'll be prompted for the Windows user password.

Please note that you might have to add some firewall rules on your Windows box to allow incoming connections from your FreeBSD guest.

To make it mount on boot add the following to /etc/fstab:


```
//username@nameofwindowsbox/foldername  /mnt smbfs  rw,-N,-f660  0 0
```
It should now be mounted every time you boot.

If you don't want to be prompted for password add the below in /etc/nsmb.conf:


```
[default]
[NAMEOFWINDOWSBOX]            
addr=192.168.200.50
[NAMEOFWINDOWSBOX:USERNAME]
password=myPassword
```
Please note that NAMEOFWINDOWSBOX and USERNAME should be always typed in capital letters.

For example:

```
[default]
[W530]            
addr=192.168.200.50
[W530:BSD777]
password=myPassword
```


----------

