quickemu-project / quickemu

Quickly create and run optimised Windows, macOS and Linux virtual machines
MIT License
10.56k stars 460 forks source link

bug: RAM allocation for macOS and Windows VMs can prevent VMs from booting #1191

Closed bennydente closed 4 months ago

bennydente commented 4 months ago

Expected behavior

running "./quickemu --vm windows-10.conf --display spice" should run windows VM

Actual behavior

running "./quickemu --vm windows-10.conf --display spice" show error:

Quickemu 4.9.4 using /usr/bin/qemu-system-x86_64 v8.2.2

Steps to reproduce the behavior

./quickemu --vm windows-10.conf --display spice

Additional context

I thing in this code:

if [ "${guest_os}" == "macos" ] || [ "${guest_os}" == "windows" ] || [ "${guest_os}" == "windows-server" ]; then
    if [ "${RAM_VM//G/}" -lt 8 ]; then
        echo "ERROR! You have insufficient RAM to run ${guest_os} in a VM"
        exit 1
    fi
fi

RAM_VM should be RAM_HOST

System Information


    Quickemu 4.9.4

Distro: Fedora Linux 40 (Workstation Edition) Kernel: Linux 6.8.8-300.fc40.x86_64 x86_64 Memory: 16G GPU:

flexiondotorg commented 4 months ago

Workaround You can workaround this issue by modifying the VM configuration and adding ram="8G"

The logic you quoted is correct, but the error message is not clear. The intent here is to stop Windows and macOS VMs from running when there is not adequate RAM allocated to them.

Based on the RAM in your host computer, the VM RAM allocation calculated by quickemu will not be sufficient.

I'll have a think about the best way to allocate guest VM RAM to macOS and Windows also how to present this error/warning.

lj3954 commented 4 months ago

Workaround You can workaround this issue by modifying the VM configuration and adding ram="8G"

The logic you quoted is correct, but the error message is not clear. The intent here is to stop Windows and macOS VMs from running when there is not adequate RAM allocated to them.

Based on the RAM in your host computer, the VM RAM allocation calculated by quickemu will not be sufficient.

I'll have a think about the best way to allocate guest VM RAM to macOS and Windows also how to present this error/warning.

The VMs will boot with less than 8GB of RAM, correct? Windows has a 4GB requirement if I'm not mistaken. It should probably present a warning (i.e. "It is highly recommended to allocate at least 8GB of RAM to ${guest_os} VMs") rather than exiting with an error.

bennydente commented 4 months ago

Hi, thanks. In my experiences Windows 10 VM run fine on 4GB of RAM, but now i have configure 8GB of RAM on VM that not really need.

flexiondotorg commented 4 months ago

I bumped the RAM requirement for macOS. I'll modify the conditional so the allocation for macOS and Windows is different.

flexiondotorg commented 4 months ago

Here is my proposed fix @bennydente.

Feedback welcome :+1: