qm-showcmd
Show the command Proxmox uses for actions
TLDR
Show command-line for a specific virtual machine
Put each option on a new line to enhance human readability
Fetch configuration values from a specific snapshot
SYNOPSIS
qm-showcmd <vmid> [OPTIONS]
PARAMETERS
<vmid>
The unique numeric identifier (ID) of the virtual machine or container whose launch command you wish to display. This is a mandatory argument.
--pretty
Formats the output command with line breaks and indentation, making it more readable and easier to analyze. Without this option, the command is printed as a single, long line.
--with-defaults
Includes all default parameters that Proxmox implicitly adds to the command line, even if they are not explicitly configured for the VM/CT. This provides a complete picture of all QEMU/LXC arguments.
--with-vmid
Prepends the VMID to the output command line, which can be useful when processing the output for multiple VMs programmatically.
DESCRIPTION
The qm-showcmd utility is a diagnostic tool within the Proxmox Virtual Environment (PVE) ecosystem. Its primary function is to reveal the exact command-line arguments that Proxmox VE uses internally to launch a specified virtual machine (VM) or container (CT) using QEMU/KVM or LXC.
When Proxmox starts a VM, it generates a complex qemu-system-x86_64 command with numerous parameters defining hardware, network, storage, and other configurations. Similarly, for containers, it generates the corresponding LXC command. qm-showcmd allows administrators and users to inspect this command.
This command is invaluable for debugging, understanding how Proxmox translates its configuration files into QEMU/LXC parameters, or for replicating a VM's environment outside of Proxmox for advanced troubleshooting or custom setups. It does not execute the command; it merely displays it.
CAVEATS
The output of qm-showcmd is for informational and diagnostic purposes only. It displays the command that *would be* executed, but does not actually run or validate it. Attempting to run the displayed command manually outside of Proxmox may require elevated privileges and a carefully prepared environment. The command line can be extremely long and complex, especially for VMs with many devices or custom configurations.
OUTPUT STRUCTURE
The typical output of qm-showcmd for a VM will be a full qemu-system-x86_64 command followed by numerous -device, -nic, -drive, -cpu, and other options. For a container, it will show an lxc-start or similar LXC command with its relevant parameters. Using the --pretty option significantly improves readability by breaking down the command into multiple lines, with each major argument on its own line.
HISTORY
qm-showcmd has been a part of the Proxmox Virtual Environment (PVE) suite since its relatively early versions. It was introduced to address the need for administrators to understand the complex QEMU command lines generated by PVE's abstracted configuration. As Proxmox VE evolved to manage increasingly sophisticated virtual machine and container setups, the complexity of the underlying QEMU/LXC commands grew. qm-showcmd became an essential debugging and transparency tool, helping users diagnose issues related to specific QEMU parameters, verify configurations, and gain deeper insight into PVE's internal workings. Its continuous presence underscores its utility for Proxmox administrators and developers.
SEE ALSO
qm(1), pct(1), qemu-system-x86_64(1), lxc(1)