【问题标题】:E_ACCESSDENIED when creating a host-only interface on virtualbox via vagrant [closed]通过 vagrant 在 vi​​rtualbox 上创建仅主机接口时的 E_ACCESSDENIED [关闭]
【发布时间】:2021-12-12 03:23:00
【问题描述】:

升级到 VirtualBox 6.1.28 后尝试运行 vagrant up 时,收到以下错误消息

There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["hostonlyif", "ipconfig", "vboxnet0", "--ip", "192.168.33.1", "--netmask", "255.255.255.0"]

Stderr: VBoxManage: error: Code E_ACCESSDENIED (0x80070005) - Access denied (extended info not available)
VBoxManage: error: Context: "EnableStaticIPConfig(Bstr(pszIp).raw(), Bstr(pszNetmask).raw())" at line 242 of file VBoxManageHostonly.cpp

【问题讨论】:

  • 嘿,这是 stackoverflow.com/questions/69722254/… 的完全相同的副本 - 请不要发布两次相同的问题
  • 我没有使用 ubuntu,因此该解决方案对我不起作用。感谢您的尝试
  • 为什么降级无法在您的系统上运行?你是如何尝试运行 vagrant 的?它在过去有效吗?您是否尝试以管理员身份执行此操作,因为该错误可能表明更改网络设置的权限不足?
  • 这个问题被标记为已关闭,但它确实应该被标记为stackoverflow.com/questions/69722254/…的重复项

标签: security vagrant virtualbox computer-science helper


【解决方案1】:

我在 macOS Monterey (12.0.1)、Vagrant (2.2.18)、VirtualBox (6.1.28 r147628) 上看到了这个确切的错误。我必须手动启用内核扩展

sudo kextload -b org.virtualbox.kext.VBoxDrv
sudo kextload -b org.virtualbox.kext.VBoxNetFlt
sudo kextload -b org.virtualbox.kext.VBoxNetAdp
sudo kextload -b org.virtualbox.kext.VBoxUSB

来自here

在 GUI 中启动机器,停止它,然后运行 ​​vagrant up 工作,将 gui 设置为 true。

【讨论】:

    【解决方案2】:

    跟进:这是由于 Virtual Box 最近引入了一项更改,其中限制了仅主机网络的可用 IP 范围,除非您在 VirtualBox 的配置文件中手动覆盖它。

    Vagrant 刚刚合并了一个更改,该更改旨在在您尝试使用配置的允许范围之外的 IP 时提供更好的错误消息:github.com/hashicorp/vagrant/pull/12564

    正确的解决方法是根据 virtualbox.org/manual/ch06.html#network_hostonly 更新 /etc/vbox/networks.conf

    原创: 我在 VirtualBox 6.1.28 上的 Arch 上遇到了同样的问题。它似乎与 Vagrant 无关。

    奇怪的是,我可以更改适配器的 IPv4 地址(通过 VBoxManage 或 GUI),但只能在 192.168.56.1192.168.63.254 之间更改。超出此范围的任何内容都会失败。

    【讨论】:

    • 很好的解决方法,谢谢。我使用192.168.22.101 作为我的盒子的private_network IP,它产生了那个错误。当我将其更改为 192.168.62.101 时,它起作用了。
    • @JethroCao 这实际上是由于 Virtual Box 最近引入的一项更改,其中主机网络的可用 IP 范围受到限制除非您在 VirtualBox 的配置文件中手动覆盖它 . Vagrant 刚刚合并了一个更改,该更改旨在当您尝试使用配置的允许范围之外的 IP 时能够提供更好的错误消息:github.com/hashicorp/vagrant/pull/12564 正确的解决方法是根据virtualbox.org/manual/ch06.html#network_hostonly 更新/etc/vbox/networks.conf
    • @MichaelAmbrose 此评论似乎是正确答案。您介意重新发布它作为问题的答案,以便它可以被投票和接受吗?
    • @Glenjamin 好点,我刚刚更新了我原来的答案
    【解决方案3】:

    我在使用 vagrant 2.2.13 版和 VirtualBox 6.1.28 版的 CentOS 7 上遇到了这个问题。我将 VirtualBox 降级到 6.1.26,这似乎解决了这个问题:

    $ sudo yum downgrade VirtualBox-6.1.x86_64
    

    【讨论】:

      猜你喜欢
      • 2015-11-12
      • 1970-01-01
      • 2012-07-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-19
      相关资源
      最近更新 更多