Vagrant was unable to mount VirtualBox shared folders

后端 未结 8 1747
一生所求
一生所求 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 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

提交回复
热议问题