LinuxCommandLibrary

qm-stop

Stop a virtual machine or container

TLDR

Stop a virtual machine immediately

$ qm stop [VM_ID]
copy

Stop a virtual machine and wait for at most 10 seconds
$ qm stop --timeout [10] [VM_ID]
copy

Stop a virtual machine and skip lock (only root can use this option)
$ qm stop --skiplock [true] [VM_ID]
copy

Stop a virtual machine and don't deactivate storage volumes
$ qm stop --keepActive [true] [VM_ID]
copy

SYNOPSIS

qm stop [OPTIONS]

PARAMETERS


    Required. The unique numeric ID of the virtual machine to stop.

--skiplock
    Skip locks - only relevant if ha is disabled. Use with caution.

--timeout
    Wait for the VM to shutdown for the specified number of seconds. Defaults to 60 seconds.

--debug
    Enable debug mode.

DESCRIPTION

The `qm-stop` command is a Proxmox Virtual Environment (PVE) command-line utility used to gracefully shut down a QEMU-managed virtual machine (VM). It sends an ACPI shutdown signal to the guest OS, allowing it to perform a clean shutdown procedure. This is the preferred method for stopping a VM as it minimizes the risk of data corruption.
By default, `qm-stop` will wait for the VM to shut down completely before returning control to the user. You can use the `--skiplock` parameter, but this is *not* recommended in most scenarios. The `qm-stop` command can be used with or without a configuration lock. It ensures that the VM stops gracefully and the command is available with or without a lock for immediate operation to avoid inconsistencies.
Note that `qm-stop` requires the VM ID as an argument. This ID is a unique integer assigned to each VM within the Proxmox environment.

RETURN CODES

Returns 0 on success, and non-zero on errors.

SEE ALSO

Copied to clipboard