How to check VT-x status on MacBook Pro
I need to enable VT-x on my MacBook Pro, but I don't know whether it's enabled or not. Are there commands for checking the status of, enabling, or disabling VT-x?
Those are my device specifications:
MacBook Pro (Retina, 13-inch, Early 2015)
OS: OS X El Capitan 10.11.2
CPU: 2.7 GHz Intel Core i5
RAM: 8 GB 1867 MHz DDR3
According to Intel® Core™ i5-5257U Processor, it supports Intel Virtualization Technology (VT-x).
You can also from Terminal use the following command:
sysctl -a | grep machdep.cpu.features
If you see VMX in the output, then the CPU supports the Intel VT-x feature.
If you don't want to have to read through the output of CPU features and just see if VMX is there, then use: sysctl -a | grep -o VMX
From Intel-based Macs: Using VT-x virtualization technology:
Intel VT-x technology is enabled on Intel-based Macs. Make sure your Intel-based Mac has all available EFI updates installed; also update any third-party virtualization software.
Therefore there is no reason to check the status.
As to enabling/disabling, there is no direct user interface for that. Since it is enabled by default, the only way I can think of to disable it would be to hack the EFI Firmware. Which is not something I'd recommend doing!
While the answer by @user3439894 indicates that the mac firmware should set VMX on during boot it doesn't in either my 2013 or 2014 MBP. This means that Hyper-V (in bootcamp) does not work without a fix.
To tell if vmx is actually enabled you need to check the 0x3a CPU register - see Activating the Intel VT Virtualization Feature. This can only be done using RDMSR which requires kernel level permissions.
If the EFI is not setting this correctly then the easiest way is to fix this is using rEFInd and set enable_and_lock_vmx
in refind.conf to 1
When set to true or a synonym, enable the CPU's VMX bit and lock the MSR. This configuration is necessary for some hypervisors (notably Microsoft's Hyper-V) to function properly. Activating it on other CPUs will, at best, have no effect, and could conceivably crash the computer, so enable it at your own risk!
If your firmware supports activating these features, you should use it instead; this option is provided for users whose firmware does not provide this functionality. (Many Macs lack this configurability, for instance.) The default is false.
This works like this (taken from rEFInd source but can be compiled separately).
#include "../include/tiano_includes.h"
static VOID DoEnableAndLockVMX(VOID)
{
UINT32 msr = 0x3a;
UINT32 low_bits = 0, high_bits = 0;
// is VMX active ?
__asm__ volatile ("rdmsr" : "=a" (low_bits), "=d" (high_bits) : "c" (msr));
// enable and lock vmx if not locked
if ((low_bits & 1) == 0) {
high_bits = 0;
low_bits = 0x05;
msr = 0x3a;
__asm__ volatile ("wrmsr" : : "c" (msr), "a" (low_bits), "d" (high_bits));
}
} // VOID DoEnableAndLockVMX()
EFI_STATUS
EFIAPI
efi_main (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
DoEnableAndLockVMX();
return EFI_SUCCESS;
}