VirtualBox文件挂载问题,出现/sbin/mount.vboxsf: mounting failed with the error: No such device

文章描述了在VirtualBox中挂载宿主机共享文件夹时遇到的Nosuchdevice错误。解决方案包括使用Vagrant安装vagrant-vbguest插件,或者手动安装gcc、kernel-devel和make等依赖,然后执行./vboxaddsetup确保GuestAdditions正确安装。挂载命令成功执行且无报错则表示挂载成功。
摘要由CSDN通过智能技术生成

VirtualBox文件挂载:/sbin/mount.vboxsf: mounting failed with the error: No such device

1、问题原因

虚拟机挂载宿主机共享文件夹失败

mount -t vboxsf gopath /usr/local/gopath

cd /opt/VBoxGuestAdditions-6.1.24/init/

./vboxadd setup

VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel
modules.  This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup <version>
VirtualBox Guest Additions: or
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup all
VirtualBox Guest Additions: Kernel headers not found for target kernel
3.10.0-1160.88.1.el7.x86_64. Please install them and execute
  /sbin/rcvboxadd setup
modprobe vboxguest failed
The log file /var/log/vboxadd-setup.log may contain further information.

2、解决方案

1) 方案一:

如果你是用的vagrant来管理virtualBox的话,可以通过vagrant安装插件来解决:

vagrant plugin install vagrant-vbguest

出现以上说明安装插件成功

2)方案二:

安装gcc等依赖

yum install gcc kernel-devel make

安装完成之后执行

./vboxadd setup之后出现如下截图信息,则说明启动成功!

mount -t vboxsf gopath /usr/local/gopath 执行挂载,没有报错说明挂载成功!

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值