Open In App

linux – How to detect if VT-X has been turned on in the BIOS?

Last Updated : 10 Oct, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

While setting up virtual machines on Linux, sometimes we might face issues due to the absence of VT-X. VT-X, short for Intel’s Virtualization Technology, is a hardware feature available on Intel processors that allows users to run multiple virtual machines or operating systems simultaneously. It’s important to note that VT-X is not exclusive to Linux; it can be utilized by various virtualization platforms, including those running on Linux, Windows, or macOS.

What is VT-X?

VT-X is Intel’s Virtualization Technology. It is a hardware technology that allows users to run multiple virtual machines or OS at the same time. This technology is more or less vital for virtualization and therefore most of the emulators or virtual machines like Virtual Box, Android Studio, etc. require enabling of this feature. However, since this feature is not generally used by most people, it’s often turned off by default and needs to be turned on from inside the BIOS. It should also be noted that VT-X is for Intel processors, but AMD processors also have a similar technology called AMD-V serving the same purpose. However, not all AMD processors support AMD-V.

How to detect if VT-X is enabled in Linux?

There are multiple ways to detect whether VT-X is enabled or not while using Linux. And we will take a quick look at them.

Using lscpu command

lscpu is used to collect information about CPU’s architecture based on data from sysfs and /proc/cpuinfo. This simple command line utility that can give us a lot of information about the CPU. It gives users details about the CPU architecture, its op-mode, min and max frequencies, amount of cache available, virtualization information and much more.

However, since we need only information about Virtualization hence we can use grep command along with lscpu to find details related to virtualization alone.

Step 1 : Open the terminal using application menu or Ctrl+Alt+T

Step 2 : Execute the command lscpu | grep “Virtualization”

Step 3 : Check if VT-x is visible in the output or not

lscpu | grep "Virtualization"


ls

lscpu

If you get an output similar to the above screenshot with VT-X or AMD-V in the output, then VT-X is enabled, otherwise it is disabled.

Using /proc/cpuinfo

cpuinfo is a file on Linux systems that contains information about the CPU present in the system. This file is in the proc directory inside of the root directory.

We can use this file along with egrep – c to find how many occurrences refer the words vmx and svm. These are flags related to virtualization and their presence also indicates the availability or unavailability of VT-X or equivalent features.

Step 1 : Open the terminal using application menu or Ctrl+Alt+T

Step 2 : Execute the command egrep -c ‘(vmx|svm)’ /proc/cpuinfo

Step 3 : Check if the output is greater than 0 or not

egrep -c '(vmx|svm)'  /proc/cpuinfo


proc

/proc/cpuinfo

If you get a non zero output similar to above screenshot then VT-X is enabled, however if you get 0 in output then it is disabled

Using kvm

kvm stands for kernel virtual machine and is a hypervisor system built into Linux kernel. And It can also be used to see whether or not VT-X is enabled. Since kvm-ok utility is not installed by default on most systems, we can install cpu-checker utility from the command line using the apt installer and then use kvm-ok command to verify if VT-X is enabled.

Step 1 : Open the terminal using application menu or Ctrl+Alt+T

Step 2 : Execute the command sudo apt install cpu-checker to install the cpu-checker tool

Step 3 : Run the command kvm-ok

Step 4 : Verify whether /dev/kvm exists or not in the output

sudo apt install cpu-checker
kvm-ok


kvm

kvm-ok

If you get an output similar to the above screenshot stating ‘KVM acceleration can be used’ then VT-X is enabled or else it is disabled.

Using BIOS

If none of the above approaches seem to be working then you can manually enter your BIOS (Basic Input Output System) and see for yourself whether or not VT-X is enabled in the BIOS. This is one of the more involved process, and needs some patience and time.

Step 1 :

Reboot your PC/laptop and click its vendor specific boot key at startup (Kindly remember that these keys differ between various device vendors). Some examples of boot keys are :

ASUS : F2 key Acer : F2 or Del Key

HP : F10 Key Lenovo : F1 or F2

Dell : F12

Step 2:

At this point you might see a Boot menu screen similar to the following :

menu

Boot Menu

From here, choose the appropriate Key to enter the BIOS settings (In our case it is F10).

Step 3 :

At this point you will see a settings screen similar to the following :

bio

BIOS Settings

Step 4 :

Use the keyboard to navigate to System Configurations and look for virtualization related setting and see if it is enabled or disabled. If its disabled then VT-X is disabled, and you can just enable it right here. Just change the Virtualization to enabled and VT-X should now be enabled.

bios

Enable Virtualization Technology

Step 5 :

Exit the BIOS and ensure that the changes are saved. Now reboot your system and VT-X should now be enabled.

save

Save changes

Conclusion

VT-x is essential for purposes of virtualization on Linux systems. But sometimes, it might be disabled by us or the device manufacturer. In such case Linux does provide us with a lot of tools to check and verify whether or not VT-x is enabled in the BIOS or not. All this means that we can, in most cases, be able to check this without entering the BIOS and accidentally changing some settings.

As we can imagine, It’s not necessary that we all these commands will work for everyone. It might so happen that a command might not work on your machine due to some dependencies issue, so knowing multiple approaches to the same thing is a plus point on Linux. However, As a general rule of thumb :

  1. Use lscpu command to check for VT-x ,as it is easy to use and built into most Linux distros
  2. Use other commands like kvm-ok and egrep -c ‘(vmx|svm)’ /proc/cpuinfo, if lscpu does not work
  3. Use the BIOS if nothing else works or if you actually wish to enable VT-x feature



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads