• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

qm Command Examples in Linux

by Deepika

qm is a command-line tool provided by the QEMU/KVM Virtual Machine Manager for managing virtual machines on Linux systems. QEMU (Quick Emulator) is a free and open-source emulator that can run virtual machines for various architectures and devices, while KVM (Kernel-based Virtual Machine) is a Linux kernel module that provides virtualization support for QEMU.

With qm, users can create, delete, start, stop, and manage virtual machines running on QEMU/KVM. The qm command provides a variety of options and subcommands for managing virtual machines, such as create, start, stop, destroy, snapshot, migrate, and wait.

Other commonly used qm commands include:

  • qm start [vmid]: Start a virtual machine with the specified ID.
  • qm stop [vmid]: Stop a virtual machine with the specified ID.
  • qm destroy [vmid]: Permanently remove a virtual machine with the specified ID.
  • qm snapshot [vmid] [name]: Create a snapshot of a virtual machine with the specified ID and give it the specified name.
  • qm migrate [vmid] [target]: Migrate a virtual machine with the specified ID to another host or storage location.

The QEMU/KVM Virtual Machine Manager provides a powerful and flexible platform for managing virtual machines on Linux systems. More information about the qm command and other features of the QEMU/KVM Virtual Machine Manager can be found in the project’s documentation at https://pve.proxmox.com/pve-docs/qm.1.html.

qm Command Examples

1. List all virtual machines:

# qm list

2. Using an ISO file uploaded on the local storage, create a virtual machine with a 4 GB IDE disk on the local-lvm storage and an ID of 100:

# qm create {{100}} -ide0 {{local-lvm:4}} -net0 {{e1000}} -cdrom {{local:iso/proxmox-mailgateway_2.1.iso}}

3. Show the configuration of a virtual machine, specifying its ID:

# qm config {{100}}

4. Start a specific virtual machine:

# qm start {{100}}

5. Send a shutdown request, then wait until the virtual machine is stopped:

# qm shutdown {{100}} && qm wait {{100}}

6. Destroy a virtual machine and remove all related resources:

# qm destroy {{100}} --purge

Filed Under: Linux

Some more articles you might also be interested in …

  1. Connection using SSH to a Host Not in DNS/hosts Stalls for Some Time at Connection Initiation
  2. pacman –files Command Examples
  3. How to uninstall steam from Ubuntu
  4. aptitude Command Examples in Linux
  5. ulimit: command not found
  6. CentOS / RHEL 7 : How to enable or disable automatic updates (via packagekit)
  7. rkhunter: command not found
  8. Where to find ASMLib / oracleasm RPMs for CentOS/RHEL, SUSE, OEL
  9. How to Disable IPv6 in CentOS/RHEL 8
  10. loginctl Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • diffstat: Create a histogram from the output of the diff command
  • diffoscope: Compare files, archives, and directories
  • diff-pdf: Tool for comparing two PDFs
  • dict: Command line dictionary using the DICT protocol

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright