How to determine if CPU VT extensions are enabled in bios?

I know the command to figure out if a CPU can support VMware Workstation 8 or VMware Player 4:

$ grep flags /proc/cpuinfo
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp *lm* constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl *vmx* est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm arat dts tpr_shadow vnmi flexpriority ept vpid

and then look for the vmx and lm flags

But, it seems that even if Intel Virtual Technology extensions (i.e., VT or VT-x) are disabled in the BIOS, the /proc/cpuinfo will report the same flags.

So, how can I figure out from the Linux command line (specifically Ubuntu 10.10 in my case) if VT is actually enabled without reboxing the box?


Solution 1:

Building on Jo-Erlend Schinstad's answer:

Install cpu-checker

$ sudo apt-get update
$ sudo apt-get install cpu-checker

Then check:

$ kvm-ok

If the CPU is enabled, you should see something like:

INFO: /dev/kvm exists
KVM acceleration can be used

Otherwise, you might see something like:

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

Solution 2:

Perhaps kvm-ok can do the trick for you. It will check your cpuflags, then see if you have a kvm device, and finally it will check if virtualization is disabled in the bios.

Of course, this means it'll fail if you don't have kvm installed. If you use kvm, you probably won't be able to use VMWare stuff at the same time, and vice versa. However, kvm will only be used when you actually run a VM.

Solution 3:

It seems one can check directly with the msr-tools

http://linux.koolsolutions.com/2009/09/19/howto-using-cpu-msr-tools-rdmsrwrmsr-in-debian-linux/

$ sudo apt-get update
$ sudo apt-get install msr-tools
$ sudo modprobe msr
$ sudo rdmsr 0x3A

The register should return 5 if the extensions are enabled, and return 1 if disabled.