qm-create
Create new virtual machines (VMs)
TLDR
Create a virtual machine with access to 512MiB of memory and 1 CPU core
Give the virtual machine a name and automatically start the machine after creation
Give a virtual machine specified amount of memory and CPUs
Specify the type of operating system on the machine
Replace an existing machine (requires archiving it)
Specify a script that is executed automatically depending on the state of the virtual machine
Specify the install media
Create a VM that bridges itself to the host network
SYNOPSIS
qm create
PARAMETERS
The unique ID for the new virtual machine (100-999999999).
--name
Sets the VM's descriptive name.
--ostype
Specifies the guest operating system type (e.g., l26 for Linux, win10 for Windows).
--memory
Sets the amount of RAM in MiB allocated to the VM.
--cores
Defines the number of CPU cores.
--cpu
Selects the CPU type (e.g., host for host CPU features, kvm64).
--net
Configures a network device (e.g., virtio,bridge=vmbr0).
--scsi
Defines a SCSI disk device (e.g., storage:size=32G).
--ide
Defines an IDE disk device.
--sata
Defines a SATA disk device.
--virtio
Defines a VirtIO block device.
--bootdisk
Specifies which disk to boot from (e.g., scsi0, ide0).
--boot
Sets the boot order for devices (e.g., cdn for CD-ROM, Disk, Network).
--template
Marks this VM as a template, preventing it from being started directly.
--description
Adds a textual description or note for the VM.
--onboot
Determines if the VM should start automatically when the host boots (0=no, 1=yes).
--agent
Enables or disables the QEMU guest agent (0=disabled, 1=enabled).
--bios
Specifies the BIOS type (e.g., seabios, ovmf for UEFI).
--vga
Sets the virtual graphics adapter type (e.g., std, qxl).
--ciuser
Cloud-init: Sets the default username for cloud-init.
--sshkeys
Cloud-init: Provides SSH public keys for the default user.
DESCRIPTION
The qm-create command is a fundamental utility within the Proxmox Virtual Environment (PVE) for provisioning new KVM (Kernel-based Virtual Machine) instances from the command line. It enables administrators to define the essential configuration parameters for a VM, including its unique virtual ID (VMID), allocated memory, CPU resources, network interfaces, and storage devices. This command is crucial for setting up a VM's infrastructure before an operating system is installed or disk images are imported. It integrates seamlessly with Proxmox's diverse storage backends (such as LVM, ZFS, directory, or Ceph) and network configurations (like virtual bridges), allowing for flexible and powerful VM deployments. While qm-create sets up the VM's hardware configuration, it does not install an operating system; that typically follows via ISO installation or cloud-init. For a comprehensive list of all available options, users should consult the official Proxmox VE documentation or use qm create --help.
CAVEATS
Creating a VM only sets up its hardware configuration; it does not install an operating system.
Requires a unique VMID that is not already in use across the Proxmox cluster.
Disk and network configurations can be complex, necessitating specific syntax and existing storage/network resources.
Many advanced options exist, necessitating consultation of official documentation or qm create --help for full details.
VMID IMPORTANCE
The VMID is a mandatory, unique identifier for each virtual machine or container in Proxmox, ranging from 100 to 999,999,999. Choosing an appropriate and available VMID is the first step in creating a new VM, as it serves as the primary reference for all subsequent management operations.
DISK PROVISIONING VS. ATTACHMENT
When defining disks (e.g., with --scsi0), qm-create can automatically provision and format a new disk image on the specified storage backend with the given size and format. This is distinct from attaching a pre-existing disk image, which is typically done later using the qm set command.
CLOUD-INIT AUTOMATION
For guest operating systems supporting cloud-init, qm-create provides specific options like --ciuser, --cipassword, and --sshkeys. These allow for automated initial user setup, network configuration, and script execution upon the VM's first boot, significantly streamlining VM deployment for template-based scenarios.
HISTORY
qm-create has been a core component of the Proxmox Virtual Environment since its early versions, evolving to support modern virtualization features like UEFI, hotplugging, diverse storage technologies (e.g., ZFS, Ceph), and advanced CPU types. Its development mirrors the continuous enhancement of Proxmox VE as a robust, open-source hyper-converged platform, offering flexible and powerful command-line management capabilities for KVM guests and being integral to its growth.