check if VT-x is activated without having to reboot in Linux?

后端 未结 7 554
囚心锁ツ
囚心锁ツ 2020-12-23 16:59

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 Li

7条回答
  •  死守一世寂寞
    2020-12-23 17:20

    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.)

提交回复
热议问题