Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

First of all, let me say that though I use Linux (Red Hat, at work) regularly, I am a complete beginner when it comes to actually administrating it.

What I am trying to accomplish:

  • I have (at home) a PC with Windows 7 installed
  • I would like to run a Unix in Virtual Box, because I am more used to developing / scripting on it

I settled on Freebsd at the moment, and I managed to install it and configure the network. The next step is sharing a folder from Windows to Freebsd so that I can easily edit files on Windows and on Freebsd both. Unfortunately it seems a though thing to do.

I rummaged on the net and found two different ways:

I installed the guest additions in freebsd using pkg_add -r virtualbox-ose-additions, the install proceeded switfly enough, and I edited /etc/rc.conf to add the two suggested lines: vboxguest_enable="YES" and vboxservice_enable="YES" and rebooted.

It did not work. The command to mount the system ends up in an error:

# mount -t vboxsf shared /home/myuser/shared
mount: shared : Operation not supported by device

where shared is the name of the folder I setup in my virtual box settings for this VM.

Is it actually possible to use a vboxsf filesystem type in freebsd ? Some comments seem to suggest it is not supported but finding up-to-date information is difficult.

Next, I moved on to the samba approach. I basically followed the guide I linked it. Unfortunately it ends up with:

# mount_smbfs -N -I //winuser@winmachinename/Shared /mnt/shared
mount_smbfs: unable to open connection: syserr = RPC struct is bad

where Shared is the name of the shared folder I configured with windows, accessible to the winuser obviously. The ping works.

I would like to note that I have no password on the windows guest account I am trying to connect at, it seemed easier, but perhaps that it's bothering samba somehow.

edit: working from PuTTY I had not seen that some messages were printed in the console:

smb_maperror: Unmapped error 3:31
smb_co_lock: recursive lock for object 1

both appear several times. /end of edit

If the direct filesytem sharing does not work, any idea how to get samba to do it ? The article suggest it's already be done by some at least.

Technical information:

  • Host: Windows 7 Familial Edition (up-to-date)
  • Guest: FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:15:25 UTC 2012 root@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
  • Virtual Box: 4.1.16 r78094

I am open to new suggestions to sharing as well. I would if possible prefer avoiding transferring files back and forth: it's not particularly efficient and always a source of confusing errors.

I am also open to changing systems. I like the philosophy of freebsd, but if it does not work, I have no qualms about moving to a linux.


This question is now purely of theoretical interest. I switch to using Ubuntu Server and managed to set it up without samba since vboxsf is well supported.

share|improve this question
Did you try the smbclient program from the samba suite? –  arved May 29 '12 at 12:42
@arved: no, I did not. Is it possible to configure an auto-mount through the smb client ? (Ideally I would prefer no samba, but hey, if it takes samba to work...) –  Matthieu M. May 29 '12 at 13:14
I don't think it is possible to mount. But at least you can verify that there is no misconfiguration on the Windows Share –  arved May 29 '12 at 14:25
add comment

2 Answers

Ensure that you have configured sharing on the windows folder to the user you wish to use to share on freebsd.

I like to add the following to /etc/hosts for ease of use.

<ip address of server>  vboxhost
eg.    vboxhost

First test mounting the folder:

mount_smbfs -I vboxhost //username@nameofwindowsbox/foldername /mnt

If this is correct you be prompted for the windows-user password.

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

//username@nameofwindowsbox/foldername  /mnt smbfs  rw,noauto  0 0

It should be mounted everytime you boot

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

addr=<ip address of host>
share|improve this answer
Hi Pete. Thanks for your answer. Actually I changed arms and went with Ubuntu Server as I preferred a non-samba solution and FreeBSD does not support vboxfs yet. –  Matthieu M. Sep 5 '12 at 17:17
You don't need to install samba for the above solution it works from a default install of FreeBSD. –  Pete Sep 5 '12 at 22:38
I would recommend giving freebsd another go if you have time as i've found its jail feature very useful for development purposes. At the moment i have 5 jails: www(apache22+php53), www(apache22+php54), MySQL, PostgreSQL, email-server. I have found this invaluable in terms of testing different versions of php and databases –  Pete Sep 5 '12 at 22:46
Also as FreeBSD has many terminals by default alt+f1 -> alt+f8 meaning if you go with jails you can build them in parallel saving you time when you use the ports system. Heck you could even setup a jail just to build software. I use qjail. –  Pete Sep 5 '12 at 23:09
well, my purpose was to hack on Clang/LLVM, so it's quite fine with me. –  Matthieu M. Sep 6 '12 at 7:52
add comment

I was fighting the same problem. A couple things on the Windows side allowed me to finally get mount_smbfs working in FreeBSD 9.0:

  • Enable anonymous access for the system

Network and Sharing Center → Change Advanced Sharing Settings → Turn off password protected sharing

  • Enable anonymous access on the folder via Simple Sharing

Properties → Sharing → Share... → Add 'Everyone'

In the Sharing properties there are two ways to create the share; Simple Sharing and Advanced Sharing. I was using Advanced Sharing, and for some reason I don't really care about at this point, that did not work; I re-added the share through Simple Sharing and then mount/smbclient finally worked.

Verifying that anonymous login works with smbclient:

[root@fileserv ~]# smbclient -N -I '\\twblamer-pc\share'
Domain=[TWBLAMER-PC] OS=[Windows 7 Professional 7601 Service Pack 1] Server=[Windows 7 Professional 6.1]
smb: \> dir
  .                                  DR        0  Thu Dec 13 04:33:09 2012
  ..                                 DR        0  Thu Dec 13 04:33:09 2012
  mydirectory                         D        0  Thu Dec 13 01:55:45 2012
share|improve this answer
Thanks for the answer, I switched to Ubuntu in the end (which was easier as I had access to a friend that used it). –  Matthieu M. Dec 13 '12 at 12:02
Yep, just wanted to try to help any future googlers. –  twblamer Dec 13 '12 at 20:43
And I thank you for doing so, had a very hard time finding any solution when I tried :) –  Matthieu M. Dec 14 '12 at 7:23
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.