Vagrant error : Failed to mount folders in Linux guest

后端 未结 21 2353
臣服心动
臣服心动 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:15

    Install the vagrant-vbguest plugin by running this command:

    vagrant plugin install vagrant-vbguest
    
    0 讨论(0)
  • 2020-11-27 09:15

    Just for future reference, this problem happened with me, using Vagrant 1.7.4 and VirtualBox 5.0.10 r104061, when I provisioned a shared folder in / and created a symbolic link to my home folder. Something like this:

    /folder
    ~/folder -> /folder
    

    Apparently, this operation is not allowed by Vagrant due to security purposes and throws the described error.

    I solved it by provisioning the desired folder directly to my home directory, such as /home/vagrant/folder.

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

    Try like it:

    vagrant plugin install vagrant-vbguest
    

    In Vagrantfile add:

    config.vbguest.iso_path = "http://download.virtualbox.org/virtualbox/VERSION/VBoxGuestAdditions_VERSION.iso"
    config.vbguest.auto_update = false
    config.vbguest.installer_arguments = %w{--nox11 -- --force}
    

    Run:

    vagrant vbguest --do install -f -b
    
    vagrant reload
    
    0 讨论(0)
  • 2020-11-27 09:20

    One more step I had to complete after following the first suggestion that kenzie made was to run the mount commands listed in the error message with sudo from the Ubuntu command line [14.04 Server]. After that, everything was good to go!

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

    Update February 2016

    This took me hours to solve independently. Yes, this problem does still exist with latest Vagrant and Virtual Box installs:

    △  vagrant -v
    Vagrant 1.8.1
    △  vboxmanage -v
    5.0.14r105127
    

    The symptoms for me were messages something like:

    Checking for guest additions in VM... The guest additions on this VM do not match the installed version of VirtualBox!

    followed by a failure to mount NFS drives.

    1). Install the vagrant-vbguest plugin.

    Depending on version of Vagrant you are using, issue one of the following commands:

    # For vagrant < 1.1.5
    $ vagrant gem install vagrant-vbguest
    
    # For vagrant 1.1.5+
    $ vagrant plugin install vagrant-vbguest
    

    Next, do vagrant halt, followed by vagrant up - chances are you still have issues.

    2). ssh into your guest and setup a soft link to the correct version of Guest Additions (here, 5.0.14).

    $ vagrant ssh
    
    $ sudo ln -s /opt/VBoxGuestAdditions-5.0.14/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions
    $ exit
    
    $ vagrant reload
    

    You should be all good. By default, the mounted drive on guest is at /vagrant

    Final comment:

    IF you still have problems related to mounting NFS drives, then here is a workaround that worked for me. I had a vagrantfile with config something like:

    Simply remove the mount type information, and slim down the mount_options settings so they work universally. Vagrant will now automatically choose the best synced folder option for your environment.

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

    For me, with VBoxGuestAdditions 5.1.20, the problem was that /sbin/mount.vboxsf pointed to the wrong location.

    sudo ln -sf /opt/VBoxGuestAdditions-5.1.20/lib/VBoxGuestAdditions/mount.vboxsf /sbin/mount.vboxsf

    fixed it for me

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