vagrant up后出现“unknown filesystem type 'vboxsf'”错误

4

我想使用Vagrant设置环境,但是在运行“vagrant up”后显示错误。以下是我的规格:

我使用的是: - OS X Yosemite 10.10.5版本 - VirtualBox版本5.2.6 - Vagrant 2.0.1

这是我的Vagrant文件:

Vagrant.configure("2") do |config|
  config.vm.box = "centos/7"
  config.vm.network "private_network", ip: "192.168.33.99" 
  config.vm.synced_folder "./", "/vagrant", type:"virtualbox", :owner => 'apache', :group => 'apache', mount_option: ['dmode=777', 'fmode=755']
end

但是当我运行 'vagrant up' 时,它显示了如下错误。
Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:

mount -t vboxsf -o uid=48,gid=48 vagrant /vagrant

The error output from the command was:

mount: unknown filesystem type 'vboxsf'

我运行了这段代码。

vagrant plugin install vagrant-vbguest
vagrant vbguest

显示错误信息

The distribution packages containing the headers are probably:
    kernel-devel kernel-devel-3.10.0-862.14.4.el7.x86_64
An error occurred during installation of VirtualBox Guest Additions 5.2.6. Some functionality may not work as intended.
In most cases it is OK that the "Window System drivers" installation failed.
Redirecting to /bin/systemctl start vboxadd.service
Job for vboxadd.service failed because the control process exited with error code. See "systemctl status vboxadd.service" and "journalctl -xe" for details.
Unmounting Virtualbox Guest Additions ISO from: /mnt

以及这段代码

vagrant plugin install vagrant-winnfsd

但仍然无法工作。有人能帮助我吗?

即使我可以通过vagrant ssh进行操作,但我无法更新vagrant文件夹中的任何文件和文件夹。

我该怎么办?

5个回答

2
我相信这是一个符号链接问题,可以通过运行ln -sf /opt/VBoxGuestAdditions-5.1.20/lib/VBoxGuestAdditions/mount.vboxsf /sbin/mount.vboxsf来解决。这里还有一个关于此问题的票据https://www.virtualbox.org/ticket/16670#comment:3,似乎已经解决了。

2
如果您仍想使用config.vm.box = "centos/7",请执行以下操作:
  1. 运行命令vagrant plugin uninstall vagrant-vbguest
  2. 运行命令vagrant plugin install vagrant-vbguest --plugin-version 0.21
替代方案:
  1. 您可以将config.vm.box = "centos/7"更改为config.vm.box = "generic/centos7"
  2. 如果您已经下载了插件,请使用此命令卸载插件vagrant plugin uninstall vagrant-vbguest
  3. 之后运行命令vagrant up

1

关于同步文件夹的文档

默认情况下,Vagrant会将您的项目目录(包含Vagrantfile的目录)共享到/vagrant。

只需删除此行:

config.vm.synced_folder "./", "/vagrant", type:"virtualbox", :owner => 'apache', :group => 'apache', mount_option: ['dmode=777', 'fmode=755']

我曾经遇到过同样的问题,但是移除了一条类似的代码行后,问题迎刃而解。

0

在加载虚拟机之前或重新安装插件后,尝试使用vbguest

vagrant plugin uninstall vagrant-vbguest
vagrant plugin install vagrant-vbguest
vagrant vbguest
vagrant up / vagrant reload

0
vagrant plugin install vagrant-vbguest #install plugin
vagrant destroy #clean repos
vagrant up #relaunch

如果您不想在启动此计算机时检查正确的附加版本,请将auto_update设置为false。

config.vbguest.auto_update = false

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接