As with everything, we need to make a consious decision when we do things. In this case a VirtualBox Guest Additions mismatch has severe performance implications and in my case has halted the synchronizing between Vagrant and OS/X.
- Homestead 2
- VirtualBox 5 (5.0.0 or greater)
- Vagrant 1.7.4 (or greater)
- Let's get the latest version of Vagrant (1.7.4 as of this writing) and install as usual.
- Then download and install the latest version of VirtualBox (5.0.0 as of this writing).
- Now for the tricky bit: upgrading VirtualBox Guest Additions. Let’s SSH into Homestead:
- Remove any existing packages that would interfere with the installation (just in case).
sudo apt-get remove dkms build-essential linux-headers-
sudo rm -rf /opt/VBoxGuestAdditions-
- Now lets install the new replacements for them:
sudo apt-get install dkms build-essential linux-headers-$(uname -r)
- Great! We have the system prepped, and ready to install the new Guest Additions. In my example I am using the 5.0.0 version, but make sure you use the version that matches your VirtualBox:
- Create a mount point for the ISO, then mount it:
sudo mkdir /media/VBoxGuestAdditions
sudo mount -o loop,ro VBoxGuestAdditions_5.0.0.iso /media/VBoxGuestAdditions
- Now we can finally install the Guest Additions:
sudo sh /media/VBoxGuestAdditions/VBoxLinuxAdditions.run
- Once this completes successfully, we can clean up:
sudo umount /media/VBoxGuestAdditions
sudo rm -rf /media/VBoxGuestAdditions
- Exit out of Homestead, and restart it:
homestead halt && homestead up
And we can now rejoice not seeing a Guest Addition version warning! Mission accomplished. Now pat yourself on the back, and get back to work already! 😄
This process also fixes instances of the following error that may be encountered while running homestead up:
==> default: Mounting shared folders…
default: /vagrant => /Users/mike/.composer/vendor/laravel/homestead
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:
mount: wrong fs type, bad option, bad superblock on vagrant,
missing codepage or helper program, or other error
In some cases useful info is found in syslog — try
dmesg | tail or so.