Send a shutdown request, then wait until the virtual machine is stopped with a 10 second timeout

qm wait

qm shutdown {{vm_id}} && qm wait --timeout {{10}} {{vm_id}}

click the source code to copy