Fix Vagrant and VirtualBox

If you just started using Vagrant (which I highly recommend), and on the last version of OSX (or any other system as a matter of fact) + VirtualBox, it’s highly likely that you’ll stumble on an error during your first `vagrant up` :

mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` /vagrant /vagrant
Stdout from the command:

Stderr from the command:
mount: unknown filesystem type 'vboxsf'

The sharing isn’t setup. A bit frustrating. And you’ll need to install Guest Additions on the box (and that’s not straightforward if using Vagrant).

Turns out, the fix is quite easy.

First, download : (replace 4.2.16 by your VirtualBox version).

Now fire up VirtualBox, select your virtual machine, Command+F to power it off, then Command+S for settings, select Storage then click on Add CD/DVD Device, then select the freshly downloaded ISO.

Go back to your app directory (where you executed the vagrant init command), and launch vagrant :

vagrant up && vagrant ssh

# First, install required dependencies. 
sudo yum install gcc -y
sudo yum install kernel sources -y
sudo yum install kernel-devel -y
exit # exit from vagrant

# Reload the machine and fire Vagrant
vagrant halt && vagrant up && vagrant ssh

# Mount the disk 
sudo mount /dev/cdrom /media/cdrom # Use /dev/cdrom2 if it's a second disk.
cd /media/cdrom
sudo ./ # Follow the instructions

vagrant reload
vagrant ssh

Now you should be up and running !

6 thoughts on “Fix Vagrant and VirtualBox

  1. Luis Milanese

    Many thanks. I adapted the answer to an Ubuntu 14.04 LTS box and that just worked perfectly. All I had to do was:

    sudo apt-get install gcc linux-source linux-source-3.13.0


  2. Pingback: Failed to mount folders in Linux guest. This is usually because the “vboxsf” file system is not available. – denismendes

  3. Pingback: Windows pre-WSL: fighting with vagrant, virtualbox and Cygwin – The rattled cough of Mike's imagination

  4. FirstDrew

    I see you don’t monetize your website, don’t waste your traffic, you can earn additional bucks
    every month because you’ve got high quality content.
    If you want to know how to make extra money, search for: Boorfe’s tips best adsense


Leave a Reply

Your email address will not be published. Required fields are marked *