LinuxCommandLibrary

qm-reboot

Reboots a QEMU virtual machine

TLDR

Reboot a virtual machine

$ qm reboot [vm_id]
copy

Reboot a virtual machine after wait for at most 10 seconds
$ qm reboot --timeout [10] [vm_id]
copy

SYNOPSIS

qm reboot [OPTIONS]

PARAMETERS


    The unique numerical identifier of the virtual machine to be rebooted.

--skiplock
    Skip locks - only use if you know what you are doing.

--timeout
    Time to wait for the guest OS to shut down, in seconds (defaults to 300).

--debug
    Enables debug output.

DESCRIPTION

The `qm-reboot` command gracefully reboots a virtual machine managed by Proxmox Virtual Environment (Proxmox VE). This command attempts a clean shutdown of the guest operating system within the VM, initiating the reboot process from within the guest itself. This is preferred over a hard reset (`qm-reset`), as it allows the guest OS to properly save data and shut down services, preventing potential data loss or corruption.

The command communicates with the qemu process controlling the vm and asks it to trigger a reset. It does not directly interact with the guest's hardware emulation, instead relying on the virtualized bios to intiate the reset.

The command is crucial for maintaining the integrity and stability of the guest operating systems. If the guest operating system doesn't respond to the command after a specific amount of time, the command will timeout and abort.

This command must be executed on a Proxmox VE host and is not intended for use within the guest operating system itself.

EXIT STATUS

The `qm-reboot` command returns an exit status of 0 on success, and a non-zero exit status on failure. Failures can occur if the specified VMID does not exist, if there is a communication problem with the VM, or if the guest OS fails to shut down within the configured timeout.

IDEMPOTENCY

Running `qm-reboot` multiple times in quick succession will generally have the same effect as running it once. If the VM is already rebooting or shut down, subsequent calls will have no immediate effect, but could cause timeouts if the VM takes a very long time to start the rebooting process.

SEE ALSO

qm(1), qm-shutdown(1), qm-stop(1), qm-reset(1)

Copied to clipboard