Skip to content

Commit

Permalink
devtool: check whether the user is in a vm
Browse files Browse the repository at this point in the history
Signed-off-by: Mihai Stan <stanmihai17cs@gmail.com>
  • Loading branch information
Mehigh17 authored and dianpopa committed May 29, 2020
1 parent ce59238 commit 97606e4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tools/devtool
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,13 @@ check_swap () {
say_warn "WARNING: SWAP enabled"
}

check_vm() {
if [ $(dmesg | grep -c -i "hypervisor detected") -gt 0 ]; then
say_warn "WARNING: you are running in a virtual machine." \
"Firecracker is not well tested under nested virtualization."
fi
}

cmd_checkenv() {
# Parse any command line args.
while [ $# -gt 0 ]; do
Expand All @@ -849,6 +856,7 @@ cmd_checkenv() {
say "Please check $QUICKSTART in case of any error."
ensure_kvm_rw
check_kernver
check_vm
say "Checking Host Security Configuration."
say "Please check $PROD_DOC in case of any error."
check_KSM
Expand Down

0 comments on commit 97606e4

Please sign in to comment.