2025-03-14 21:59:59 -06:00
|
|
|
# qm create
|
|
|
|
|
|
|
|
|
|
> Create or restore a virtual machine on QEMU/KVM Virtual Machine Manager.
|
2025-12-16 10:20:31 -07:00
|
|
|
> More information: <https://pve.proxmox.com/pve-docs/qm.1.html#cli_qm_create>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-09-14 18:48:49 -06:00
|
|
|
- Create a virtual machine with access to 512MiB of memory and 1 CPU core:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-09-14 18:48:49 -06:00
|
|
|
`qm {{[cr|create]}} {{100}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Give the virtual machine a name and automatically start the machine after creation:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`qm {{[cr|create]}} {{100}} --name {{vm_name}} --start`
|
2025-09-14 18:48:49 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Give a virtual machine specified amount of memory and CPUs:
|
2025-09-14 18:48:49 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`qm {{[cr|create]}} {{100}} --memory {{8192}} --cores {{4}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Specify the type of operating system on the machine:
|
|
|
|
|
|
2025-09-14 18:48:49 -06:00
|
|
|
`qm {{[cr|create]}} {{100}} --ostype {{win10}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Replace an existing machine (requires archiving it):
|
|
|
|
|
|
2025-09-14 18:48:49 -06:00
|
|
|
`qm {{[cr|create]}} {{100}} --archive {{path/to/backup_file.tar}} --force 1`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Specify a script that is executed automatically depending on the state of the virtual machine:
|
|
|
|
|
|
2025-09-14 18:48:49 -06:00
|
|
|
`qm {{[cr|create]}} {{100}} --hookscript {{path/to/script.pl}}`
|
|
|
|
|
|
|
|
|
|
- Specify the install media:
|
|
|
|
|
|
|
|
|
|
`qm {{[cr|create]}} {{100}} --cdrom {{local:iso/install-media.iso}}`
|
|
|
|
|
|
|
|
|
|
- Create a VM that bridges itself to the host network:
|
|
|
|
|
|
|
|
|
|
`qm {{[cr|create]}} {{100}} --net{{0}} virtio,bridge=vmbr{{0}}`
|