I have a laptop with Intel Core i5 M 450 @ 2.40GHz which apparently has VT-x but not VT-d. I have Ubuntu 12.04 32bit but would like to have a virtual 64bit terminal-based Linux running on it. How do I know if the BIOS has this VT-x feature activated without having to reboot?
8 Answers
You can use rdmsr from msr-tools to read register IA32_FEATURE_CONTROL (address 0x3a). The kernel module msr has to be loaded for this.
On most Linux systems:
sudo modprobe msr
sudo rdmsr 0x3a
Values 3
and 5
mean it's activated.
-
1`sudo rdmsr 0x3a` gives me `5` – 719016 Jun 20 '12 at 13:03
-
1As far as I understand 3 and 5 mean VT-x is activated. – scai Jun 20 '12 at 13:11
-
8Here's a bit more on those MSR bits: http://www.thomas-krenn.com/en/wiki/Activating_the_Intel_VT_Virtualization_Feature http://security.stackexchange.com/questions/15555/can-a-hypervisor-rootkit-enable-hardware-assisted-virtualization-when-it-has-bee – Tobu Jun 22 '13 at 19:00
-
I am getting value "7" with Linux kernel version 4.8.15, so the VMXON/VT-x option is set and is locked? Interesting. – mariusm Jan 19 '17 at 08:53
-
11On AMD Ryzen I get `rdmsr: CPU 0 cannot read MSR 0x0000003a`. – Forivin Jul 11 '18 at 08:38
-
3Installing msr-tools package on Ubuntu 16.04 (Xenial Xerus) is as easy as running the following command on terminal: `sudo apt-get update sudo apt-get install msr-tools` – Allan F. Gagnon Sep 05 '18 at 15:04
-
1This fails on a `AMD RX-427BB` too: `rdmsr: CPU 0 cannot read MSR 0x0000003a` – Fake Name Feb 18 '19 at 06:28
You can use
sudo kvm-ok
from cpu-checker. On Intel, which has the most complicated logic, kvm-ok checks that if bit 0 of rdmsr 0x3a
(the lock bit) is set, bit 2 (which allows virt use outside of SMX mode, something to do with trusted boot) must also be set. If the output of rdmsr 0x3a
is anything but 1 or 3, you will be able to use kvm. kvm will set bit 2 of the msr if necessary, I expect virtualbox and the rest have the same logic.

- 24,771
- 4
- 91
- 98
Install cpu-checker and run "kvm-ok"
If the CPU is enabled, you should see something like:
INFO: /dev/kvm exists
KVM acceleration can be used
othewise
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

- 4,674
- 2
- 28
- 45
-
4The `kvm-ok` is just for ubuntu systems. It can’t be used on debian or red hat. – shgnInc May 06 '14 at 05:17
-
12On RHEL derivatives we have `virt-host-validate` which is provided by `libvirt-client` – xenithorb Jan 16 '17 at 04:43
-
on Ryzen Fedora 36 virt-host-validate says "Checking if device /dev/kvm exists : FAIL (Check that the 'kvm-intel' or 'kvm-amd' modules are loaded & the BIOS has enabled virtualisation). Which doesn't completely clarify whether I need to re-boot to check the BIOS (although kvm-amd is not loaded according to lsmod) – nigel222 Mar 03 '23 at 11:49
-
In linux you can check cpuinfo:
cat /proc/cpuinfo| egrep "vmx|svm"
-
10This will only show if VT-x is supported by the CPU, not if it is activated in the BIOS. – scai Jun 20 '12 at 13:11
-
Are you sure? When I'm inside my vm it give me an empty line but my cpu supports amd-v? In cpu-z I can see amd-v even when I disabled secure virtual machine in the bios? – Micromega Jun 20 '12 at 13:16
-
@Betterdev I'm not sure the virtual CPU is relevant. Anyway, by saying a CPU info tool reports the presence of AMD-V, despite it being unusable because you disabled SVM in the firmware, you're proving scai's point... – underscore_d Aug 01 '16 at 18:28
-
This only shows if the CPU has one of those particular extensions; it won't show anything relevant to the BIOS configuration. Check out the full output without `grep` to see what it's about. – Giorgi Gzirishvili Sep 16 '19 at 13:52
I found that scai's answer doesn't work on my AMD Ryzen systems.
This however works really well for me, even on Intel:
if systool -m kvm_amd -v &> /dev/null || systool -m kvm_intel -v &> /dev/null ; then
echo "AMD-V / VT-X is enabled in the BIOS/UEFI."
else
echo "AMD-V / VT-X is not enabled in the BIOS/UEFI"
fi
(systool
is found in the sysfsutils
package on most distros.)
For Intel's VT-D / AMD's IOMMU, I came up with this solution:
if compgen -G "/sys/kernel/iommu_groups/*/devices/*" > /dev/null; then
echo "AMD's IOMMU / Intel's VT-D is enabled in the BIOS/UEFI."
else
echo "AMD's IOMMU / Intel's VT-D is not enabled in the BIOS/UEFI"
fi
(It even worked for me if the iommu kernel parameters are not set.)

- 14,780
- 27
- 106
- 199
-
1Note: This requires the `sysfsutils` package, but does not return an error if you don't have it (it just returns "you don't have virt stuff"). – Fake Name Feb 18 '19 at 06:32
A simple approach to confirm that Vt-D is enabled in the BIOS is through the Linux system. If the VT-D is enable in the BIOS and Iommu=on
in the grub.cfg
then the below folder structure is created automatically to hold the Virtual devices.
/sys/kernel/iommu_groups/0/devices/0000:00:00.0
Whereas if either one of the options VT-D or Iommu is not configured/enabled then the above mentioned folder structure is not created. This behavior is confirmed in CentOS 7.4 and Ubuntu. Hopefully this behavior is similar for other operating systems as well but this would need to be confirmed.

- 852
- 14
- 31

- 11
- 2
-
1On Ryzen and Fedora 36 I have /sys/kernel/iommu_groups/0/devices/0000:00:01.0/ (01 not 00). And can't run KVM and don't know if I have to reboot to check BIOS. – nigel222 Mar 03 '23 at 11:46
Coming late to this party but it may be a long-lived question/answer. On Ryzen, Fedora 36, none of the other answers completely clarify whether I need to reboot. Red Hat provides this
In short, to check AMD CPU:
$ grep -E 'svm|vmx' /proc/cpuinfo
(but I know that Ryzen is capable) Then,
# lsmod | grep kvm
To check for kvm_amd or kvm_intel. No kvm_amd
module loaded, so that suggests a re-boot to check BIOS is needed. Will update later.

- 7,582
- 1
- 14
- 22
-
Yes, it was disabled in BIOS. Hard to find on Gigabyte A320M. Hidden under MIT / Advanced Frequency Settings! – nigel222 Mar 08 '23 at 12:18