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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have Ubuntu 12.10 as Host OS and FreeBSD 9 as Guest OS in Virtualbox 4.1.18. I have Samba installed in both Ubuntu and FreeBSD and shared a few folders from virtualbox, also ticking the automount option.

I have also done right click and share in Ubuntu. But when I try to mount in FreeBSD using

mount -t vboxfs sharedfolder /home/user/shared`

it says sharedfolder operation not permitted. I also used

mount_smbfs // /home/user/shared

but I get can't get server address

How to share folder/files between Host Ubuntu and Guest FreeBSD from virtualbox ?

share|improve this question
Do you have any reason for not using NFS? – peterph Mar 15 '13 at 18:41
NFS ??? How to ? or is it installed by default ? – Jhilke Dai Mar 18 '13 at 9:55
Network File System should be installed by default and if not, you can install it as any other packages. It is the most prominent network file system for Unices. – peterph Mar 18 '13 at 17:35
BTW, most likely sharedfolder: Operation not permitted means that only root can do that. – Apostle Jun 16 '15 at 15:08
"Shared Folders for FreeBSD guests are not supported yet" - see my answer below – Alexander Pozdneev Jun 21 '15 at 20:28
up vote 2 down vote accepted


It is possible to mount either a shared FreeBSD folder or a shared Ubuntu folder with samba. Both ways work. Either case you need to configure a share folder (you mentioned you used the Ubuntu GUI to do that) and then on the other machine you need to mount the share using the correct IP and making sure that both the Guest and Host are on the same network or using port forwarding in case you had NAT configured.

Because there is too many solutions, I am not going to list them all here. Please could you provide more information regarding the network configuration of your Guest OS? What settings did you use when creating the VM? Do you use NAT, Bridge, Host-only or Internal Network? I'm going to provide you with one example which assume that your guest is able to view on the network your host (for example, you have one network card defined as host-only).

First share a network folder on Ubuntu as you did. Make sure to create a user account in Samba on the Ubuntu host or that guest access is possible (e.g. sudo smbpasswd -a <username> to give access to a user, replace by the username.

Then on FreeBSD, mount the Ubuntu share by using the correct IP address ( is probably the one for your NAT "router" created by VirtualBox and therefore it probably won't work), for example either use the Ubuntu IP address on your LAN (e.g. 192.168.1.x) or the one that was defined for the host-only interface. Then your mount_smbfs command will succeed:

mount_smbfs -U <username> //<correct IP>/sharedfolder /home/user/shared


When vboxsf gets supported by FreeBSD (thanks Alexander for pointing that out) and if you want to use VirtualBox builtin share mechanism with vboxsf, you need to install the Guest Additions in the Guest OS (some FreeBSD in your case). Usually this is done via the VirtualBox menu under Devices, there is a shortcut to Install Guest Additions....

However, for FreeBSD you have to do it differently. They have a dedicated documentation for this:

Once the Guest Additions installed, you can use the mount command with the vboxsf filesystem. You need however to share a folder using VirtualBox share folder mechanism, see under VirtualBox's Devices menu the item Share Folders.... Note that the name you will give to the share in this menu will be the name of the "device" you give to mount.

share|improve this answer
I use NAT, the default network for GuestOS. I tried with mount vboxsf even with su, but no any luck. I have shared folder under virtualbox shared mechanism, settings and Shared Folders and gave name sharedfolders for the ones that I wanted to share. I also used automount option available while sharing using virtualbox. – Jhilke Dai Mar 18 '13 at 10:14
@JhilkeDai As I said, you can only used the vboxsf and Shared Folder if you have installed the Guest Additions inside the Guest OS, for which I gave you a few links. Did you install them? For Samba, try to use "Bridge" mode, share a folder on the Host (Ubuntu) and try to access it from the Guest (FreeBSD) using smbclient -L <ubuntu hostname>. – Huygens Mar 18 '13 at 20:22
yes, the Guest Additions were the trick in GuestOS, I never guessed it could be like that, neither I understand how it works. But it works :D – Jhilke Dai Mar 21 '13 at 14:19
Adding the Guest Additions is like adding a set of new drivers to your Guest virtual machine. For an analogy in non-virtual environment, it is like installing a Graphic card without the drivers, you do not have access to all possibilities. Once you install the drivers you can get all features because the OS is aware of them and offer to make use of them to users. – Huygens Mar 22 '13 at 7:36
Sorry for being harsh, I have been bitten badly after trusting the answer and spending lots of time trying to use it until reading the other answer. – Abel Cheung Jun 19 '15 at 5:01

As pointed out at another topic,

Shared Folders for FreeBSD guests are not supported yet [...] There is some draft code and a kernel module for it but it's not working yet.

That is as of Jun 24, 2014.

share|improve this answer

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.