【问题标题】:Vagrant up and VM doesn't work Fedora 22Vagrant up 和 VM 不工作 Fedora 22
【发布时间】:2015-10-18 17:04:39
【问题描述】:

我有一个问题,当我想使用 vagrant 时出现错误

The provider 'virtualbox' that was requested to back the machine
'default' is reporting that it isn't usable on this system. The
reason is shown below:

VirtualBox is complaining that the kernel module is not loaded. Please
run `VBoxManage --version` or open the VirtualBox GUI to see the error
message which should contain instructions on how to fix this error.

写完VBoxManage --version我得到

WARNING: The vboxdrv kernel module is not loaded. Either there is no module
         available for the current kernel (4.2.3-200.fc22.x86_64) or it failed to
         load. Please recompile the kernel module and install it by

           sudo /etc/init.d/vboxdrv setup

         You will not be able to start VMs until this problem is fixed.
4.2.32r101581

sudo /etc/init.d/vboxdrv setup

我收到错误

Stopping VirtualBox kernel modules                         [  OK  ]
Uninstalling old VirtualBox DKMS kernel modulesError! Could not locate dkms.conf file.
File:  does not exist.
                                                           [  OK  ]
Removing old VirtualBox netadp kernel module               [  OK  ]
Removing old VirtualBox netflt kernel module               [  OK  ]
Removing old VirtualBox kernel module                      [  OK  ]
Trying to register the VirtualBox kernel modules using DKMSError! Bad return status for module build on kernel: 4.2.3-200.fc22.x86_64 (x86_64)
Consult /var/lib/dkms/vboxhost/4.2.32/build/make.log for more information.
                                                           [ERROR]
  (Failed, trying without DKMS)
Recompiling VirtualBox kernel modules                      [ERROR]
  (Look at /var/log/vbox-install.log to find out what went wrong)

我不知道问题出在哪里,我尝试更新 kernel-devel、kernel-headers、dkms 等。我将 VirtualBox 从 4.3.30 降级到 4.2.32,但没有任何效果,请帮我解决这个问题。当我有4.3.30版本的VirtualBox sudo /etc/init.d/vboxdrv setup不工作时,我遇到了vboxdrv的问题-命令不存在。昨天我正常工作,我关闭了机器和PC,今天我想使用vagrant up我遇到了这个问题。

对不起我的英语,请帮帮我,谢谢你的每一个回答!

//编辑:

我添加

/var/lib/dkms/vboxhost/4.2.32/build/make.log /var/log/vbox-install.log

【问题讨论】:

  • 你看/var/lib/dkms/vboxhost/4.2.32/build/make.log/var/log/vbox-install.log了吗?
  • 是的,我什么也不懂。 Building module: cleaning build area... make KERNELRELEASE=4.2.3-200.fc22.x86_64 -C /lib/modules/4.2.3-200.fc22.x86_64/build M=/var/lib/dkms/vboxhost/4.2.32/build..............(bad exit status: 2) Failed to install using DKMS, attempting to install without @ "/var/log/vbox-install.log" 52L, 18326C
  • 还有/var/log/vbox-install.log? (最好编辑您的问题以包含这些内容)
  • 对不起,我想从错误中添加日志,但我不能这样做,我不知道为什么。

标签: kernel vagrant virtualbox fedora


【解决方案1】:
  1. 请跑

    须藤百胜更新

  2. 请确保 Vagrant 和 Virtualbox 处于最新版本。

  3. 如果您已经安装并更新了 kernel-devel,并且收到错误消息

vboxdrv - 命令不存在

请运行:

sudo /usr/lib/virtualbox/vboxdrv.sh setup

【讨论】:

  • sudo /usr/lib/virtualbox/vboxdrv.sh setup 命令不存在。
  • 目前VirtualBox的最新版本是5.0.6。你好像还在用 4.*?
【解决方案2】:

VirtualBox Linux 内核驱动程序 (vboxdrv) 可能未加载。您可能没有为正在运行的内核安装内核驱动程序,如果是这样,您可以以 root 身份进行操作:

dnf install akmod-VirtualBox kernel-devel-$(uname -r)

如果您安装了 VirtualBox 软件包并且不想重新启动系统,则可能需要以 root 身份加载内核驱动程序:

akmods; systemctl restart systemd-modules-load.service

另外,记得安装支持的 VirtualBox 版本!!

【讨论】:

  • akmods; systemctl restart systemd-modules-load.service 对我有用,但重启没有
【解决方案3】:

我想补充一点,您必须安装 gcc...为此,请确保您先安装开发工具组。此外,您需要当前的内核源代码。

  1. sudo dnf install "kernel-devel-uname-r == $(uname -r)"
  2. sudo dnf groupinstall "Development Tools"
  3. sudo dnf update
  4. sudo /usr/lib/virtualbox/vboxdrv.sh setup

对于大多数正在运行的 VirtualBox 5.* Fedora 2[23] 来说应该可以做到这一点。

【讨论】:

    【解决方案4】:

    sudo /usr/lib/virtualbox/vboxdrv.sh setup这一行解决了ubuntu 14.04上的错误

    【讨论】:

    • 试试 sudo akmods,如果不行你应该试试 install sudo apt-get install akmods。我这也不会工作尝试重新安装 vbox-akmods。
    【解决方案5】:

    经过漫长而痛苦的试验,这是我找到的解决方案。 在版本 5.0.20 之前,Virtualbox rpm 存在问题。 该问题已在测试版本 5.0.21 中修复。从https://www.virtualbox.org/wiki/Testbuilds 获取测试版本

    这里参考问题https://www.virtualbox.org/ticket/14866

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-01-03
      • 1970-01-01
      • 2017-08-14
      • 1970-01-01
      • 2016-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多