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?
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 0x3A
If the return value is 3, 5 or 7 then VT-X is enabled
There are two ways to verify:
On Debian-based distros (such as Ubuntu), you can check support for VT-x by installing
kvm-okwith sudo rights.
If the CPU is enabled, you should see something like:
INFO: /dev/kvm exists KVM acceleration can be used
Otherwise, 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 used
On Debian-based and RHEL-based systems, you can use
virt-host-validatewhich is provided by the
libvirt-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.