【问题标题】:Vagrant Up Error Operation not permitted不允许 Vagrant Up 错误操作
【发布时间】:2016-10-03 05:39:46
【问题描述】:

我正在尝试安装 laravel/homestead,但是在安装过程中,我在运行命令 vagrant up 时遇到了 VBoxManage 错误,我该如何解决这个问题?

  • 发行版:openSUSE Leap 42.1
  • 流浪版本:1.8.6
  • VirtualBox 版本:5.0.26_SUSE r108824

错误:

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

Command: ["hostonlyif", "create"]

Stderr: 0%...
Progress state: NS_ERROR_FAILURE
VBoxManage: error: Failed to create the host-only adapter
VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: Operation not permitted
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
VBoxManage: error: Context: "RTEXITCODE handleCreate(HandlerArg*)" at line 71 of file VBoxManageHostonly.cpp

这和权限有关系吗?因为Operation not permitted

我用ls -l /dev/vboxnetctl检查了文件,这是它返回的内容:

crw------- 1 root root 10, 55 Oct  3 07:24 /dev/vboxnetctl

我应该更改此文件的权限吗?如果是这样,我想让你知道我之前做过,它仍然显示错误,但是这个错误是不同的:

/home/troopy712139/Homestead/scripts/homestead.rb:4:in `configure': undefined method `[]' for nil:NilClass (NoMethodError)
    from /home/troopy712139/Homestead/Vagrantfile:30:in `block in <top (required)>'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/v2/loader.rb:37:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/v2/loader.rb:37:in `load'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:113:in `block (2 levels) in load'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:107:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:107:in `block in load'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:104:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:104:in `load'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/vagrantfile.rb:28:in `initialize'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:746:in `new'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:746:in `vagrantfile'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:492:in `host'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:214:in `block in action_runner'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/runner.rb:33:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/runner.rb:33:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:479:in `hook'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:728:in `unload'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/bin/vagrant:177:in `ensure in <main>'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/bin/vagrant:177:in `<main>'

VBoxManage hostonlyif create 命令在我以 root 运行时运行过一次。

0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interface 'vboxnet1' was successfully created

【问题讨论】:

    标签: laravel vagrant virtualbox homestead


    【解决方案1】:

    你能试试运行sudo vagrant up --provision吗?

    您可能还需要检查以确保您的路径在 Homestead.yaml 文件中匹配

    【讨论】:

    • 'sudo vagrant up --provision' 仍然给我同样的错误。因为我是 Homestead 的新手,所以我没有对我的“Homestead.yaml”文件做任何事情。
    【解决方案2】:

    看来我需要做的就是让vboxnetctl 归我所有,然后重新启动我的电脑。我还添加了vboxdrv,通过运行以下代码在启动时运行:

    service vboxdrv start
    

    【讨论】:

      【解决方案3】:

      周围的错误:/dev/vboxnetctl 告诉您您的用户无权访问那里。

      尝试一下: sudo usermod -a -G vboxusers

      阿尔瓦罗

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-01-14
        • 2021-11-18
        • 2012-06-11
        • 2017-04-28
        • 1970-01-01
        相关资源
        最近更新 更多