fix: correct VM RAM allocation check for Windows and macOS. close #1191

This commit is contained in:
Martin Wimpress 2024-05-10 09:54:56 +01:00 committed by Martin Wimpress
parent 4dab035d46
commit f51697593a

View File

@ -330,9 +330,16 @@ function vm_boot() {
fi
echo ", ${RAM_VM} RAM"
if [ "${guest_os}" == "macos" ] || [ "${guest_os}" == "windows" ] || [ "${guest_os}" == "windows-server" ]; then
if [ "${guest_os}" == "windows" ] || [ "${guest_os}" == "windows-server" ]; then
if [ "${RAM_VM//G/}" -lt 4 ]; then
echo "ERROR! The guest virtual machine has been allocated insufficient RAM to run Windows."
echo " You can override the guest RAM allocation by adding 'ram=4G' to ${VM}"
exit 1
fi
elif [ "${guest_os}" == "macos" ]; then
if [ "${RAM_VM//G/}" -lt 8 ]; then
echo "ERROR! You have insufficient RAM to run ${guest_os} in a VM"
echo "ERROR! The guest virtual machine has been allocated insufficient RAM to run macOS."
echo " You can override the guest RAM allocation by adding 'ram=8G' to ${VM}"
exit 1
fi
fi