简体   繁体   English

如何在 Vagrant 下运行 OSX El Capitan Box?

[英]How can I run an OSX El Capitan Box under Vagrant?

I'm trying to get an OSX (ideally El Capitan) box set up under vagrant.我正在尝试在 vagrant 下设置一个 OSX(最好是 El Capitan)盒子。 My host OS is El Capitan 10.11.6 (15G31).我的主机操作系统是 El Capitan 10.11.6 (15G31)。

Here's what I've tried so far这是我迄今为止尝试过的

vagrant init
vagrant box add jhcook/osx-elcapitan-10.11
# edit vagrant init such that config.vm.box = "jhcook/osx-elcapitan-10.11"
vagrant up

However, I obtain the following error:但是,我收到以下错误:

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'jhcook/osx-elcapitan-10.11'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'jhcook/osx-elcapitan-10.11' is up to date...
==> default: Setting the name of the VM: ratatouille_default_1471905801413_58611
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["startvm", "e1aafdeb-650b-4b94-89cf-4ef39e22e7f6", "--type", "headless"]

Stderr: VBoxManage: error: Implementation of the USB 2.0 controller not found!
VBoxManage: error: Because the USB 2.0 controller state is part of the saved VM state, the VM cannot be started. To fix this problem, either install the 'Oracle VM VirtualBox Extension Pack' or disable USB 2.0 support in the VM settings.
VBoxManage: error: Note! This error could also mean that an incompatible version of the 'Oracle VM VirtualBox Extension Pack' is installed (VERR_NOT_FOUND)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole

What am I doing wrong?我做错了什么?

How can I disable USB 2.0 support?如何禁用 USB 2.0 支持?

Edit : Those voting to close, could you please tell me what the problem is?编辑:那些投票结束的人,你能告诉我问题是什么吗? I'm happy to correct it.我很高兴纠正它。

Okay, it was really simple.好吧,这真的很简单。 I'm chalking this up to inexperience with Vagrant on my part.我把这归结为我对 Vagrant 缺乏经验。

Adding the following lines to the Vagrant.configure(2) do |config| Vagrant.configure(2) do |config|添加到Vagrant.configure(2) do |config| block has solved the problem (thanks @TomMillard):块解决了问题(感谢@TomMillard):

  # disable USB 2.0
  config.vm.provider "virtualbox" do |vb|
      vb.customize ["modifyvm", :id, "--usb", "off"]
      vb.customize ["modifyvm", :id, "--usbehci", "off"]
  end

You can disable the USB port on the settings.您可以在设置中禁用 USB 端口。 在此处输入图片说明 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM