Vagrant up - VBoxManage.exe错误:VT-x不可用(VERR_VMX_NO_VMX)代码E_FAIL(0x80004005)gui无头

Aru*_*gal 33 virtualbox headless vagrant vagrantfile windows-10

机器:Window10(64位).

我下载了最新的VirtualBox,Vagrant和初始化的CentOS 6.7 64位图像/网址.

以下在Git-Bash会话中成功运行.
1. vagrant box添加"centos67x64"" https://github.com/CommanderK5/packer-centos-template/releases/download/0.6.7/vagrant-centos-6.7.box "
2. vagrant init
3.更新了Vagrantfile(并转为vb.gui选项,即取消注释文件中的配置部分).

  config.vm.provider "virtualbox" do |vb|
    # Display the VirtualBox GUI when booting the machine
    vb.gui = true

    # Customize the amount of memory on the VM:
    vb.memory = "2048"
  end
Run Code Online (Sandbox Code Playgroud)

之后,我尝试了以下命令,但我收到此错误消息.

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'centos67x64'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: vv_default_1466548735200_80300
==> 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", "ae74ebaa-8f01-48cf-bdad-956c59ef1208", "--type", "gui"]

Stderr: VBoxManage.exe: error: VT-x is not available (VERR_VMX_NO_VMX)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole
Run Code Online (Sandbox Code Playgroud)

如果我关闭/注释掉整个Vagrantfile的相应部分,我仍然会收到以下错误.

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> 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", "ae74ebaa-8f01-48cf-bdad-956c59ef1208", "--type", "headless"]

Stderr: VBoxManage.exe: error: VT-x is not available (VERR_VMX_NO_VMX)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole
Run Code Online (Sandbox Code Playgroud)

有任何想法吗!我查看了其他帖子,但在我的案例中找不到如何解决.

当我得到一些提示时,我尝试了其中一个解决方案.

  1. 关闭Hyper-V,我猜在Windows10中默认关闭.
  2. 为了做到这一点,我去了Windows10中的控制面板并查看了这里并找到了这个. 在此输入图像描述

  3. 然后,我通过取消选中(刻度线或黑框)关闭Hyper-V.

  4. Windows10告诉我RESTART,我说"不"(后来).
  5. 尝试再次运行"vagrant up"(无论是否有任何更改或上面提到的config.vm ...更改为Vagrantfile).它没有用,并给了我相同的 - 无误的错误信息.

  6. 好的,是时候重启了.重启Windows10.重新启动后,我看到一堆Virtual Box错误消息弹出窗口(其中很少显示如下).

在此输入图像描述 在此输入图像描述 在此输入图像描述 在此输入图像描述

  1. 一旦我点击所有这些Virtual Box弹出窗口上的OK按钮,我就试着在我的机器上运行Virtual Box,它很好(成功).
  2. 现在,我打开Git-BASH并再次访问Vagrantfile所在的目录.尝试打开/关闭设置或注释/取消注释Vagrantfile相应部分(如上所述).

仍然获得运行"vagrant up"的相同错误消息(即使在关闭Hyper-V之后也是如此).

fip*_*ips 40

默认情况下,在Windows 8/10中停止运行hyper-v服务,因为它会阻止对VT硬件的所有其他调用.

其他解释如下:https: //social.technet.microsoft.com/Forums/windows/en-US/118561b9-7155-46e3-a874-6a38b35c67fd/hyperv-disables-vtx-for-other-hypervisors?forum=w8itprogeneral

同样如您所述,如果尚未启用,请在BIOS设置中启用Intel VT虚拟化并重新启动计算机.

  • 从命令窗口关闭Windows上的Hypervisor:"bcdedit/set hypervisorlaunchtype off"并重新启动.要重新打开它:"bcdedit/set hypervisorlaunchtype on"(或自动启动)并重新启动. (16认同)
  • @TjKellie,您的建议对我有用,谢谢。也许您想编辑您的命令,并在其中添加用户应该是管理员才能执行该命令。:) (2认同)

f-s*_*ety 35

我刚刚通过禁用(取消选中)Hyper-V解决了这个问题.我安装Docker时似乎启用了Hyper-V

Control Panel -> Program And Features -> Turn Windows Features on or off.
Run Code Online (Sandbox Code Playgroud)

您可能需要重新启动后续文字.

警告:使用VirtualBox的Vagrant无法同时使用Docker.


use*_*314 10

虽然这是一个老问题,但我最近仍然遇到它。

这就是在运行 Windows 10 的 i7-3770 3.40GHz、Z77 极限主板上对我有用的方法。

在 Windows 中,禁用 Hyper-V:

  1. 以管理员身份打开 PowerShell 或 CMD 会话。
  2. 键入以下命令:dism.exe /Online /Disable-Feature:Microsoft-Hyper-V-All
  3. Windows 会要求您重新启动。

在bios中:

  1. 禁用 >>> Intel 虚拟化技术,vt-d
  2. 保存 bios 设置并允许它重新启动并引导到 Windows。
  3. 关闭计算机(我试过重新启动但没有用)
  4. 启动计算机,进入 bios 并重新启用上述禁用设置。
  5. 保存,重启。

下载英特尔实用程序进行检查。

您现在应该看到它已被支持:

截屏

如果它仍然不起作用,请先尝试重新启用 Hyper-V,然后按照上述步骤操作。


Moh*_*zim 7

Docker可能是罪魁祸首。安装docker后我遇到了同样的问题。Docker使用Windows hyper-v驱动程序创建容器。因此,Docker和Virtual Box可能无法一起使用!