To change CPU type to host, unmount CD ISO and enable start on boot:

mapfile -t vm_ids < <(qm list | awk 'NR>1 {print $1}')

# Changing CPU type to host and enabling start on boot for each VM
for vm in "${vm_ids[@]}"; do
    # Change CPU type to host
    if qm set "$vm" --cpu host; then
        echo "Successfully changed CPU type to host for VM ID: $vm"
    else
        echo "Failed to change CPU type to host for VM ID: $vm" >&2
    fi

    # Unmount CD ISO
    if qm set "$vm" -ide2 none; then
        echo "Successfully unmounted CD ISO for VM ID: $vm"
    else
        echo "Failed to unmount CD ISO for VM ID: $vm" >&2
    fi

    # Enable start on boot
    if qm set "$vm" --onboot 1; then
        echo "Successfully enabled start on boot for VM ID: $vm"
    else
        echo "Failed to enable start on boot for VM ID: $vm" >&2
    fi
done