vagrant : Failed to mount folders in Linux guest, “vboxsf” file system is not available?

你。 提交于 2019-12-01 03:46:56
 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.

Lucian Popescu

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

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

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

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!