How to use the command qm start (with examples)
The command qm start
is used to start a virtual machine on QEMU/KVM Virtual Machine Manager. It allows you to specify the virtual machine ID, QEMU machine type, and a timeout period.
Use case 1: Start a specific virtual machine
Code:
qm start 100
Motivation: This use case is useful when you want to start a specific virtual machine by its ID (e.g., 100).
Explanation: The command qm start
is followed by the virtual machine ID (100 in this case). This tells the QEMU/KVM Virtual Machine Manager to start the virtual machine with the specified ID.
Example output: The virtual machine with ID 100 will start, and you will see its console output or user interface, depending on the configuration.
Use case 2: Specify the QEMU machine type
Code:
qm start 100 --machine q35
Motivation: This use case is helpful when you want to specify the QEMU machine type, which determines the CPU to emulate for the virtual machine.
Explanation: After the virtual machine ID (100), the --machine
option is used to specify the QEMU machine type. In this case, we set it to q35
. The q35
machine type emulates a modern x86_64 server-class machine.
Example output: The virtual machine with ID 100 will start, emulating the Q35 machine type. The output will depend on the virtual machine’s operating system and configuration.
Use case 3: Start a specific virtual machine with a timeout
Code:
qm start 100 --timeout 60
Motivation: This use case is handy when you want to set a timeout period for starting a specific virtual machine. It allows you to control the maximum time the command should wait for the virtual machine to start.
Explanation: In addition to the virtual machine ID (100), the --timeout
option is used to specify the timeout period in seconds. In this case, we set it to 60 seconds.
Example output: The virtual machine with ID 100 will start, and the command will wait for a maximum of 60 seconds for the virtual machine to start. If it doesn’t start within the specified timeout period, an appropriate message will be displayed.
Conclusion:
The qm start
command is a useful tool for starting virtual machines on QEMU/KVM Virtual Machine Manager. By specifying the virtual machine ID, QEMU machine type, and timeout period, you can have more control over the virtual machine start process.