50

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?

1
  • The virtualization extensions can not be disabled in the BIOS for AMD-V. The Intel VT extensions can be disabled in the BIOS. Certain laptop vendors have disabled the Intel VT extensions by default in their CPUs. Per Redhat documentation Section 36.12
    – Genovo
    Jun 18, 2022 at 14:32

3 Answers 3

57

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
16

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.

3
  • 2
    It would be interesting to know what kvm-ok checks, or VMware Player checks, to determine the BIOS settings. Then, one could just check that directly.
    – pcapademic
    Feb 13, 2012 at 22:57
  • 1
    The manual page says «If running as root, it will check your CPU's MSRs to see if VT is disabled in the BIOS.» I have no idea what that means though :) Feb 14, 2012 at 0:34
  • Sounds good, also the guy bellow confirms it. Feb 20, 2012 at 20:06
14

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.

3
  • 3
    Does it know how to distinguish lack of cpu support from not being enabled in the bios?
    – nealmcb
    Feb 6, 2015 at 17:22
  • Thanks - this worked for me on debian to confirm I wasn't going crazy when vmx didn't show up in /proc/cpuinfo but still let me boot VMs :) these instructions in German are the clearest I've found that indicated that the return value of 7 that I got is alright too: heise.de/ct/hotline/…
    – Dmitri DB
    Jun 3, 2016 at 0:16
  • Instead of 5 or 1, I get 0. Maybe that means lack of cpu support.
    – Donn Lee
    Sep 16, 2016 at 20:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .