Created
May 17, 2013 05:01
-
-
Save kevinbin/5597024 to your computer and use it in GitHub Desktop.
check hardware support virtualization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cpuinfo=`egrep '^flags.*(vmx|svm)' /proc/cpuinfo` | |
if [ "$cpuinfo" = "" ]; then | |
echo "There doesn't appear to be any hardware support for virtualization" | |
exit | |
fi | |
hardware=`dmesg | grep kvm | grep -i 'no hardware support'` | |
bios=`dmesg | grep kvm | grep -i 'disabled by bios'` | |
if [ "$hardware" != "" ]; then | |
echo "No hardware support for KVM" | |
exit | |
fi | |
if [ "$bios" != "" ]; then | |
echo "KVM disabled by bios" | |
exit | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment