qm create Command Examples in Linux

The qm create command is a command-line tool provided by the QEMU/KVM Virtual Machine Manager that allows users to create a new virtual machine or restore an existing virtual machine from a backup. The tool supports a wide range of configuration options and settings, allowing users to customize the virtual machine to their specific needs.

To use qm create, users first need to specify the ID number and name of the new virtual machine. They can then configure the virtual hardware components of the machine, such as the number of CPUs, the amount of memory, and the size and type of the virtual hard disk. The qm create command also supports advanced configuration options, such as setting up virtual network interfaces and specifying boot parameters.

qm create Command Examples

1. Create a virtual machine:

# qm create {{100}}

2. Automatically start the machine after creation:

# qm create {{100}} --start 1

3. Specify the type of operating system on the machine:

# qm create {{100}} --ostype {{win10}}

4. Replace an existing machine (requires archiving it):

# qm create {{100}} --archive {{path/to/backup_file.tar}} --force 1

5. Specify a script that is executed automatically depending on the state of the virtual machine:

# qm create {{100}} --hookscript {{path/to/script.pl}}

Summary

Once the virtual machine is created, users can start the machine using the qm start command, or connect to it using remote desktop or SSH to install an operating system and configure the machine as needed.

In addition to creating new virtual machines, the QEMU/KVM Virtual Machine Manager provides a variety of other commands and features for managing virtual machines, including cloning, modifying, and deleting VMs, as well as backing up and restoring VMs.

Overall, qm create is a powerful tool for managing virtual machines on a Linux system, allowing users to easily create and configure new virtual machines to meet their specific needs. More information about qm create 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.

Related Post