Category: Proxmox

  • Unlocking a Proxmox Guest VM Using the qm Command: A Step-by-Step Guide

    If you’re unable to start, stop, or migrate a Proxmox guest VM because it’s showing as locked, you need to clear that lock using the qm command before you can act on the VM. This usually happens after an interrupted backup, snapshot, or migration leaves a stale lock in place. This article walks through how to unlock a Proxmox guest VM. Skip to the bottom for a TL;DR.

    Step 1: Access the Proxmox shell
    You’ll need shell access to the Proxmox host. Connect over SSH, or use the “Shell” option in the Proxmox web interface for the relevant node.

    Step 2: Identify the guest VM ID
    Run qm list to see all guest VMs on the host along with their IDs and current status.

    Step 3: Check the lock type (optional but recommended)
    Run qm config <VM ID> and look for a lock: line in the output. This tells you what kind of lock is in place (e.g. backup, snapshot, migrate, rollback), which is useful context if the lock keeps coming back — it usually means the underlying job (a backup, for example) is still stuck or failing.

    Step 4: Unlock the guest VM
    Run qm unlock <VM ID>. Note that a locked VM typically can’t be stopped or started normally in the first place — that’s the point of the lock — so this is usually your first real action, not something you do after stopping the VM.

    Step 5: Start or stop the VM as needed
    Once unlocked, you can manage the VM normally: qm start <VM ID> or qm stop <VM ID>.

    Unlocking a Proxmox guest VM with qm unlock is quick, but treat it as a fix for a stuck lock, not routine practice. If a VM keeps re-locking, check what job is putting the lock there (backups are the most common culprit) and address that directly rather than repeatedly clearing the symptom. Keep your login credentials secure, and keep regular backups of your VMs.

    TL;DR:

    To unlock a Proxmox guest VM:

    qm config        # optional: check lock type first
    qm unlock 
    qm start         # or: qm stop 

    Replace <VM ID> with the actual guest VM ID in each command. For LXC containers, use pct in place of qm (e.g. pct unlock <CT ID>) — the commands aren’t interchangeable between VMs and containers.

  • Remove a node from a Proxmox cluster

    Open a shell on one of the working nodes.

    #Get cluster status
    root@pve24:~#pvecm status

    If you don’t have a quorum then it may be necessary to change the number of expected votes. To do that issue the following command(s).

    root@pve24:~#pvecm expected 1

    Remove the node with:

    root@pve24:~#pvecm delnode pve25

    It may be necessary to restart corosync with:

    root@pve24:~#service corosync restart

    Reload the proxmox webgui if the node doesn’t go away and you are all set.