Skip to content

Commit

Permalink
Disable VT-x/AMD-V for guest OS on machines without this feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
glenux committed Jan 25, 2020
1 parent e0d3887 commit 27982fa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ievms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,13 @@ build_ievm() {
log "Creating ${vm} VM (disk: ${disk_path})"
VBoxManage import "${ova}" --vsys 0 --vmname "${vm}" --unit "${unit}" --disk "${disk_path}"

if ! grep -E -q '(vmx|svm)' /proc/cpuinfo ; then
log "Disable VT-x/AMT-V on ${vm} (not available on your CPU)"
VBoxManage modifyvm "${vm}" --hwvirtex off --hwvirtexexcl off --vtxvpid off --nestedpaging off
# FIXME: still complains about VT-x if CPU count is not set to 1 (don't know why...)
VBoxManage modifyvm "${vm}" --cpus 1
fi

log "Adding shared folder"
VBoxManage sharedfolder add "${vm}" --automount --name ievms \
--hostpath "${ievms_home}"
Expand Down

0 comments on commit 27982fa

Please sign in to comment.