I know I can check is VT-X is supported by a processor by egrep '(vmx|svm)' /proc/cpuinfo. But even if it's supported, it can be turned off in the BIOS. How can I detect if it's turned on or off?
3 Answers
VT-X information is stored in model-specific registers (MSR) 0x34 which can be accessed via msr-tools. Install it by running sudo apt-get install msr-tools then run the following commands
sudo modprobe msr
sudo rdmsr 0x3AIf the return value is 3, 5 or 7 then VT-X is enabled
See Reliably detecting if Intel VT is disabled in the BIOS
There are two ways to verify:
On Debian-based distros (such as Ubuntu), you can check support for VT-x by installing
cpu-checkerand runkvm-okwith sudo rights.If the CPU is enabled, you should see something like:
INFO: /dev/kvm exists KVM acceleration can be usedOtherwise, you'll get:
INFO: /dev/kvm does not exist HINT: sudo modprobe kvm_intel INFO: Your CPU supports KVM extensions INFO: KVM (vmx) is disabled by your BIOS HINT: Enter your BIOS setup and enable Virtualization Technology (VT), and then hard poweroff/poweron your system KVM acceleration can NOT be usedOn Debian-based and RHEL-based systems, you can use
virt-host-validatewhich is provided by thelibvirt-clientpackage. Documentation on usage can be found here.
A very unenviable way to check (without going into the BIOS) would be to install/open Virtualbox hypervisor, and try installing a 64-bit Linux VM and see if the settings allow you to enable VT-X. Installation of VM in virtualbox is the only context where I've encountered the need to enable VT-X/AMD-V.