Skip to content

Instantly share code, notes, and snippets.

@yang-wei
Created August 11, 2015 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yang-wei/895e6583345e00d1e432 to your computer and use it in GitHub Desktop.
Save yang-wei/895e6583345e00d1e432 to your computer and use it in GitHub Desktop.
Fix vagrant "Failed to mount folders in Linux guest. This is usually because the "vboxsf" file system is not available." error

So one day you start you VM and this error came out:

Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:

mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant

The error output from the last command was:

/sbin/mount.vboxsf: mounting failed with the error: No such device

😭 😭 😭 😭 😭

What happened?

So what is happening under the hood is your VM might did update (yum update) and things change, VirtualBox GuestAddition broken.

Let's solve it !

First of all let's update our kernel file.

❯ sudo yum install kernel-devel && sudo yum install gcc make

After new packages are installed:

❯ vagrant plugin install vagrant-vbguest
Installing the 'vagrant-vbguest' plugin. This can take a few minutes...

You might see error like

An error occurred during installation of VirtualBox Guest Additions 4.3.14. Some functionality may not work as intended.
In most cases it is OK that the "Window System drivers" installation failed.

But that is ok. After that

 ❯ vagrant vbguest --status
GuestAdditions 4.3.14 running --- OK.

Seems like our GuestAdditions is fixed. Ok let's reload

vagrant reload

Wohooo ~~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment