环境:VMWare Workstation 15 Player + Fedora 36
软件:VirtualBox + vagrant
目标: 创建 vm CentOS 7
问题:
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'centos/7' version '2004.01' is up to date...
==> 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: 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", "e06f9a16-3575-4b26-a9e6-7982bb0ddbb3", "--type", "headless"]
Stderr: VBoxManage: error: VT-x is not available (VERR_VMX_NO_VMX)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole
方法尝试:
1. 确认物理机是否开启虚拟化(硬件层面:Win + X -> 系统 ->Windows系统更新->高级选项->恢复->立即启动->疑难解答->高级选项->UEFI固件设置->Intel Virtual Technology相关开关是否打开或简单方式确认:win+r->运行taskmgr->性能->虚拟化是否开启)
2. hyper-v 是否关闭(系统层面:管理员cmd->bcdedit /set hypervisorlaunchtype off 或启用或关闭Windows功能对话框内关闭hyper-v选项
3. 启用 ”VMware Workstation 15 Player - 管理-虚拟机设置-硬件 - 虚拟化引擎 - 虚拟化Intel VT-x/EPT 或AMD-V/RVI(V)“选项即可。 不用启用虚拟化CPU性能计数器 和 虚拟化IOMMU(IO内存管理单元)(I) (有效)
至此, VT-x 不可用 和 NS-ERROR_FAILTURE 问题解决(检查顺序简记:硬件系统VMWare)。
原因:VMware 默认没有开启虚拟机引擎功能, 在物理机和VM 中间屏蔽了这一功能。本质原因,未开启虚拟化引擎功能情况下, 虚拟机与物理机在双重系统调用(上下文切换)和 虚拟内存开销方面较大。
可参考简单理解资源:vmware的硬件选项里有关于虚拟化引擎的选项_枕畔雪的博客-CSDN博客_vm虚拟化引擎