Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Virtualbox not support embeded virtualization, better to detect it before install #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions hyper-bootstrap-xen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ UBUNTU_CODE=(trusty utopic vivid)
DEBIAN_CODE=(jessie wheezy)
CENTOS_VER=(6 7)
FEDORA_VER=(20 21 22)
UNSUPPORTED_VIRT_METHOD=(VirtualBox)
#Color Constant
RED=`tput setaf 1`
GREEN=`tput setaf 2`
Expand All @@ -37,6 +38,7 @@ ERR_ROOT_PRIVILEGE_REQUIRED=(10 "This install script need root privilege, please
ERR_NOT_SUPPORT_PLATFORM=(20 "Sorry, Hyper only support x86_64 platform!")
ERR_NOT_SUPPORT_DISTRO=(21 "Sorry, Hyper only support ubuntu/debian/fedora/centos/linuxmint(17.x) now!")
ERR_NOT_SUPPORT_DISTRO_VERSION=(22)
ERR_NOT_SUPPORT_VIRT_METHOD=(23 "Sorry, Hyper not support install in virtualbox!")
ERR_NO_HYPERVISOR=(39 "You should have either Xen 4.5+ or Qemu 2.0+ installed to run hyper")
ERR_QEMU_NOT_INSTALL=(40 "Please install Qemu 2.0+ first!")
ERR_QEMU_LOW_VERSION=(41 "Need Qemu version 2.0 at least!")
Expand Down Expand Up @@ -99,6 +101,7 @@ check_deps() {
show_message info "Check dependency "
check_deps_platform
check_deps_distro
check_deps_virt_method
check_deps_qemu || check_deps_xen || exit ${${ERR_NO_HYPERVISOR[0]}}
check_deps_initsystem
show_message done " Done"
Expand Down Expand Up @@ -181,6 +184,14 @@ check_deps_distro() {
esac
echo -n "."
}
check_deps_virt_method() {
VIRT_METHOD=$(dmidecode -s system-product-name)
if (echo "${UNSUPPORTED_VIRT_METHOD}" | grep -qw "${VIRT_METHOD}");then
show_message error "${ERR_NOT_SUPPORT_VIRT_METHOD[1]}"
exit ${ERR_NOT_SUPPORT_VIRT_METHOD[0]}
fi
echo -n "."
}
check_deps_xen() {
set +e
${BASH_C} "which xl" >/dev/null 2>&1
Expand Down
11 changes: 11 additions & 0 deletions hyper-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ UBUNTU_CODE=(trusty utopic vivid)
DEBIAN_CODE=(jessie wheezy)
CENTOS_VER=(6 7)
FEDORA_VER=(20 21 22)
UNSUPPORTED_VIRT_METHOD=(VirtualBox)
#Color Constant
RED=`tput setaf 1`
GREEN=`tput setaf 2`
Expand All @@ -37,6 +38,7 @@ ERR_ROOT_PRIVILEGE_REQUIRED=(10 "This install script need root privilege, please
ERR_NOT_SUPPORT_PLATFORM=(20 "Sorry, Hyper only support x86_64 platform!")
ERR_NOT_SUPPORT_DISTRO=(21 "Sorry, Hyper only support ubuntu/debian/fedora/centos/linuxmint(17.x) now!")
ERR_NOT_SUPPORT_DISTRO_VERSION=(22)
ERR_NOT_SUPPORT_VIRT_METHOD=(23 "Sorry, Hyper not support install in virtualbox!")
ERR_NO_HYPERVISOR=(39 "You should have either Xen 4.5+ or Qemu 2.0+ installed to run hyper")
ERR_QEMU_NOT_INSTALL=(40 "Please install Qemu 2.0+ first!")
ERR_QEMU_LOW_VERSION=(41 "Need Qemu version 2.0 at least!")
Expand Down Expand Up @@ -99,6 +101,7 @@ check_deps() {
show_message info "Check dependency "
check_deps_platform
check_deps_distro
check_deps_virt_method
check_deps_qemu || check_deps_xen || exit ${${ERR_NO_HYPERVISOR[0]}}
check_deps_initsystem
show_message done " Done"
Expand Down Expand Up @@ -181,6 +184,14 @@ check_deps_distro() {
esac
echo -n "."
}
check_deps_virt_method() {
VIRT_METHOD=$(dmidecode -s system-product-name)
if (echo "${UNSUPPORTED_VIRT_METHOD}" | grep -qw "${VIRT_METHOD}");then
show_message error "${ERR_NOT_SUPPORT_VIRT_METHOD[1]}"
exit ${ERR_NOT_SUPPORT_VIRT_METHOD[0]}
fi
echo -n "."
}
check_deps_xen() {
set +e
${BASH_C} "which xl" >/dev/null 2>&1
Expand Down