Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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've got Ubuntu 13.10 installed in Virtualbox 4.3. The host machine is Windows.

I have a couple of Virtualbox shared folders being mounted by /etc/fstab. Until recently this setup worked just fine, but after upgrading from Ubuntu 13.04 and Virtualbox 4.2 (at essentially the same time) the fstab mounting stopped working. I get the following error during boot:

An error occurred while mounting /home/benme/Documents.
keys:Press S to skip mounting or M for manual recovery

Pressing M for manual recovery and then trying to mount manually also fails:

root@benme-vb:~# cd /home/benme
root@benme-vb:/home/benme# mount Documents
/sbin/mount.vboxsf: mounting failed with the error: No such device

But if I instead skip mounting during boot, wait for Unity to start and then mount manually in a shell, everything works fine:

benme-vb ~ % ls Documents
benme-vb ~ % sudo mount Documents
[sudo] password for benme: 
benme-vb ~ % ls Documents
    # actual file list omitted

Note that when I mount manually I'm letting mount take all the options from /etc/fstab, and it works. This suggests to me that it's some sort of timing issue, where Virtualbox isn't "ready" to provide the shared file mounts at the point /etc/fstab mounts are run during bootup.

Here's the fstab line, just for completeness:

Documents       /home/benme/Documents   vboxsf  uid=benme,gid=benme,dmode=774,fmode=664     0   0

Is there something I can do about this from the Ubuntu side? Or does anyone happen to know more about this from the Virtualbox angle?

I've found an old report on the Virtualbox bug-tracker with identical symptoms, but in that case the user had updated Virtualbox without updating their guest additions and resolving that fixed the problem; this isn't happening here, I've definitely got the 4.3 guest additions installed.

share|improve this question
up vote 37 down vote accepted

I ran afoul of this problem too. I mount /var/www using VBox shared folders functionality, so this was quite annoying.

The solution I found was to force the vboxsf module to be loaded early, before the mounting of file systems. Just add vboxsf on a line of its own in /etc/modules.

Another solution is to set noauto in /etc/fstab and manually mount drives in /etc/rc.local, but this wasn't such a good solution for me because by that time Apache has already started and been unable to find anything in /var/www.

share|improve this answer
awesome! adding to /etc/modules worked perfectly. thanks Richard! – ThePosey Feb 11 '14 at 15:53
@ThePosey Glad to have helped! – Richard Turner Feb 12 '14 at 8:46
This was issue for me on Ubuntu Server 14.04 guest. And this answer (the /etc/modules solution) solved it for me. Thanks! P.S Btw, if you by chance, trying to figure out / fix things, enabled Auto-mount in Virtualbox settings, disable it again ;) – Reinis Jul 15 '14 at 7:59
What is actual line of code/text that is used with this solution? @Reinis – qodeninja Mar 10 '15 at 1:40
@qodeninja As I said in my second paragraph: "Just add vboxsf on a line of its own in /etc/modules. – Richard Turner Mar 10 '15 at 8:53

In addition to Richard Turner's suggestion of adding vboxsf on a line of its own to /etc/modules, I suggest adding the _netdev mount option to /etc/fstab. I tested on Ubuntu 12.04 LTS and this seems to add just the right amount of delay for the mount to succeed.

My /etc/fstab entry:

dev /media/dev vboxsf defaults,_netdev 0 0

share|improve this answer
This works for me, even without using Turner's solution. Make a lot of sense too, since the Ubuntu Community Help page for fstab options says, "_netdev - this is a network device, mount it after bringing up the network." I did not have to load vboxsf in /etc/modules, just adding _netdev worked! – Mark Mikofski Feb 23 at 19:45

Richard's fix stopped working for me after the last update (VirtualBox 4.3.18, Ubuntu 14.04). Luckily I was able to fix it, by loading vboxsf right with the kernel:

# echo "vboxsf" >> /etc/initramfs-tools/modules
# update-initramfs -u

The first command adds a parameter to load the module to the kernel and the second updates the init file system. After a reboot I was able to use my fstab-mounts again :)

Warning: The boot process might freeze, if a shared folder cannot be mounted. So test your configuration, before you add the module to initramfs. If your system hangs anyway, you can boot in recovery mode to fix the problem.

share|improve this answer
I tried this solution to load the vboxsf module earlier ... It just froze my boot sequence so I had to remove it. – Rerito Nov 27 '14 at 9:05
Yeah, including the module that early might freeze the boot process, if your shared folder configuration is broken. However, I never experienced any boot freezes with a correct configuration... – Torben Nov 27 '14 at 12:46
I've added a warning to the answer to make things clearer. – Torben Nov 27 '14 at 12:51

I just wanted to say that forcing the vboxsf module to load early helped me (as in Richard Turner's answer), but the fstab line still didn't work for me.

What I ended up doing was putting the mount command (which did work) into /etc/rc.local. A bit of a hack but it worked.

share|improve this answer

I had the same problem, and was working through the suggested solutions, but without success. Torben's solution froze the boot, so had to undo it. Then I thought I should troubleshoot /etc/fstab using sudo mount -a. The syntax of my entry looked perfect, but it still failed. I was also able to manually mount the filesysten using the mount command in the terminal window.

What I found is that I had spaces between the first two parameters (device and mount point). I replaced them with a tab and it works. Really?!!!!

share|improve this answer
Are you sure it was two space characters (ASCII code 32)? Because one or more of those should be just as fine as a tab character. Sometimes I accidentally type non-breaking space characters when I press my shift key to early or release it too late while pressing the space bar. They look the same but confuse many applications. – David Foerster Feb 3 '15 at 1:10
All I know is that I backspaced over all of the white space and inserted a single tab and it then it worked. – svenyonson Feb 4 '15 at 3:52
Switching my spaces for tabs worked for me. My existing /etc/fstab had spaces in it (as far as I could tell) and I replicated them exactly. The existing lines had a single space. But re-writing mine with tabs got everything working. – jcaruso Nov 28 '15 at 17:53
This didn't work for me, but following Kevin Sadler's recommendation of using noauto to delay mounting then adding mount <sharename> to rc.local did the trick. I did not try Turner's solution. – Mark Mikofski Feb 23 at 19:15

With the shared folder listed in fstab I find that the boot will hang when it tries to mount it using VirtualBox 5 and Ubuntu 14.04. The solution seems to be to delay mounting until the GuestAddition service is available (Richard Turner's /etc/modules solution didn't seem enough for me).

To do this make sure you have noauto as the options for the shared folder in /etc/fstab. For example for a shared folder called vmshare:

vmshare    /home/user/share    vboxsf    defaults,noauto    0    0

Then add a line to /etc/rc.local to mount the share after booting:

mount vmshare
share|improve this answer
This was the only solution that worked for me, using VBox 5.0.16 and Ubuntu 14.04 – T.J. Compton Apr 28 at 13:50

I believe I've found the right way to deal with this in Arch Wiki. Use comment=systemd.automount option.

The above option goes in the /etc/fstab file with the other options. For example:

Fedora /var/ftp/pub/Fedora vboxsf uid=1001,gid=1001,comment=systemd.automount 0 0
share|improve this answer
This didn't work for me, but Keven Sadlier's answer did. – Mark Mikofski Feb 23 at 19:16

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.