【问题标题】:vagrant guest additions and kernel流浪的客人添加和内核
【发布时间】:2019-09-22 08:43:42
【问题描述】:

每当我尝试打开 centos7 机器时,都会出现“vboxsf”错误。

我在目录中运行 vagrant init。然后我进入目录并编辑文件。然后运行 ​​vagrant up。这是我放入 vagrant 文件的内容:-

# -*- mode: ruby -*-
# vi: set ft=ruby :


Vagrant.configure("2") do |config|

config.vm.define "Centos7" do |master|
master.vm.provider "virtualbox"
master.vm.box = "centos/7"
master.vm.hostname = "web.mylab.local"
master.vm.network :private_network, ip: "198.168.56.7"
config.vm.synced_folder ".", "/vagrant", type: "virtualbox"
master.vm.provision "shell", inline: <<-SHELL
    sudo sed -1 "s/PasswordAuthentication.*/PasswordAuthentication 
yes/g" /etc/ssh/sshd_config
    sudo systemct1 restart sshd
SHELL
end
end


**This is the error message i get:-**

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=1000,gid=1000 vagrant /vagrant

The error output from the command was:

mount: unknown filesystem type 'vboxsf'

【问题讨论】:

  • Oracle 数据库与该问题有何关系?

标签: vagrant virtual-machine centos7


【解决方案1】:
  • 您正在为您的 VirtualBox 虚拟机定义一个 synced_folder(即共享文件夹)。
  • 此功能需要 vm 安装 VirtualBox Guest Additions
  • 您正在使用未安装 VirtualBox Guest Additions 的基础盒

从那里你基本上有 3 个选项

  1. 在创建 vm 时修改您的 vagrant 配置脚本以安装 Guest Additions(例如,将虚拟 CDROM 插入 vm,挂载它并启动安装脚本)。我仍然怀疑如果在配置完成之前发生共享文件夹挂载,这可能会中断...
  2. 您自己创建一个安装并使用 Guest Additions 的基础盒。如果您需要与其他开发者共享此盒子,则必须将其托管在某个地方。
  3. 使用另一个已安装 Guest Additions 的基础盒。

我很长一段时间没有深入研究最新的观点,因为我倾向于制作自己的盒子供自己使用。但如果我没记错的话,公共 generic/centos7 box 带有为 VirtualBox 提供程序预安装的 Guest Additions。

【讨论】:

  • 如果这能解决你的问题,你应该接受答案,如果你喜欢它最终投票。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-05-06
  • 1970-01-01
  • 1970-01-01
  • 2015-06-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多