Vagrant was unable to mount VirtualBox shared folders

后端 未结 8 1742
一生所求
一生所求 2021-01-29 18:17

Current setup: Virtualbox 5.1.20 with Vagrant 1.9.3

Previous working setup: Virtualbox 5.1.18 with Vagrant 1.9

相关标签:
8条回答
  • 2021-01-29 18:58

    For me, the problem was fixed under the following conditions:

    Environment:

    • VirtualBox version 6.0.4r128413
    • Vagrant version 2.2.3

    Steps:

    Go to your project directory from the terminal or command line (cd) and run the following commands:

    1. vagrant plugin install vagrant-vbguest to install the Vagrant VB Guest Plugin

    2. vagrant up

    If you get an error regarding vboxsf not being available. Then maybe your VirtualBox Guest Additions are not installed properly. Hopefully, the commands below will fix your problem.

    vagrant ssh
    sudo yum -y install kernel-devel
    sudo yum update -y
    exit
    vagrant halt
    vagrant up --provision
    
    0 讨论(0)
  • 2021-01-29 19:00

    For me the following commands followed by a reboot of the guest system helped:

    cd /opt/VBoxGuestAdditions-*/init  
    sudo ./vboxadd setup
    

    I found the solution here. Referring to this post you need to stop vboxadd before triggering the commands (I didn't do so since I don't know what vboxadd is).

    0 讨论(0)
  • 2021-01-29 19:01

    What I had to do was run the following command to add nfs to windows

    vagrant plugin install vagrant-winnfsd
    

    Source: https://peshmerge.io/how-to-speed-up-vagrant-on-windows-10-using-nfs/

    0 讨论(0)
  • 2021-01-29 19:08

    This worked for me... run the following:

    vagrant plugin repair
    

    Then

    vagrant plugin expunge --reinstall
    

    Then

    vagrant reload
    
    0 讨论(0)
  • 2021-01-29 19:10

    Removing type: "nfs" from homestead.yaml fixed it for me. Win 10, Vagrant 1.9.7, laravel 5.4, homestead.

    0 讨论(0)
  • 2021-01-29 19:10

    For those who land here with almost the same problem as me, below is the solution

    TLDR

    • VirtualBox guest fail because of system is currently not set up to build kernel modules
    • Solution is uninstall kernel-headers.x86_64 0:3.10.0-862.9.1.el7
    • Then install kernel-devel-3.10.0-327.el7.x86_64

    Solution

    1. vagrant ssh

    2. sudo rpm -e kernel-devel-3.10.0-862.9.1.el7.x86_64

    3. sudo wget ftp://mirror.switch.ch/pool/4/mirror/scientificlinux/7.0/x86_64/updates/security/kernel-devel-3.10.0-327.el7.x86_64.rpm //download the file

    4. sudo rpm -Uvh kernel-devel-3.10.0-327.el7.x86_64.rpm //use the file downloaded on step 3

    5. exit

    6. vagrant reload

    Details: Problem

    1. Do vagrant up but fail with similar error except

    The error output from the command was:

    /sbin/mount.vboxsf: mounting failed with the error: No such device

    1. Do further reading of the logs and I notice below key words

    Installing Virtualbox Guest Additions 5.2.16 - guest version is 5.1.10

    An error occurred during installation of VirtualBox Guest Additions

    This system is currently not set up to build kernel modules.

    Please install the Linux kernel "header" files matching the current kernel

    packages containing the headers are probably: kernel-devel kernel-devel-3.10.0-327.el7.x86_64

    1. Read logs further

    Package kernel-headers.x86_64 0:3.10.0-862.9.1.el7 will be installed

    No package kernel-devel-3.10.0-327.el7.x86_64 available.

    1. My guest is I need kernel-devel-3.10.0-327.el7.x86_64 to works

    Details: My environment

    • bento/centos-7.2
    • vagrant version: 2.0.4
    • virtual box version: 5.2.16

    Sources

    • How to uninstall kernel header 3.10.0-862
    • How to install kernel header 3.10.0-327
    0 讨论(0)
提交回复
热议问题