diff --git a/lib/vm-base b/lib/vm-base index 0f36927b..7b6b0207 100644 --- a/lib/vm-base +++ b/lib/vm-base @@ -24,8 +24,8 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -VERSION=1.4.1 -VERSION_INT=104001 +VERSION=1.4.2 +VERSION_INT=104002 VERSION_BSD=$(uname -K) PATH=${PATH}:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin diff --git a/lib/vm-core b/lib/vm-core index 738d5205..02d57c9e 100644 --- a/lib/vm-core +++ b/lib/vm-core @@ -592,7 +592,7 @@ core::__start(){ config::get "_uefi" "uefi" # check minimum configuration - if [ -z "${_cpu}" -o -z "${_memory}" -o -z "${_disk}" ]; then + if [ -z "${_cpu}" -o -z "${_memory}" ]; then echo " ! incomplete virtual machine configuration" return 1 fi diff --git a/lib/vm-guest b/lib/vm-guest index 446f3142..48782be6 100644 --- a/lib/vm-guest +++ b/lib/vm-guest @@ -51,6 +51,12 @@ guest::load(){ local _iso="$1" local _args _command _timeout _grub_opt _bsd_loader + # require a boot disk + if [ -z "${_bootdisk}" ]; then + util::log "guest" "${_name}" "fatal; non-uefi loaders require a boot disk device" + return 15 + fi + # all loaders have same console and wired memory options [ -z "${VM_OPT_FOREGROUND}" ] && _args="-c ${_com}" [ "${_wiredmem}" = "1" ] && _args="${_args}${_args:+ }-S" diff --git a/lib/vm-run b/lib/vm-run index f9240dea..54994a32 100644 --- a/lib/vm-run +++ b/lib/vm-run @@ -101,7 +101,7 @@ vm::run(){ " [primary disk dev: ${_bootdisk_dev}]" # check basic settings - if [ -z "${_loader}" -o -z "${_cpu}" -o -z "${_memory}" -o -z "${_bootdisk}" ]; then + if [ -z "${_loader}" -o -z "${_cpu}" -o -z "${_memory}" ]; then util::log "guest" "${_name}" "fatal; unable to start - missing required configuration" exit 15 fi @@ -192,7 +192,7 @@ vm::run(){ util::checkyesno "${_debug}" && _logpath="${VM_DS_PATH}/${_name}/bhyve.log" # complete the boot disk path - vm::get_disk_path "_bootdisk" "${_name}" "${_bootdisk}" "${_bootdisk_dev}" + [ -n "${_bootdisk}" ] && vm::get_disk_path "_bootdisk" "${_name}" "${_bootdisk}" "${_bootdisk_dev}" # build bhyve device string vm::bhyve_device_comports