簡體   English   中英

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

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

我正在嘗試在 vagrant 下設置一個 OSX(最好是 El Capitan)盒子。 我的主機操作系統是 El Capitan 10.11.6 (15G31)。

這是我迄今為止嘗試過的

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

但是,我收到以下錯誤:

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

我做錯了什么?

如何禁用 USB 2.0 支持?

編輯:那些投票結束的人,你能告訴我問題是什么嗎? 我很高興糾正它。

好吧,這真的很簡單。 我把這歸結為我對 Vagrant 缺乏經驗。

Vagrant.configure(2) do |config|添加到Vagrant.configure(2) do |config| 塊解決了問題(感謝@TomMillard):

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

您可以在設置中禁用 USB 端口。 在此處輸入圖片說明 在此處輸入圖片說明

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM