Vagrant error : Failed to mount folders in Linux guest

后端 未结 21 2354
臣服心动
臣服心动 2020-11-27 08:46

I have some issues with Vagrant shared folders, my base system is Ubuntu 13.10 desktop.

I do not understand why I have this error is something that is not right conf

相关标签:
21条回答
  • 2020-11-27 09:28

    In my case on a previously working Ubuntu 16.04 image, the error started after installing vagrant-vbguest for a different vagrant image, and then starting the Ubuntu VM. It upgraded the guest additions to 5.1.20, and since then the mounts started failing. Updated the box, apt update + upgrade and the same, vbguest would install the newer 5.1.20 version.

    It was solved by manually running:

    sudo apt-get update
    sudo apt-get install virtualbox-guest-dkms 
    

    And also disabling the: config.vbguest.auto_update = false for this VM (might not be necessary).

    0 讨论(0)
  • 2020-11-27 09:28

    In configuration where windows is a host, and linux is a guest I found solution of the same problem in other place.

    So again, the error message was "Failed to mount folders in Linux guest. This is usually because the "vboxsf" file system is not available." (...)

    This was caused because I have made mistake by doing symlink inside the guest system from /vagrant into /home/vagrant/vagrant. The point is, that the directory /vagrant is a normal linux directory that has a symlink (so all ok), but when booting up by "vagrant up", it tries to mount windows directory on that place, and windows directory cannot work as a symlink. Windows host does not support linux symlinks.

    So what You can do then, is to ssh into guest, remove the symlink wherever You have it, and reload machine.

    In my configuration it was: Vagrant 1.7.2, VBoxGuestAdditions 4.3.28 and VBox 4.3.28.

    0 讨论(0)
  • 2020-11-27 09:29

    I was running Vagrant with VirtualBox 5.1.X, and had to downgrade to VirtualBox 5.0.40, and install the vbguest plugin to solve this problem.

    My steps were:

    • Uninstall VirtualBox 5.1.X
    • Install Vagrant 5.0.40
    • Reboot my machine
    • Run vagrant up for my vagrant. It'll fail.
    • Run vagrant plugin install vagrant-vbguest while my VM is running, to install the vagrant plugin. This manages syncing VirtualBox Guest versions between host and guest.
    • Run vagrant reload to reload my virtual machine
    • Magic!
    0 讨论(0)
  • 2020-11-27 09:35

    (from my comment above)

    Following the problem to it's roots: , specifically the part in the comments saying this:

    wget https://www.virtualbox.org/download/testcase/VBoxGuestAdditions_4.3.11-93070.iso‌​ 
    sudo cp VBoxGuestAdditions_4.3.11-93070.iso /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso
    

    After doing that, I have business as usual with all my virtual machines (and their current Vagrantfiles, of course)

    When you have to do something in a freshly created virtual machine, to make it work, something is wrong.

    0 讨论(0)
  • 2020-11-27 09:35

    This seems to be due to an incompatibility with the vbguest vagrant plugin and the latest version(s) of vagrant. It is trying to update the guest additions and failing to do it completely/properly.

    0 讨论(0)
  • 2020-11-27 09:39

    I arrived at this page whilst looking for the same error message. For me the cause was different: I had ran a yum update on the system that installed a new kernel. The guest additions where out of date so it couldn't load them.

    I rebuilt them with

    sudo /etc/init.d/vboxadd setup 
    

    And a vagrant reload later my guest was up and running again.

    I'm just adding it here in case someone else gets here the same way I did.

    Edit (Per KCD's comment):
    It is possible that you get an error saying:

    The headers for the current running kernel were not found

    This can be resolved by installing kernel-devel (yum install kernel-devel)

    0 讨论(0)
提交回复
热议问题