qm - qemu/kvm virtual machine manager
qm <COMMAND> [ARGS] [OPTIONS]
qm config <vmid> Get virtual machine configuration. <vmid> integer (1 - N) The (unique) ID of the VM.
qm create <vmid> [OPTIONS] Create or restore a virtual machine. <vmid> integer (1 - N) The (unique) ID of the VM. -acpi boolean (default=1) Enable/disable ACPI. -archive string The backup file. -args string Note: this option is for experts only. It allows you to pass arbitrary arguments to kvm, for example: args: -no-reboot -no-hpet -autostart boolean (default=0) Automatic restart after crash (currently ignored). -balloon integer (16 - N) Amount of target RAM for the VM in MB. -boot [acdn]{1,4} (default=cdn) Boot on floppy (a), hard disk (c), CD-ROM (d), or network (n). -bootdisk (ide|scsi|virtio)\d+ Enable booting from specified disk. -cdrom volume This is an alias for option -ide2 -cores integer (1 - N) (default=1) The number of cores per socket. -cpu (486 | Conroe | Nehalem | Opteron_G1 | Opteron_G2 | Opteron_G3 | Penryn | Westmere | athlon | core2duo | coreduo | cpu64-rhel5 | cpu64-rhel6 | host | kvm32 | kvm64 | pentium | pentium2 | pentium3 | phenom | qemu32 | qemu64) (default=qemu64) Emulated CPU type. -cpulimit integer (0 - N) (default=0) Limit of CPU usage in per cent. Note if the computer has 2 CPUs, it has total of 200% CPU time. Value '0' indicates no CPU limit. NOTE: This option is currently ignored. -cpuunits integer (0 - 500000) (default=1000) CPU weight for a VM. Argument is used in the kernel fair scheduler. The larger the number is, the more CPU time this VM gets. Number is relative to weights of all the other running VMs. NOTE: You can disable fair-scheduler configuration by setting this to 0. -description string Description for the VM. Only used on the configuration web interface. This is saved as comment inside the configuration file. -force boolean Allow to overwrite existing VM. Requires option(s): archive -freeze boolean Freeze CPU at startup (use 'c' monitor command to start execution). -hostpci[n] HOSTPCIDEVICE Map host pci devices. HOSTPCIDEVICE syntax is: 'bus:dev.func' (hexadecimal numbers) You can us the 'lspci' command to list existing pci devices. Note: This option allows direct access to host hardware. So it is no longer possible to migrate such machines - use with special care. Experimental: user reported problems with this option. -hotplug boolean (default=0) Activate hotplug for disk and network device -ide[n] [volume=]volume,] [,media=cdrom|disk] [,cyls=c,heads=h,secs=s[,trans=t]] [,snapshot=on|off] [,cache=none|writethrough|writeback|unsafe] [,format=f] [,backup=yes|no] [,rerror=ignore|report|stop] [,werror=enospc|ignore|report|stop] [,aio=native|threads] Use volume as IDE hard disk or CD-ROM (n is 0 to 3). -keyboard (da | de | de-ch | en-gb | en-us | es | fi | fr | fr-be | fr-ca | fr-ch | hu | is | it | ja | lt | mk | nl | no | pl | pt | pt-br | sl | sv) (default=en-us) Keybord layout for vnc server. Default is read from the datacenter configuration file. -kvm boolean (default=1) Enable/disable KVM hardware virtualization. -localtime boolean Set the real time clock to local time. This is enabled by default if ostype indicates a Microsoft OS. -lock (backup | migrate) Lock/unlock the VM. -memory integer (16 - N) (default=512) Amount of RAM for the VM in MB. This is the maximum available memory when you use the balloon device. -migrate_downtime integer (0 - N) (default=1) Set maximum tolerated downtime (in seconds) for migrations. -migrate_speed integer (0 - N) (default=0) Set maximum speed (in MB/s) for migrations. Value 0 is no limit. -name string Set a name for the VM. Only used on the configuration web interface. -net[n] MODEL=XX:XX:XX:XX:XX:XX [,bridge=<dev>][,rate=<mbps>][,tag=<vlanid>] Specify network devices. MODEL is one of: e1000 i82551 i82557b i82559er ne2k_isa ne2k_pci pcnet rtl8139 virtio XX:XX:XX:XX:XX:XX should be an unique MAC address. This is automatically generated if not specified. The bridge parameter can be used to automatically add the interface to a bridge device. The Proxmox VE standard bridge is called 'vmbr0'. Option 'rate' is used to limit traffic bandwidth from and to this interface. It is specified as floating point number, unit is 'Megabytes per second'. If you specify no bridge, we create a kvm 'user' (NATed) network device, which provides DHCP and DNS services. The following addresses are used: 10.0.2.2 Gateway 10.0.2.3 DNS Server 10.0.2.4 SMB Server The DHCP server assign addresses to the guest starting from 10.0.2.15. -onboot boolean (default=0) Specifies whether a VM will be started during system bootup. -ostype (l24 | l26 | other | w2k | w2k3 | w2k8 | win7 | wvista | wxp) Used to enable special optimization/features for specific operating systems: other => unspecified OS wxp => Microsoft Windows XP w2k => Microsoft Windows 2000 w2k3 => Microsoft Windows 2003 w2k8 => Microsoft Windows 2008 wvista => Microsoft Windows Vista win7 => Microsoft Windows 7 l24 => Linux 2.4 Kernel l26 => Linux 2.6/3.X Kernel other|l24|l26 ... no special behaviour wxp|w2k|w2k3|w2k8|wvista|win7 ... use --localtime switch -parallel[n] /dev/parport\d+ Map host parallel devices (n is 0 to 2). Note: This option allows direct access to host hardware. So it is no longer possible to migrate such machines - use with special care. Experimental: user reported problems with this option. -pool string Add the VM to the specified pool. -reboot boolean (default=1) Allow reboot. If set to '0' the VM exit on reboot. -sata[n] [volume=]volume,] [,media=cdrom|disk] [,cyls=c,heads=h,secs=s[,trans=t]] [,snapshot=on|off] [,cache=none|writethrough|writeback|unsafe] [,format=f] [,backup=yes|no] [,rerror=ignore|report|stop] [,werror=enospc|ignore|report|stop] [,aio=native|threads] Use volume as SATA hard disk or CD-ROM (n is 0 to 5). -scsi[n] [volume=]volume,] [,media=cdrom|disk] [,cyls=c,heads=h,secs=s[,trans=t]] [,snapshot=on|off] [,cache=none|writethrough|writeback|unsafe] [,format=f] [,backup=yes|no] [,rerror=ignore|report|stop] [,werror=enospc|ignore|report|stop] [,aio=native|threads] Use volume as SCSI hard disk or CD-ROM (n is 0 to 13). -serial[n] /dev/ttyS\d+ Map host serial devices (n is 0 to 3). Note: This option allows direct access to host hardware. So it is no longer possible to migrate such machines - use with special care. Experimental: user reported problems with this option. -smp integer (1 - N) (default=1) The number of CPUs. Please use option -sockets instead. -sockets integer (1 - N) (default=1) The number of CPU sockets. -startdate (now | YYYY-MM-DD | YYYY-MM-DDTHH:MM:SS) (default=now) Set the initial date of the real time clock. Valid format for date are: 'now' or '2006-06-17T16:01:21' or '2006-06-17'. -storage string Default storage. -tablet boolean (default=1) Enable/disable the usb tablet device. This device is usually needed to allow absolute mouse positioning. Else the mouse runs out of sync with normal vnc clients. If you're running lots of console-only guests on one host, you may consider disabling this to save some context switches. -tdf boolean (default=1) Enable/disable time drift fix. This is ignored for kvm versions newer that 1.0 (not needed anymore). -unique boolean Assign a unique random ethernet address. Requires option(s): archive -unused[n] string Reference to unused volumes. -usb[n] host=HOSTUSBDEVICE Configure an USB device (n is 0 to 4). This can be used to pass-through usb devices to the guest. HOSTUSBDEVICE syntax is: 'bus-port(.port)*' (decimal numbers) or 'vendor_id:product_id' (hexadeciaml numbers) You can use the 'lsusb -t' command to list existing usb devices. Note: This option allows direct access to host hardware. So it is no longer possible to migrate such machines - use with special care. -vga (cirrus | std | vmware) Select VGA type. If you want to use high resolution modes (>= 1280x1024x16) then you should use option 'std' or 'vmware'. Default is 'std' for win7/w2k8, and 'cirrur' for other OS types -virtio[n] [volume=]volume,] [,media=cdrom|disk] [,cyls=c,heads=h,secs=s[,trans=t]] [,snapshot=on|off] [,cache=none|writethrough|writeback|unsafe] [,format=f] [,backup=yes|no] [,rerror=ignore|report|stop] [,werror=enospc|ignore|report|stop] [,aio=native|threads] Use volume as VIRTIO hard disk (n is 0 to 5). -watchdog [[model=]i6300esb|ib700] [,[action=]reset|shutdown|poweroff|pause|debug|none] Create a virtual hardware watchdog device. Once enabled (by a guest action), the watchdog must be periodically polled by an agent inside the guest or else the guest will be restarted (or execute the action specified)
qm destroy <vmid> [OPTIONS] Destroy the vm (also delete all used/owned volumes). <vmid> integer (1 - N) The (unique) ID of the VM. -skiplock boolean Ignore locks - only root is allowed to use this option.
qm list Virtual machine index (per node).
qm migrate <vmid> <target> [OPTIONS] Migrate virtual machine. Creates a new migration task. <vmid> integer (1 - N) The (unique) ID of the VM. <target> string Target node. -force boolean Allow to migrate VMs which use local devices. Only root may use this option. -online boolean Use online/live migration.
qm reset <vmid> [OPTIONS] Reset virtual machine. <vmid> integer (1 - N) The (unique) ID of the VM. -skiplock boolean Ignore locks - only root is allowed to use this option.
qm resume <vmid> [OPTIONS] Resume virtual machine. <vmid> integer (1 - N) The (unique) ID of the VM. -skiplock boolean Ignore locks - only root is allowed to use this option.
qm sendkey <vmid> <key> [OPTIONS] Send key event to virtual machine. <vmid> integer (1 - N) The (unique) ID of the VM. <key> string The key (qemu monitor encoding). -skiplock boolean Ignore locks - only root is allowed to use this option.
qm set <vmid> [OPTIONS] Set virtual machine options. <vmid> integer (1 - N) The (unique) ID of the VM. -acpi boolean (default=1) Enable/disable ACPI. -args string Note: this option is for experts only. It allows you to pass arbitrary arguments to kvm, for example: args: -no-reboot -no-hpet -autostart boolean (default=0) Automatic restart after crash (currently ignored). -balloon integer (16 - N) Amount of target RAM for the VM in MB. -boot [acdn]{1,4} (default=cdn) Boot on floppy (a), hard disk (c), CD-ROM (d), or network (n). -bootdisk (ide|scsi|virtio)\d+ Enable booting from specified disk. -cdrom volume This is an alias for option -ide2 -cores integer (1 - N) (default=1) The number of cores per socket. -cpu (486 | Conroe | Nehalem | Opteron_G1 | Opteron_G2 | Opteron_G3 | Penryn | Westmere | athlon | core2duo | coreduo | cpu64-rhel5 | cpu64-rhel6 | host | kvm32 | kvm64 | pentium | pentium2 | pentium3 | phenom | qemu32 | qemu64) (default=qemu64) Emulated CPU type. -cpulimit integer (0 - N) (default=0) Limit of CPU usage in per cent. Note if the computer has 2 CPUs, it has total of 200% CPU time. Value '0' indicates no CPU limit. NOTE: This option is currently ignored. -cpuunits integer (0 - 500000) (default=1000) CPU weight for a VM. Argument is used in the kernel fair scheduler. The larger the number is, the more CPU time this VM gets. Number is relative to weights of all the other running VMs. NOTE: You can disable fair-scheduler configuration by setting this to 0. -delete string A list of settings you want to delete. -description string Description for the VM. Only used on the configuration web interface. This is saved as comment inside the configuration file. -digest string Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. -force boolean Force physical removal. Without this, we simple remove the disk from the config file and create an additional configuration entry called 'unused[n]', which contains the volume ID. Unlink of unused[n] always cause physical removal. Requires option(s): delete -freeze boolean Freeze CPU at startup (use 'c' monitor command to start execution). -hostpci[n] HOSTPCIDEVICE Map host pci devices. HOSTPCIDEVICE syntax is: 'bus:dev.func' (hexadecimal numbers) You can us the 'lspci' command to list existing pci devices. Note: This option allows direct access to host hardware. So it is no longer possible to migrate such machines - use with special care. Experimental: user reported problems with this option. -hotplug boolean (default=0) Activate hotplug for disk and network device -ide[n] [volume=]volume,] [,media=cdrom|disk] [,cyls=c,heads=h,secs=s[,trans=t]] [,snapshot=on|off] [,cache=none|writethrough|writeback|unsafe] [,format=f] [,backup=yes|no] [,rerror=ignore|report|stop] [,werror=enospc|ignore|report|stop] [,aio=native|threads] Use volume as IDE hard disk or CD-ROM (n is 0 to 3). -keyboard (da | de | de-ch | en-gb | en-us | es | fi | fr | fr-be | fr-ca | fr-ch | hu | is | it | ja | lt | mk | nl | no | pl | pt | pt-br | sl | sv) (default=en-us) Keybord layout for vnc server. Default is read from the datacenter configuration file. -kvm boolean (default=1) Enable/disable KVM hardware virtualization. -localtime boolean Set the real time clock to local time. This is enabled by default if ostype indicates a Microsoft OS. -lock (backup | migrate) Lock/unlock the VM. -memory integer (16 - N) (default=512) Amount of RAM for the VM in MB. This is the maximum available memory when you use the balloon device. -migrate_downtime integer (0 - N) (default=1) Set maximum tolerated downtime (in seconds) for migrations. -migrate_speed integer (0 - N) (default=0) Set maximum speed (in MB/s) for migrations. Value 0 is no limit. -name string Set a name for the VM. Only used on the configuration web interface. -net[n] MODEL=XX:XX:XX:XX:XX:XX [,bridge=<dev>][,rate=<mbps>][,tag=<vlanid>] Specify network devices. MODEL is one of: e1000 i82551 i82557b i82559er ne2k_isa ne2k_pci pcnet rtl8139 virtio XX:XX:XX:XX:XX:XX should be an unique MAC address. This is automatically generated if not specified. The bridge parameter can be used to automatically add the interface to a bridge device. The Proxmox VE standard bridge is called 'vmbr0'. Option 'rate' is used to limit traffic bandwidth from and to this interface. It is specified as floating point number, unit is 'Megabytes per second'. If you specify no bridge, we create a kvm 'user' (NATed) network device, which provides DHCP and DNS services. The following addresses are used: 10.0.2.2 Gateway 10.0.2.3 DNS Server 10.0.2.4 SMB Server The DHCP server assign addresses to the guest starting from 10.0.2.15. -onboot boolean (default=0) Specifies whether a VM will be started during system bootup. -ostype (l24 | l26 | other | w2k | w2k3 | w2k8 | win7 | wvista | wxp) Used to enable special optimization/features for specific operating systems: other => unspecified OS wxp => Microsoft Windows XP w2k => Microsoft Windows 2000 w2k3 => Microsoft Windows 2003 w2k8 => Microsoft Windows 2008 wvista => Microsoft Windows Vista win7 => Microsoft Windows 7 l24 => Linux 2.4 Kernel l26 => Linux 2.6/3.X Kernel other|l24|l26 ... no special behaviour wxp|w2k|w2k3|w2k8|wvista|win7 ... use --localtime switch -parallel[n] /dev/parport\d+ Map host parallel devices (n is 0 to 2). Note: This option allows direct access to host hardware. So it is no longer possible to migrate such machines - use with special care. Experimental: user reported problems with this option. -reboot boolean (default=1) Allow reboot. If set to '0' the VM exit on reboot. -sata[n] [volume=]volume,] [,media=cdrom|disk] [,cyls=c,heads=h,secs=s[,trans=t]] [,snapshot=on|off] [,cache=none|writethrough|writeback|unsafe] [,format=f] [,backup=yes|no] [,rerror=ignore|report|stop] [,werror=enospc|ignore|report|stop] [,aio=native|threads] Use volume as SATA hard disk or CD-ROM (n is 0 to 5). -scsi[n] [volume=]volume,] [,media=cdrom|disk] [,cyls=c,heads=h,secs=s[,trans=t]] [,snapshot=on|off] [,cache=none|writethrough|writeback|unsafe] [,format=f] [,backup=yes|no] [,rerror=ignore|report|stop] [,werror=enospc|ignore|report|stop] [,aio=native|threads] Use volume as SCSI hard disk or CD-ROM (n is 0 to 13). -serial[n] /dev/ttyS\d+ Map host serial devices (n is 0 to 3). Note: This option allows direct access to host hardware. So it is no longer possible to migrate such machines - use with special care. Experimental: user reported problems with this option. -skiplock boolean Ignore locks - only root is allowed to use this option. -smp integer (1 - N) (default=1) The number of CPUs. Please use option -sockets instead. -sockets integer (1 - N) (default=1) The number of CPU sockets. -startdate (now | YYYY-MM-DD | YYYY-MM-DDTHH:MM:SS) (default=now) Set the initial date of the real time clock. Valid format for date are: 'now' or '2006-06-17T16:01:21' or '2006-06-17'. -tablet boolean (default=1) Enable/disable the usb tablet device. This device is usually needed to allow absolute mouse positioning. Else the mouse runs out of sync with normal vnc clients. If you're running lots of console-only guests on one host, you may consider disabling this to save some context switches. -tdf boolean (default=1) Enable/disable time drift fix. This is ignored for kvm versions newer that 1.0 (not needed anymore). -unused[n] string Reference to unused volumes. -usb[n] host=HOSTUSBDEVICE Configure an USB device (n is 0 to 4). This can be used to pass-through usb devices to the guest. HOSTUSBDEVICE syntax is: 'bus-port(.port)*' (decimal numbers) or 'vendor_id:product_id' (hexadeciaml numbers) You can use the 'lsusb -t' command to list existing usb devices. Note: This option allows direct access to host hardware. So it is no longer possible to migrate such machines - use with special care. -vga (cirrus | std | vmware) Select VGA type. If you want to use high resolution modes (>= 1280x1024x16) then you should use option 'std' or 'vmware'. Default is 'std' for win7/w2k8, and 'cirrur' for other OS types -virtio[n] [volume=]volume,] [,media=cdrom|disk] [,cyls=c,heads=h,secs=s[,trans=t]] [,snapshot=on|off] [,cache=none|writethrough|writeback|unsafe] [,format=f] [,backup=yes|no] [,rerror=ignore|report|stop] [,werror=enospc|ignore|report|stop] [,aio=native|threads] Use volume as VIRTIO hard disk (n is 0 to 5). -watchdog [[model=]i6300esb|ib700] [,[action=]reset|shutdown|poweroff|pause|debug|none] Create a virtual hardware watchdog device. Once enabled (by a guest action), the watchdog must be periodically polled by an agent inside the guest or else the guest will be restarted (or execute the action specified)
qm shutdown <vmid> [OPTIONS] Shutdown virtual machine. <vmid> integer (1 - N) The (unique) ID of the VM. -forceStop boolean (default=0) Make sure the VM stops. -keepActive boolean (default=0) Do not decativate storage volumes. -skiplock boolean Ignore locks - only root is allowed to use this option. -timeout integer (0 - N) Wait maximal timeout seconds.
qm start <vmid> [OPTIONS] Start virtual machine. <vmid> integer (1 - N) The (unique) ID of the VM. -skiplock boolean Ignore locks - only root is allowed to use this option. -stateuri string Some command save/restore state from this location.
qm stop <vmid> [OPTIONS] Stop virtual machine. <vmid> integer (1 - N) The (unique) ID of the VM. -keepActive boolean (default=0) Do not decativate storage volumes. -skiplock boolean Ignore locks - only root is allowed to use this option. -timeout integer (0 - N) Wait maximal timeout seconds.
qm suspend <vmid> [OPTIONS] Suspend virtual machine. <vmid> integer (1 - N) The (unique) ID of the VM. -skiplock boolean Ignore locks - only root is allowed to use this option.
qm unlink <vmid> {<idlist>} [OPTIONS] Unlink/delete disk images. <vmid> integer (1 - N) The (unique) ID of the VM. <idlist> string A list of disk IDs you want to delete. -force boolean Force physical removal. Without this, we simple remove the disk from the config file and create an additional configuration entry called 'unused[n]', which contains the volume ID. Unlink of unused[n] always cause physical removal.
qm help [<cmd>] [OPTIONS] Get help about specified command. <cmd> string Command name -verbose boolean Verbose output format.
qm monitor <vmid> Enter Qemu Monitor interface. <vmid> integer (1 - N) The (unique) ID of the VM.
qm mtunnel Used by qmigrate - do not use manually.
qm showcmd <vmid> Show command line which is used to start the VM (debug info). <vmid> integer (1 - N) The (unique) ID of the VM.
qm startall Start all virtual machines (when onboot=1).
qm status <vmid> [OPTIONS] Show VM status. <vmid> integer (1 - N) The (unique) ID of the VM. -verbose boolean Verbose output format
qm stopall [OPTIONS] Stop all virtual machines. -timeout integer (1 - N) Timeout in seconds. Default is to wait 3 minutes.
qm unlock <vmid> Unlock the VM. <vmid> integer (1 - N) The (unique) ID of the VM.
qm vncproxy <vmid> Proxy VM VNC traffic to stdin/stdout <vmid> integer (1 - N) The (unique) ID of the VM.
qm wait <vmid> [OPTIONS] Wait until the VM is stopped. <vmid> integer (1 - N) The (unique) ID of the VM. -timeout integer (1 - N) Timeout in seconds. Default is to wait forever.
qm is a script to manage virtual machines with qemu/kvm. You can create and destroy virtual machines, and control execution (start/stop/suspend/resume). Besides that, you can use qm to set parameters in the associated config file. It is also possible to create and delete virtual disks.
All configuration files consists of lines in the form
PARAMETER: value
See vm.conf for a complete list of options.
Configuration files are stored inside the Proxmox configuration file system, and can be access at /etc/pve/qemu-server/VMID
.conf.
The default for option 'keyboard' is read from /etc/pve/datacenter.conf.
Online migration and backups (vzdump) set a lock to prevent unintentional action on such VMs. Sometimes you need remove such lock manually (power failure).
qm unlock <vmid>
# create a new VM with 4 GB ide disk qm create 300 -ide0 4 -net0 e1000 -cdrom proxmox-mailgateway_2.1.iso
# start the new VM qm start 300
# send shutdown, then wait until VM is stopped qm shutdown 300 && qm wait 300
# same as above, but only wait for 40 seconds qm shutdown 300 && qm wait 300 -timeout 40
Copyright (C) 2007-2011 Proxmox Server Solutions GmbH
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.