# Share folder in virtualbox guest mode



## kutchbhi (Feb 20, 2019)

I am trying to share a folder  from windows 8 (host) with freebsd (guest) on virtualbox .
The folder mounts. Is writeable, but there are are several issues with each approach.

Errors with samba: `General error: 10 disk I/O error` and `segmentation faults` with commands such as cat log.txt . The errors come and go.
Mount command: `mount_smbfs -f 777 -d 777  -U awindowsuser //pcName/shareName /var/www/mounthere` ,

Errors with regular virtualbox share : ' directories shown as files' , 'directories go missing randomly' , 'messed up directory trees '. come and go..
Mount command: `mount -w -t vboxvfs -o uid=$UID,gid=$(id -g)  shareName /var/www/mounthere`

Tried variations of several commands.  permissions are all 777 . Don't know what else to do. Does anyone have success stories with this ? Is virtualbox guest folder sharing generally considered working on freebsd ?

Offtopic: Found  freebsd to be Excellent! The docs are on point. love the ports. Got literally zero issues when setting it up...


----------



## twllnbrck (Feb 21, 2019)

Hi,

generally its possible to mount a shared folder with samba.
Could you provide more information on the network config of the guest OS (FreeBSD). Did you use NAT, bridge, host-only or internal network?

If you use host-only you could mount the shared folder by using the correct Windows IP address on your LAN or that was defined for the host-only interface

```
mount_smbfs -U <user> //192.xxx.xxx.x/sharedfolder /mount/shared
```
Make sure you have properly configured /etc/nsmb.conf at the FreeBSD guest (e.g. use capital letters for your win smb user etc).


VBox built in share with vboxsf is not supported for FreeBSD guests. There are no oracle guest additions for it. 
There is/was a project on github https://github.com/lwhsu/freebsd-vboxfs but there is no update since JAN 2017..


----------



## kutchbhi (Feb 21, 2019)

Hi 
Using host-only network. the mount_smbfs command I used is similar, hostname instead of ip. didn't know about nsmb.conf . May try fiddling with it. 
For now I have settled with a third way. Sync over ssh. I thought it wouldn't work for me, due to confusion about remote-debugging and remote mappings, but it just works fine for me right now...

For any googlers: enable ssh on virtualbox , setup xdebug: host ip, remote enabled > phpstorm create remote interpreter , test connection, set mappings > phpstorm: sync with deployment tool (enable auto sync) > run debug in phpstorm!

Thanks for the help though.


----------

