Command Line Interface
Virtual Machine:
qm
Commands Related to Cloud-Init
qm cloudinit dump <vmid> <type>
-
Displays the cloud-init configuration of the VM.
-
<vmid>
: ID of the Virtual Machine. -
<type>
: Type of configuration to display (e.g.,network
,user
).
qm cloudinit pending <vmid>
-
Displays pending cloud-init changes to be applied to the VM.
-
<vmid>
: ID of the Virtual Machine.
qm cloudinit update <vmid>
-
Updates the cloud-init configuration of the VM.
-
<vmid>
: ID of the Virtual Machine.
qm
Commands Related to Disk
qm disk move <vmid> <disk> [<storage>] [OPTIONS]
-
Moves the VM disk to a different storage.
-
<vmid>
: ID of the Virtual Machine. -
<disk>
: Disk identifier (e.g.,virtio0
). -
[<storage>]
: Destination storage name.
qm disk resize <vmid> <disk> <size> [OPTIONS]
-
Resizes the VM disk.
-
<vmid>
: ID of the Virtual Machine. -
<disk>
: Disk identifier. -
<size>
: New disk size.
qm disk unlink <vmid> --idlist <string> [OPTIONS]
-
Unlinks a disk from the VM.
-
<vmid>
: ID of the Virtual Machine. -
--idlist <string>
: List of disk IDs to unlink.
qm disk import <vmid> <source> <storage> [OPTIONS]
-
Imports a disk to the VM from a specified source.
-
<vmid>
: ID of the Virtual Machine. -
<source>
: Disk source (e.g., file). -
<storage>
: Destination storage.
qm disk rescan [OPTIONS]
-
Rescans disks to detect changes.
qm
Commands Related to Guest
qm guest cmd <vmid> <command>
-
Executes a command inside the guest VM.
-
<vmid>
: ID of the Virtual Machine. -
<command>
: Command to be executed.
qm guest exec-status <vmid> <pid>
-
Displays the status of a command executed inside the guest VM.
-
<vmid>
: ID of the Virtual Machine. -
<pid>
: Process ID of the command.
qm guest passwd <vmid> <username> [OPTIONS]
-
Changes the password of a user inside the guest VM.
-
<vmid>
: ID of the Virtual Machine. -
<username>
: Username inside the guest VM.
qm guest exec <vmid> [<extra-args>] [OPTIONS]
-
Executes a command inside the guest VM with additional options.
-
<vmid>
: ID of the Virtual Machine. -
[<extra-args>]
: Additional arguments for the command.
qm
Commands Related to VM Management
qm clone <vmid> <newid> [OPTIONS]
-
Clones a VM.
-
<vmid>
: ID of the Virtual Machine to be cloned. -
<newid>
: New ID for the clone.
qm config <vmid> [OPTIONS]
-
Displays or modifies the VM configuration.
-
<vmid>
: ID of the Virtual Machine.
qm create <vmid> [OPTIONS]
-
Creates a new VM.
-
<vmid>
: ID for the new VM.
qm delsnapshot <vmid> <snapname> [OPTIONS]
-
Deletes a snapshot of the VM.
-
<vmid>
: ID of the Virtual Machine. -
<snapname>
: Name of the snapshot to be deleted.
qm destroy <vmid> [OPTIONS]
-
Destroys a VM.
-
<vmid>
: ID of the Virtual Machine.
qm list [OPTIONS]
-
Displays a list of VMs.
qm listsnapshot <vmid>
-
Displays a list of snapshots of the VM.
-
<vmid>
: ID of the Virtual Machine.
qm migrate <vmid> <target> [OPTIONS]
-
Migrates a VM to another node.
-
<vmid>
: ID of the Virtual Machine. -
<target>
: Destination node.
qm pending <vmid>
-
Displays pending configuration changes to be applied to the VM.
-
<vmid>
: ID of the Virtual Machine.
qm reboot <vmid> [OPTIONS]
-
Reboots the VM.
-
<vmid>
: ID of the Virtual Machine.
qm reset <vmid> [OPTIONS]
-
Resets the VM (similar to pressing the reset button on hardware).
-
<vmid>
: ID of the Virtual Machine.
qm resume <vmid> [OPTIONS]
-
Resumes a suspended VM.
-
<vmid>
: ID of the Virtual Machine.
qm rollback <vmid> <snapname> [OPTIONS]
-
Rolls back the VM to a previous snapshot.
-
<vmid>
: ID of the Virtual Machine. -
<snapname>
: Name of the snapshot.
qm sendkey <vmid> <key> [OPTIONS]
-
Sends a key to the VM.
-
<vmid>
: ID of the Virtual Machine. -
<key>
: Key to be sent.
qm set <vmid> [OPTIONS]
-
Sets the configuration of the VM.
-
<vmid>
: ID of the Virtual Machine.
qm shutdown <vmid> [OPTIONS]
-
Shuts down the VM safely.
-
<vmid>
: ID of the Virtual Machine.
qm snapshot <vmid> <snapname> [OPTIONS]
-
Creates a snapshot of the VM.
-
<vmid>
: ID of the Virtual Machine. -
<snapname>
: Name for the snapshot.
qm start <vmid> [OPTIONS]
-
Starts the VM.
-
<vmid>
: ID of the Virtual Machine.
qm stop <vmid> [OPTIONS]
-
Forcefully stops the VM.
-
<vmid>
: ID of the Virtual Machine.
qm suspend <vmid> [OPTIONS]
-
Suspends the VM.
-
<vmid>
: ID of the Virtual Machine.
qm template <vmid> [OPTIONS]
-
Converts the VM to a template.
-
<vmid>
: ID of the Virtual Machine.
qm
Commands Related to Import/Export
qm cleanup <vmid> <clean-shutdown> <guest-requested>
-
Cleans up the VM after shutdown or guest request.
-
<vmid>
: ID of the Virtual Machine. -
<clean-shutdown>
: Indicates if the VM was shut down safely. -
<guest-requested>
: Indicates if the request came from the guest.
qm import <vmid> <source> --storage <string> [OPTIONS]
-
Imports a VM from a specified source.
-
<vmid>
: ID of the Virtual Machine. -
<source>
: Source of the VM (e.g., file). -
--storage <string>
: Destination storage.
qm importovf <vmid> <manifest> <storage> [OPTIONS]
-
Imports a VM from an OVF file.
-
<vmid>
: ID of the Virtual Machine. -
<manifest>
: OVF manifest file. -
<storage>
: Destination storage.
Other qm
Commands
qm monitor <vmid>
-
Opens the VM monitor.
-
<vmid>
: ID of the Virtual Machine.
qm mtunnel
-
Opens tunneling for VM migration.
qm nbdstop <vmid>
-
Stops the Network Block Device on the VM.
-
<vmid>
: ID of the Virtual Machine.
qm remote-migrate <vmid> [<target-vmid>] <target-endpoint> --target-bridge <string> --target-storage <string> [OPTIONS]
-
Migrates the VM to a remote endpoint.
-
<vmid>
: ID of the Virtual Machine. -
[<target-vmid>]
: New ID on the remote if necessary. -
<target-endpoint>
: Destination endpoint. -
--target-bridge <string>
: Destination network bridge. -
--target-storage <string>
: Destination storage.
qm showcmd <vmid> [OPTIONS]
-
Displays the QEMU command for the VM.
-
<vmid>
: ID of the Virtual Machine.
qm status <vmid> [OPTIONS]
-
Displays the status of the VM.
-
<vmid>
: ID of the Virtual Machine.
qm terminal <vmid> [OPTIONS]
-
Opens the terminal for the VM.
-
<vmid>
: ID of the Virtual Machine.
qm unlock <vmid>
-
Unlocks the VM.
-
<vmid>
: ID of the Virtual Machine.
qm vncproxy <vmid>
-
Opens a VNC proxy for the VM.
-
<vmid>
: ID of the Virtual Machine.
qm wait <vmid> [OPTIONS]
-
Waits for the VM to reach a specific status.
-
<vmid>
: ID of the Virtual Machine.
qm help [<extra-args>] [OPTIONS]
-
Displays help for
qm
commands.
Command Line Interface qm Options
qm list [OPTIONS]
-
--no-headers
: Excludes the header row from the output. -
Example:
qm list --no-headers
qm listsnapshot <vmid>
-
No specific options: This command does not have options.
qm migrate <vmid> <target> [OPTIONS]
-
--online
: Performs an online migration, keeping the VM running. -
Example:
qm migrate 100 pve-node2 --online
-
--timeout <time>
: Sets the timeout for migration. -
Example:
qm migrate 100 pve-node2 --timeout 300
(sets timeout to 300 seconds)
qm pending <vmid>
-
No specific options: This command does not have options.
qm reboot <vmid> [OPTIONS]
-
--force
: Forces the VM to reboot even if it is in a state that does not allow a clean reboot. -
Example:
qm reboot 100 --force
qm reset <vmid> [OPTIONS]
-
--force
: Forces a reset of the VM. -
Example:
qm reset 100 --force
qm resume <vmid> [OPTIONS]
-
No specific options: This command does not have options.
qm rollback <vmid> <snapname> [OPTIONS]
-
--snapshot
: Indicates the snapshot name to roll back to. -
Example:
qm rollback 100 mysnapshot --snapshot mysnapshot
qm sendkey <vmid> <key> [OPTIONS]
-
--key
: Specifies the key to be sent to the VM. -
Example:
qm sendkey 100 Enter --key Enter
qm set <vmid> [OPTIONS]
-
--config
: Allows modification of VM configuration. -
Example:
qm set 100 --config cpu=2
qm shutdown <vmid> [OPTIONS]
-
--force
: Forces the VM to shut down even if it’s not responding. -
Example:
qm shutdown 100 --force
qm snapshot <vmid> <snapname> [OPTIONS]
-
--description <desc>
: Adds a description to the snapshot. -
Example:
qm snapshot 100 mysnapshot --description "Pre-update snapshot"
qm start <vmid> [OPTIONS]
-
--autostart
: Configures the VM to automatically start on node boot. -
Example:
qm start 100 --autostart
qm stop <vmid> [OPTIONS]
-
--force
: Forces the VM to stop immediately. -
Example:
qm stop 100 --force
qm suspend <vmid> [OPTIONS]
-
No specific options: This command does not have options.
qm template <vmid> [OPTIONS]
-
--force
: Forces the VM to be converted to a template even if it is running. -
Example:
qm template 100 --force
qm cleanup <vmid> <clean-shutdown> <guest-requested>
-
--clean-shutdown
: Indicates whether the VM was shut down cleanly. -
Example:
qm cleanup 100 true guest
qm import <vmid> <source> --storage <string> [OPTIONS]
-
--storage <storage>
: Specifies the storage for the imported VM. -
Example:
qm import 100 myvm.img --storage local-lvm
qm importovf <vmid> <manifest> <storage> [OPTIONS]
-
--manifest <file>
: Provides the OVF manifest file for import. -
Example:
qm importovf 100 myovf.ovf local-lvm --manifest mymanifest.mf
qm monitor <vmid>
-
No specific options: This command does not have options.
qm mtunnel
-
No specific options: This command does not have options.
qm nbdstop <vmid>
-
No specific options: This command does not have options.
qm remote-migrate <vmid> [<target-vmid>] <target-endpoint> --target-bridge <string> --target-storage <string> [OPTIONS]
-
--target-bridge <bridge>
: Specifies the network bridge on the target. -
Example:
qm remote-migrate 100 pve-node2 --target-bridge vmbr1
-
--target-storage <storage>
: Specifies the storage on the target. -
Example:
qm remote-migrate 100 pve-node2 --target-storage local-lvm
qm showcmd <vmid> [OPTIONS]
-
--config
: Shows the command to configure the VM. -
Example:
qm showcmd 100 --config
qm status <vmid> [OPTIONS]
-
--details
: Provides detailed status information. -
Example:
qm status 100 --details
qm terminal <vmid> [OPTIONS]
-
--resize
: Adjusts the terminal window size. -
Example:
qm terminal 100 --resize 80x24
qm unlock <vmid>
-
No specific options: This command does not have options.
qm vncproxy <vmid>
-
No specific options: This command does not have options.
qm wait <vmid> [OPTIONS]
-
--status <status>
: Waits until the VM reaches the specified status. -
Example:
qm wait 100 --status running
qm help [<extra-args>] [OPTIONS]
-
--all
: Shows help for all commands and options. -
Example:
qm help --all
Certainly! Here’s the continuation of the[OPTIONS]
explanations forqm
commands:
qm cloudinit dump <vmid> <type>
-
No specific options: This command does not have additional options.
qm cloudinit pending <vmid>
-
No specific options: This command does not have additional options.
qm cloudinit update <vmid>
-
No specific options: This command does not have additional options.
qm disk move <vmid> <disk> [<storage>] [OPTIONS]
-
--timeout <time>
: Sets the timeout for the disk move operation. -
Example:
qm disk move 100 virtio0 local-lvm --timeout 120
(sets the timeout to 120 seconds) -
--force
: Forces the move operation even if there are warnings. -
Example:
qm disk move 100 virtio0 local-lvm --force
qm disk resize <vmid> <disk> <size> [OPTIONS]
-
--resize
: Specifies the new size of the disk. -
Example:
qm disk resize 100 virtio0 50G --resize 50G
-
--force
: Forces the resize operation. -
Example:
qm disk resize 100 virtio0 50G --force
qm disk unlink <vmid> --idlist <string> [OPTIONS]
-
--idlist <string>
: Provides a comma-separated list of disk IDs to unlink. -
Example:
qm disk unlink 100 --idlist virtio0,virtio1
qm disk import <vmid> <source> <storage> [OPTIONS]
-
--timeout <time>
: Sets the timeout for the import operation. -
Example:
qm disk import 100 mydisk.img local-lvm --timeout 180
(sets the timeout to 180 seconds) -
--force
: Forces the import operation even if there are warnings. -
Example:
qm disk import 100 mydisk.img local-lvm --force
qm disk rescan [OPTIONS]
-
--timeout <time>
: Sets the timeout for the rescan operation. -
Example:
qm disk rescan --timeout 60
qm guest cmd <vmid> <command>
-
No specific options: This command does not have additional options.
qm guest exec-status <vmid> <pid>
-
No specific options: This command does not have additional options.
qm guest passwd <vmid> <username> [OPTIONS]
-
--password <password>
: Specifies the new password for the user. -
Example:
qm guest passwd 100 admin --password newpassword123
qm guest exec <vmid> [<extra-args>] [OPTIONS]
-
--extra-args <args>
: Passes additional arguments to the command executed inside the guest. -
Example:
qm guest exec 100 'df -h' --extra-args 'df -h'
qm clone <vmid> <newid> [OPTIONS]
-
--name <name>
: Sets a new name for the cloned VM. -
Example:
qm clone 100 200 --name my-clone
-
--target-node <node>
: Specifies the target node for the cloned VM. -
Example:
qm clone 100 200 --target-node pve-node2
qm create <vmid> [OPTIONS]
-
--name <name>
: Specifies the name for the new VM. -
Example:
qm create 100 --name my-new-vm
-
--cores <num>
: Sets the number of CPU cores for the VM. -
Example:
qm create 100 --cores 4
qm delsnapshot <vmid> <snapname> [OPTIONS]
-
--force
: Forces the deletion of the snapshot. -
Example:
qm delsnapshot 100 mysnapshot --force
qm destroy <vmid> [OPTIONS]
-
--force
: Forces the destruction of the VM, bypassing confirmation prompts. -
Example:
qm destroy 100 --force
qm migrate <vmid> <target> [OPTIONS]
-
--online
: Performs an online migration to keep the VM running during migration. -
Example:
qm migrate 100 pve-node2 --online
qm pending <vmid>
-
No specific options: This command does not have additional options.
qm reboot <vmid> [OPTIONS]
-
--force
: Forces the reboot of the VM. -
Example:
qm reboot 100 --force
qm reset <vmid> [OPTIONS]
-
--force
: Forces the reset of the VM. -
Example:
qm reset 100 --force
qm resume <vmid> [OPTIONS]
-
No specific options: This command does not have additional options.
qm rollback <vmid> <snapname> [OPTIONS]
-
--snapshot
: Specifies the snapshot to roll back to. -
Example:
qm rollback 100 mysnapshot --snapshot mysnapshot
qm sendkey <vmid> <key> [OPTIONS]
-
--key <key>
: Specifies the key to be sent to the VM. -
Example:
qm sendkey 100 Enter --key Enter
qm set <vmid> [OPTIONS]
-
--config
: Specifies configuration settings to be applied to the VM. -
Example:
qm set 100 --config memory=2048
qm shutdown <vmid> [OPTIONS]
-
--force
: Forces the shutdown of the VM. -
Example:
qm shutdown 100 --force
qm snapshot <vmid> <snapname> [OPTIONS]
-
--description <desc>
: Adds a description to the snapshot. -
Example:
qm snapshot 100 mysnapshot --description "Pre-update snapshot"
qm start <vmid> [OPTIONS]
-
--autostart
: Configures the VM to start automatically on node boot. -
Example:
qm start 100 --autostart
qm stop <vmid> [OPTIONS]
-
--force
: Forces the VM to stop immediately. -
Example:
qm stop 100 --force
qm suspend <vmid> [OPTIONS]
-
No specific options: This command does not have additional options.
qm template <vmid> [OPTIONS]
-
--force
: Forces the VM to be converted to a template even if it is running. -
Example:
qm template 100 --force
qm cleanup <vmid> <clean-shutdown> <guest-requested>
-
--clean-shutdown
: Indicates if the VM has been shut down cleanly. -
Example:
qm cleanup 100 true guest
qm import <vmid> <source> --storage <string> [OPTIONS]
-
--storage <storage>
: Specifies the storage for the imported VM. -
Example:
qm import 100 myvm.img --storage local-lvm
qm importovf <vmid> <manifest> <storage> [OPTIONS]
-
--manifest <file>
: Specifies the OVF manifest file. -
Example:
qm importovf 100 myovf.ovf local-lvm --manifest mymanifest.mf
qm monitor <vmid>
-
No specific options: This command does not have additional options.
qm mtunnel
-
No specific options: This command does not have additional options.
qm nbdstop <vmid>
-
No specific options: This command does not have additional options.
qm remote-migrate <vmid> [<target-vmid>] <target-endpoint> --target-bridge <string> --target-storage <string> [OPTIONS]
-
--target-bridge <bridge>
: Specifies the target network bridge. -
Example:
qm remote-migrate 100 pve-node2 --target-bridge vmbr1
-
--target-storage <storage>
: Specifies the target storage. -
Example:
qm remote-migrate 100 pve-node2 --target-storage local-lvm
qm showcmd <vmid> [OPTIONS]
-
--config
: Displays the command to configure the VM. -
Example:
qm showcmd 100 --config
qm status <vmid> [OPTIONS]
-
--details
: Provides detailed status information. -
Example:
qm status 100 --details
qm terminal <vmid> [OPTIONS]
-
--resize
: Adjusts the terminal window size. -
Example:
qm terminal 100 --resize 80x24
qm unlock <vmid>
-
No specific options: This command does not have additional options.
qm vncproxy <vmid>
-
No specific options: This command does not have additional options.
qm wait <vmid> [OPTIONS]
-
--status <status>
: Waits until the VM reaches the specified status. -
Example:
qm wait 100 --status running
qm help [<extra-args>] [OPTIONS]
-
--all
: Shows help for all commands and options. -
Example:
qm help --all
Container:
pct
Commands
Container Management Commands
pct clone <vmid> <newid> [OPTIONS]
-
Clones a container.
-
<vmid>
: ID of the source container. -
<newid>
: ID for the new container.
pct create <vmid> <ostemplate> [OPTIONS]
-
Creates a new container.
-
<vmid>
: ID for the new container. -
<ostemplate>
: OS template for the container.
pct destroy <vmid> [OPTIONS]
-
Destroys a container.
-
<vmid>
: ID of the container.
pct list
-
Lists all containers.
pct migrate <vmid> <target> [OPTIONS]
-
Migrates a container to another node.
-
<vmid>
: ID of the container. -
<target>
: Target node.
pct move-volume <vmid> <volume> [<storage>] [<target-vmid>] [<target-volume>] [OPTIONS]
-
Moves a container volume to a different storage.
-
<vmid>
: ID of the container. -
<volume>
: Volume identifier. -
[<storage>]
: Target storage name. -
[<target-vmid>]
: ID of the target container. -
[<target-volume>]
: Target volume identifier.
pct pending <vmid>
-
Displays pending configuration changes for the container.
-
<vmid>
: ID of the container.
pct resize <vmid> <disk> <size> [OPTIONS]
-
Resizes a container disk.
-
<vmid>
: ID of the container. -
<disk>
: Disk identifier. -
<size>
: New disk size.
pct restore <vmid> <ostemplate> [OPTIONS]
-
Restores a container from a backup.
-
<vmid>
: ID of the container. -
<ostemplate>
: OS template for the container.
pct template <vmid>
-
Converts a container into a template.
-
<vmid>
: ID of the container.
Configuration Commands
pct config <vmid> [OPTIONS]
-
Displays or modifies the container configuration.
-
<vmid>
: ID of the container.
pct set <vmid> [OPTIONS]
-
Sets the container configuration.
-
<vmid>
: ID of the container.
Snapshot Commands
pct delsnapshot <vmid> <snapname> [OPTIONS]
-
Deletes a snapshot of the container.
-
<vmid>
: ID of the container. -
<snapname>
: Name of the snapshot.
pct listsnapshot <vmid>
-
Lists snapshots of the container.
-
<vmid>
: ID of the container.
pct rollback <vmid> <snapname> [OPTIONS]
-
Rolls back the container to a previous snapshot.
-
<vmid>
: ID of the container. -
<snapname>
: Name of the snapshot.
pct snapshot <vmid> <snapname> [OPTIONS]
-
Creates a snapshot of the container.
-
<vmid>
: ID of the container. -
<snapname>
: Name of the snapshot.
Power Management Commands
pct reboot <vmid> [OPTIONS]
-
Reboots the container.
-
<vmid>
: ID of the container.
pct resume <vmid>
-
Resumes a suspended container.
-
<vmid>
: ID of the container.
pct shutdown <vmid> [OPTIONS]
-
Shuts down the container safely.
-
<vmid>
: ID of the container.
pct start <vmid> [OPTIONS]
-
Starts the container.
-
<vmid>
: ID of the container.
pct stop <vmid> [OPTIONS]
-
Forcefully stops the container.
-
<vmid>
: ID of the container.
pct suspend <vmid>
-
Suspends the container.
-
<vmid>
: ID of the container.
Console and Terminal Commands
pct console <vmid> [OPTIONS]
-
Opens a console for the container.
-
<vmid>
: ID of the container.
pct cpusets
-
Lists CPU sets.
pct df <vmid>
-
Displays disk usage for the container.
-
<vmid>
: ID of the container.
pct enter <vmid> [OPTIONS]
-
Enters the container.
-
<vmid>
: ID of the container.
pct exec <vmid> [<extra-args>] [OPTIONS]
-
Executes a command inside the container.
-
<vmid>
: ID of the container. -
[<extra-args>]
: Additional arguments for the command.
Filesystem Commands
pct fsck <vmid> [OPTIONS]
-
Performs a filesystem check on the container.
-
<vmid>
: ID of the container.
pct fstrim <vmid> [OPTIONS]
-
Trims unused space on the container’s filesystem.
-
<vmid>
: ID of the container.
pct mount <vmid>
-
Mounts the container’s filesystem.
-
<vmid>
: ID of the container.
pct pull <vmid> <path> <destination> [OPTIONS]
-
Pulls a file from the container.
-
<vmid>
: ID of the container. -
<path>
: Path to the file in the container. -
<destination>
: Local destination path.
pct push <vmid> <file> <destination> [OPTIONS]
-
Pushes a file to the container.
-
<vmid>
: ID of the container. -
<file>
: Local file path. -
<destination>
: Destination path in the container.
Migration and Monitoring Commands
pct remote-migrate <vmid> [<target-vmid>] <target-endpoint> --target-bridge <string> --target-storage <string> [OPTIONS]
-
Migrates the container to a remote endpoint.
-
<vmid>
: ID of the container. -
[<target-vmid>]
: New ID on the remote if necessary. -
<target-endpoint>
: Target endpoint. -
--target-bridge <string>
: Target network bridge. -
--target-storage <string>
: Target storage.
pct rescan [OPTIONS]
-
Rescans the container to detect changes.
pct status <vmid> [OPTIONS]
-
Displays the status of the container.
-
<vmid>
: ID of the container.
pct unlock <vmid>
-
Unlocks the container.
-
<vmid>
: ID of the container.
pct unmount <vmid>
-
Unmounts the container’s filesystem.
-
<vmid>
: ID of the container.
Help Command
pct help [<extra-args>] [OPTIONS]
-
Displays help for
pct
commands.
Command Line Interface pct Option
Detailed Options with Examples for pct
Commands
Container Management Commands
pct clone <vmid> <newid> [OPTIONS]
-
Description: Clone an existing container.
-
Options:
-
--bwlimit <integer>
: Set bandwidth limit in KB/s. -
--hostname <string>
: Set the container hostname. -
--snapname <string>
: Snapshot name to clone from. -
--storage <string>
: Target storage for the root disk. -
Example:
pct create <vmid> <ostemplate> [OPTIONS]
-
Description: Create a new container.
-
Options:
-
--arch <string>
: Set architecture (e.g., amd64, arm64). -
--bwlimit <integer>
: Set bandwidth limit in KB/s. -
--cmode <string>
: Set clone mode. -
--cpulimit <number>
: Limit CPU usage. -
--cpuunits <integer>
: Set CPU weight. -
--description <string>
: Container description. -
--features <string>
: Enable container features. -
--hostname <string>
: Set container hostname. -
--memory <integer>
: Set memory limit in MB. -
--nameserver <string>
: Set DNS server. -
--net<n> <string>
: Network interface configuration. -
--onboot <boolean>
: Start at boot. -
--ostype <string>
: Set OS type. -
--password <string>
: Set root password. -
--rootfs <string>
: Set root filesystem. -
--ssh-public-keys <string>
: Set SSH public keys. -
--start <boolean>
: Start after creation. -
--storage <string>
: Set target storage. -
--swap <integer>
: Set swap memory in MB. -
--tags <string>
: Set container tags. -
--template <boolean>
: Create as template. -
Example:
pct destroy <vmid> [OPTIONS]
-
Description: Destroy an existing container.
-
Options:
-
--force <boolean>
: Force removal. -
Example:
pct list
-
Description: List all containers.
-
Example:
pct migrate <vmid> <target> [OPTIONS]
-
Description: Migrate a container to another node.
-
Options:
-
--bwlimit <integer>
: Set bandwidth limit in KB/s. -
--online <boolean>
: Perform online migration. -
--restart <boolean>
: Restart container after migration. -
--with-local-disks <boolean>
: Migrate local disks. -
Example:
pct move-volume <vmid> <volume> [<storage>] [<target-vmid>] [<target-volume>] [OPTIONS]
-
Description: Move a container volume to another storage or container.
-
Options:
-
--bwlimit <integer>
: Set bandwidth limit in KB/s. -
Example:
pct pending <vmid>
-
Description: Display pending changes for a container.
-
Example:
pct resize <vmid> <disk> <size> [OPTIONS]
-
Description: Resize a container disk.
-
Options:
-
--disk <string>
: Disk identifier. -
--size <string>
: New disk size. -
Example:
pct restore <vmid> <ostemplate> [OPTIONS]
-
Description: Restore a container from a backup.
-
Options:
-
--force <boolean>
: Force restore. -
Example:
pct template <vmid>
-
Description: Convert a container to a template.
-
Example:
Container Configuration Commands
pct config <vmid> [OPTIONS]
-
Description: Get or set container configuration.
-
Options:
-
--remove <string>
: Remove an option. -
Example:
pct set <vmid> [OPTIONS]
-
Description: Set container configuration.
-
Options:
-
--arch <string>
: Set architecture. -
--bwlimit <integer>
: Set bandwidth limit in KB/s. -
--cmode <string>
: Set clone mode. -
--cpulimit <number>
: Limit CPU usage. -
--cpuunits <integer>
: Set CPU weight. -
--description <string>
: Container description. -
--features <string>
: Enable container features. -
--hostname <string>
: Set container hostname. -
--memory <integer>
: Set memory limit in MB. -
--nameserver <string>
: Set DNS server. -
--net<n> <string>
: Network interface configuration. -
--onboot <boolean>
: Start at boot. -
--ostype <string>
: Set OS type. -
--password <string>
: Set root password. -
--rootfs <string>
: Set root filesystem. -
--ssh-public-keys <string>
: Set SSH public keys. -
--start <boolean>
: Start after creation. -
--storage <string>
: Set target storage. -
--swap <integer>
: Set swap memory in MB. -
--tags <string>
: Set container tags. -
--template <boolean>
: Create as template. -
Example:
Container Snapshot Commands
pct delsnapshot <vmid> <snapname> [OPTIONS]
-
Description: Delete a snapshot.
-
Options:
-
--force <boolean>
: Force delete. -
Example:
pct listsnapshot <vmid>
-
Description: List all snapshots of a container.
-
Example:
pct rollback <vmid> <snapname> [OPTIONS]
-
Description: Rollback to a snapshot.
-
Options:
-
--force <boolean>
: Force rollback. -
Example:
pct snapshot <vmid> <snapname> [OPTIONS]
-
Description: Create a snapshot.
-
Options:
-
--description <string>
: Snapshot description. -
Example:
Container State Commands
pct reboot <vmid> [OPTIONS]
-
Description: Reboot a container.
-
Options:
-
--timeout <integer>
: Timeout in seconds. -
Example:
pct resume <vmid>
-
Description: Resume a suspended container.
-
Example:
pct shutdown <vmid> [OPTIONS]
-
Description: Shut down a container.
-
Options:
-
--timeout <integer>
: Timeout in seconds. -
Example:
pct start <vmid> [OPTIONS]
-
Description: Start a container.
-
Options:
-
--force <boolean>
: Force start. -
Example:
pct stop <vmid> [OPTIONS]
-
Description: Stop a container.
-
Options:
-
--timeout <integer>
: Timeout in seconds. -
Example:
Container Management Commands (continued)
pct clone <vmid> <newid> [OPTIONS]
-
Options:
-
--target-storage <string>
: Target storage for the new container.
pct create <vmid> <ostemplate> [OPTIONS]
-
Options:
-
--features <string>
: Enable specific container features. -
--net0 <string>
: Configure network interface 0. -
--rootfs <string>
: Define root filesystem path.
pct destroy <vmid> [OPTIONS]
-
Options:
-
--force <boolean>
: Force removal of the container.
pct move-volume <vmid> <volume> [<storage>] [<target-vmid>] [<target-volume>] [OPTIONS]
-
Options:
-
--target-storage <string>
: Target storage for the volume. -
--target-volume <string>
: Target volume name.
pct restore <vmid> <ostemplate> [OPTIONS]
-
Options:
-
--compression <string>
: Compression type for backup files.
pct template <vmid>
-
Example:
Container Configuration Commands (continued)
pct config <vmid> [OPTIONS]
-
Options:
-
--remove <string>
: Remove a configuration option.
pct set <vmid> [OPTIONS]
-
Options:
-
--memory <integer>
: Adjust the memory allocation for the container. -
--cpulimit <number>
: Set CPU limit.
Container Snapshot Commands (continued)
pct snapshot <vmid> <snapname> [OPTIONS]
-
Options:
-
--description <string>
: Provide a description for the snapshot.
pct rollback <vmid> <snapname> [OPTIONS]
-
Options:
-
--force <boolean>
: Force the rollback if there are conflicts.
Container State Commands (continued)
pct reboot <vmid> [OPTIONS]
-
Options:
-
--timeout <integer>
: Set a timeout for the reboot operation.
pct start <vmid> [OPTIONS]
-
Options:
-
--force <boolean>
: Force start if the container is in an inconsistent state.
pct stop <vmid> [OPTIONS]
-
Options:
-
--timeout <integer>
: Set a timeout for the stop operation.
Container Interaction Commands (continued)
pct cpusets
-
Description: Manage CPU sets.
-
Example:
pct df <vmid>
-
Description: Display disk usage of the container.
-
Example:
pct enter <vmid> [OPTIONS]
-
Options:
-
--tty <boolean>
: Allocate a TTY for interactive use. -
--stdin <boolean>
: Keep STDIN open for input.
pct exec <vmid> [<extra-args>] [OPTIONS]
-
Options:
-
--tty <boolean>
: Allocate a TTY for the command. -
--stdin <boolean>
: Keep STDIN open for input.
pct fsck <vmid> [OPTIONS]
-
Options:
-
--force <boolean>
: Force filesystem check.
pct fstrim <vmid> [OPTIONS]
-
Options:
-
--force <boolean>
: Force the trimming operation.
pct mount <vmid>
-
Description: Mount the container’s filesystem.
-
Example:
pct pull <vmid> <path> <destination> [OPTIONS]
-
Options:
-
--recursive <boolean>
: Copy directories recursively.
pct push <vmid> <file> <destination> [OPTIONS]
-
Options:
-
--recursive <boolean>
: Copy directories recursively.
pct remote-migrate <vmid> [<target-vmid>] <target-endpoint> --target-bridge <string> --target-storage <string> [OPTIONS]
-
Options:
-
--target-bridge <string>
: Specify target bridge for network. -
--target-storage <string>
: Specify target storage for migration.
pct rescan [OPTIONS]
-
Options:
-
--force <boolean>
: Force rescan of storage devices.
pct status <vmid> [OPTIONS]
-
Options:
-
--verbose <boolean>
: Display detailed status information.
pct unlock <vmid>
-
Description: Unlock a container that is in a locked state.
-
Example:
pct unmount <vmid>
-
Description: Unmount the container’s filesystem.
-
Example:
pct help [<extra-args>] [OPTIONS]
-
Options:
-
--all <boolean>
: Display all available help information.