生信之旅

扫码分享下吧!
分享

VirtualBox共享文件夹不可用

我想在我windos10上创建一个共享目录与debian10虚拟机进行共享,但是不知道为什么一直挂载不上,使用命令

sudo /sbin/mount.vboxsf win_share usb/

进行挂载,但是报错

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

找了很久都找不到问题所在,但是我在运行下面命令时发现了问题所在

cd  /opt/VBoxGuestAdditions-*/init
sudo ./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 
4.19.0-6-amd64. Please install them and execute
  /sbin/rcvboxadd setup
VirtualBox Guest Additions: Running kernel modules will not be replaced until 
the system is restartedccong

从上面我们可以清楚的看到错误所在,所以我根据错误提示进行安装,不过需要注意的是,报错的Kernel headers版本是4.19.0-6-amd64(因为我的内核版本是4.19.0-6)。

sudo apt-get install linux-headers-$(uname -r) # 安装对应版本的headers包

但是我在官方源中搜索不到这个版本的header,所以我进行了如下尝试

apt-cache search linux-image  # 搜索可用的内核文件

sudo apt-get install linux-image-4.19.0-13-amd64 linux-headers-4.19.0-13-amd64  # 选择合适的版本进行安装
sudo reboot -h now

sudo  /sbin/rcvboxadd setup  # 重启后运行该命令
sudo reboot -h now

sudo /sbin/mount.vboxsf win_share usb/  # 重启后若没有挂载则用该命令进行挂载

更新完内核后发现共享盘挂载成功了。但是发现没有权限,故我将当前用户加入到vboxsf 组中,然后重启下系统即可(或者更换文件夹属主也可以)。

sudo usermod -aG vboxsf $(whoami)  # 将当前用户加入到vboxsf组
sudo reboot -h now

终于可以愉快的用共享文件夹了!

版权声明:本文转载请注明出处!

最新评论:

发表评论

电子邮件地址不会被公开。 必填项已用*标注

captcha

公告栏

有任何问题均可以在文章页面留言!或者邮件 burning@burning.net.cn 欢迎关注微信公众号 “生信之旅”,每天均可在菜单栏领取外卖红包、支付宝红包!最高20元!

服务器推荐

欢迎关注公众号

欢迎关注生信之旅