8
votes

I have VirtualBox 4.3.10 and Vagrant 1.4.3 installed on my Ubuntu 14.04 64 bit Desktop.

Earlier, worked with vagrant technology but this time, multiple issue. Let me describe what I have done

  1. clone private git to local system /opt/lampp/htdocs/{project} : done

  2. root@desktop:/opt/lampp/htdocs/{project}$ vagrant up

gives message on terminal while execution

GuestAdditions versions on your host (4.3.10) and guest (4.2.0) do not match.

command completed with below message

Failed to mount folders in Linux guest. This is usually beacuse 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:

...

I understand this is version difference.

  1. check vagrant vbguest --status

    GuestAdditions 4.3.10 running --- OK.

  2. Open browser and run with http://192.168.0.33 (mentioned on README.md file of private git repo) but it didn't work.

UPDATE

  1. Installed vagrant-vbguest as suggested here

    $:sudo vagrant plugin install vagrant-vbguest

    Installed the plugin 'vagrant-vbguest (0.10.0)'!

By doing this,message of version difference of GuestAdditions described in 2. is gone

  1. restart vagrant halt and then vagrant up

Bringing machine 'default' up with 'virtualbox' provider...
[default] Clearing any previously set forwarded ports...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] -- 80 => 8080 (adapter 1)
[default] Booting VM...
[default] Waiting for machine to boot. This may take a few minutes...
[default] Machine booted and ready!
GuestAdditions 4.3.10 running --- OK.
[default] Configuring and enabling network interfaces...
[default] Mounting shared folders...
[default] -- /vagrant

Failed to mount folders in Linux guest. This is usually beacuse 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

Do I need to change anything in local vagrantfile or change vagrant version or something else?

Some say it is a bug whilesome gives solution for ubuntu < 14.04

Kindly suggest the solution hints and how to fix this issue?

4
can you do lsmod on guest and check if you have kernel modules installed? $ lsmod | grep vboxm1keil
output is vboxpci 23194 0 vboxnetadp 25670 0 vboxnetflt 27613 0 vboxdrv 339502 3 vboxnetadp,vboxnetflt,vboxpcidkode
It looks like vboxsf kernel module is not loaded from some reason. It's needed so you will be able to use shared folders. What about modinfo vboxsf ? Does it exists?m1keil
how do I check for the existence? Physical or terminal way?dkode

4 Answers

13
votes
 vagrant plugin install vagrant-vbguest

worked well for me (Virtual Box 5.0.22, Vagrant 1.8.4). It took muck longer to provision initially because the plugin downloaded gcc and a bunch of other tools before linking the guest additions .iso to the correct place.

6
votes

Apparently there is a bug in the VirtualBox Guest Additions 4.3.10 installer: https://www.virtualbox.org/ticket/12879

There seems to be a simple workaround to this, by creating a symbolic link within Vagrant-VM:

sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions \
/usr/lib/VBoxGuestAdditions

You could add this to your provisioning configuration to make sure you don't hit the bug again:

NEWEST_VBOXGUESTADDITIONS_DIR=`find /opt/ -maxdepth 1 -mindepth 1 -name "VBoxGuestAdditions-*" | tail -n 1`;
if [[ ! -d "/usr/lib/VBoxGuestAdditions" && -n "$NEWEST_VBOXGUESTADDITIONS_DIR" ]];
then
    ln -s ${NEWEST_VBOXGUESTADDITIONS_DIR}/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions
fi
0
votes

This line of code in "Vagrantfile" was the solution for me:

config.vm.synced_folder "./", "/vagrant", id: "vagrant-root", type: "nfs"
0
votes

In my case, this error was fixed by rebuilding the kernel on the guest machine with sudo service vboxadd setup.