If you are not using GUI remove "use pointe for tablet" to save some CPU:

mapfile -t vm_ids < <(qm list | awk 'NR>1 {print $1}')
for vm in "${vm_ids[@]}"; do
    if qm set "$vm" --tablet 0; then
        echo "Successfully disabled tablet for VM ID: $vm"
    else
        echo "Failed to disable tablet for VM ID: $vm" >&2
    fi
done