1 *pct* `<COMMAND> [ARGS] [OPTIONS]`
3 *pct clone* `<vmid> <newid> --experimental <boolean>` `[OPTIONS]`
5 Create a container clone/copy
7 `<vmid>`: `<integer> (1 - N)` ::
9 The (unique) ID of the VM.
11 `<newid>`: `<integer> (1 - N)` ::
15 `--description` `<string>` ::
17 Description for the new CT.
19 `--experimental` `<boolean>` ('default =' `0`)::
21 The clone feature is experimental, set this flag if you know what you are doing.
23 `--full` `<boolean>` ('default =' `0`)::
25 Create a full copy of all disk. This is always done when you clone a normal CT. For CT templates, we try to create a linked clone by default.
27 `--hostname` `<string>` ::
29 Set a hostname for the new CT.
31 `--pool` `<string>` ::
33 Add the new CT to the specified pool.
35 `--snapname` `<string>` ::
37 The name of the snapshot.
39 `--storage` `<string>` ::
41 Target storage for full clone.
43 NOTE: Requires option(s): `full`
47 Get container configuration.
49 `<vmid>`: `<integer> (1 - N)` ::
51 The (unique) ID of the VM.
53 *pct console* `<vmid>`
55 Launch a console for the specified container.
57 `<vmid>`: `<integer> (1 - N)` ::
59 The (unique) ID of the VM.
63 Print the list of assigned CPU sets.
65 *pct create* `<vmid> <ostemplate>` `[OPTIONS]`
67 Create or restore a container.
69 `<vmid>`: `<integer> (1 - N)` ::
71 The (unique) ID of the VM.
73 `<ostemplate>`: `<string>` ::
75 The OS template or backup file.
77 `--arch` `<amd64 | i386>` ('default =' `amd64`)::
81 `--cmode` `<console | shell | tty>` ('default =' `tty`)::
83 Console mode. By default, the console command tries to open a connection to one of the available tty devices. By setting cmode to 'console' it tries to attach to /dev/console instead. If you set cmode to 'shell', it simply invokes a shell inside the container (no login).
85 `--console` `<boolean>` ('default =' `1`)::
87 Attach a console device (/dev/console) to the container.
89 `--cores` `<integer> (1 - 128)` ::
91 The number of cores assigned to the container. A container can use all available cores by default.
93 `--cpulimit` `<number> (0 - 128)` ('default =' `0`)::
97 NOTE: If the computer has 2 CPUs, it has a total of '2' CPU time. Value '0' indicates no CPU limit.
99 `--cpuunits` `<integer> (0 - 500000)` ('default =' `1024`)::
101 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 the weights of all the other running VMs.
103 NOTE: You can disable fair-scheduler configuration by setting this to 0.
105 `--description` `<string>` ::
107 Container description. Only used on the configuration web interface.
109 `--force` `<boolean>` ::
111 Allow to overwrite existing container.
113 `--hostname` `<string>` ::
115 Set a host name for the container.
117 `--ignore-unpack-errors` `<boolean>` ::
119 Ignore errors when extracting the template.
121 `--lock` `<backup | migrate | rollback | snapshot>` ::
125 `--memory` `<integer> (16 - N)` ('default =' `512`)::
127 Amount of RAM for the VM in MB.
129 `--mp[n]` `[volume=]<volume> ,mp=<Path> [,acl=<1|0>] [,backup=<1|0>] [,quota=<1|0>] [,replicate=<1|0>] [,ro=<1|0>] [,shared=<1|0>] [,size=<DiskSize>]` ::
131 Use volume as container mount point.
133 `--nameserver` `<string>` ::
135 Sets DNS server IP address for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.
137 `--net[n]` `name=<string> [,bridge=<bridge>] [,firewall=<1|0>] [,gw=<GatewayIPv4>] [,gw6=<GatewayIPv6>] [,hwaddr=<XX:XX:XX:XX:XX:XX>] [,ip=<(IPv4/CIDR|dhcp|manual)>] [,ip6=<(IPv6/CIDR|auto|dhcp|manual)>] [,mtu=<integer>] [,rate=<mbps>] [,tag=<integer>] [,trunks=<vlanid[;vlanid...]>] [,type=<veth>]` ::
139 Specifies network interfaces for the container.
141 `--onboot` `<boolean>` ('default =' `0`)::
143 Specifies whether a VM will be started during system bootup.
145 `--ostype` `<alpine | archlinux | centos | debian | fedora | gentoo | opensuse | ubuntu | unmanaged>` ::
147 OS type. This is used to setup configuration inside the container, and corresponds to lxc setup scripts in /usr/share/lxc/config/<ostype>.common.conf. Value 'unmanaged' can be used to skip and OS specific setup.
151 Sets root password inside container.
153 `--pool` `<string>` ::
155 Add the VM to the specified pool.
157 `--protection` `<boolean>` ('default =' `0`)::
159 Sets the protection flag of the container. This will prevent the CT or CT's disk remove/update operation.
161 `--restore` `<boolean>` ::
163 Mark this as restore task.
165 `--rootfs` `[volume=]<volume> [,acl=<1|0>] [,quota=<1|0>] [,replicate=<1|0>] [,ro=<1|0>] [,shared=<1|0>] [,size=<DiskSize>]` ::
167 Use volume as container root.
169 `--searchdomain` `<string>` ::
171 Sets DNS search domains for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.
173 `--ssh-public-keys` `<filepath>` ::
175 Setup public SSH keys (one key per line, OpenSSH format).
177 `--startup` `[[order=]\d+] [,up=\d+] [,down=\d+] ` ::
179 Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the 'up' or 'down' delay in seconds, which specifies a delay to wait before the next VM is started or stopped.
181 `--storage` `<string>` ('default =' `local`)::
185 `--swap` `<integer> (0 - N)` ('default =' `512`)::
187 Amount of SWAP for the VM in MB.
189 `--template` `<boolean>` ('default =' `0`)::
191 Enable/disable Template.
193 `--tty` `<integer> (0 - 6)` ('default =' `2`)::
195 Specify the number of tty available to the container
197 `--unprivileged` `<boolean>` ('default =' `0`)::
199 Makes the container run as unprivileged user. (Should not be modified manually.)
201 `--unused[n]` `<string>` ::
203 Reference to unused volumes. This is used internally, and should not be modified manually.
205 *pct delsnapshot* `<vmid> <snapname>` `[OPTIONS]`
207 Delete a LXC snapshot.
209 `<vmid>`: `<integer> (1 - N)` ::
211 The (unique) ID of the VM.
213 `<snapname>`: `<string>` ::
215 The name of the snapshot.
217 `--force` `<boolean>` ::
219 For removal from config file, even if removing disk snapshots fails.
221 *pct destroy* `<vmid>`
223 Destroy the container (also delete all uses files).
225 `<vmid>`: `<integer> (1 - N)` ::
227 The (unique) ID of the VM.
231 Get the container's current disk usage.
233 `<vmid>`: `<integer> (1 - N)` ::
235 The (unique) ID of the VM.
239 Launch a shell for the specified container.
241 `<vmid>`: `<integer> (1 - N)` ::
243 The (unique) ID of the VM.
245 *pct exec* `<vmid> [<extra-args>]`
247 Launch a command inside the specified container.
249 `<vmid>`: `<integer> (1 - N)` ::
251 The (unique) ID of the VM.
253 `<extra-args>`: `<array>` ::
255 Extra arguments as array
257 *pct fsck* `<vmid>` `[OPTIONS]`
259 Run a filesystem check (fsck) on a container volume.
261 `<vmid>`: `<integer> (1 - N)` ::
263 The (unique) ID of the VM.
265 `--device` `<mp0 | mp1 | mp2 | mp3 | mp4 | mp5 | mp6 | mp7 | mp8 | mp9 | rootfs>` ::
267 A volume on which to run the filesystem check
269 `--force` `<boolean>` ('default =' `0`)::
271 Force checking, even if the filesystem seems clean
273 *pct help* `[OPTIONS]`
275 Get help about specified command.
277 `--extra-args` `<array>` ::
279 Shows help for a specific command
281 `--verbose` `<boolean>` ::
283 Verbose output format.
287 LXC container index (per node).
289 *pct listsnapshot* `<vmid>`
293 `<vmid>`: `<integer> (1 - N)` ::
295 The (unique) ID of the VM.
297 *pct migrate* `<vmid> <target>` `[OPTIONS]`
299 Migrate the container to another node. Creates a new migration task.
301 `<vmid>`: `<integer> (1 - N)` ::
303 The (unique) ID of the VM.
305 `<target>`: `<string>` ::
309 `--force` `<boolean>` ::
311 Force migration despite local bind / device mounts. NOTE: deprecated, use 'shared' property of mount point instead.
313 `--online` `<boolean>` ::
315 Use online/live migration.
317 `--restart` `<boolean>` ::
319 Use restart migration
321 `--timeout` `<integer>` ('default =' `180`)::
323 Timeout in seconds for shutdown for restart migration
327 Mount the container's filesystem on the host. This will hold a lock on the
328 container and is meant for emergency maintenance only as it will prevent
329 further operations on the container other than start and stop.
331 `<vmid>`: `<integer> (1 - N)` ::
333 The (unique) ID of the VM.
335 *pct pull* `<vmid> <path> <destination>` `[OPTIONS]`
337 Copy a file from the container to the local system.
339 `<vmid>`: `<integer> (1 - N)` ::
341 The (unique) ID of the VM.
343 `<path>`: `<string>` ::
345 Path to a file inside the container to pull.
347 `<destination>`: `<string>` ::
351 `--group` `<string>` ::
353 Owner group name or id.
355 `--perms` `<string>` ::
357 File permissions to use (octal by default, prefix with '0x' for hexadecimal).
359 `--user` `<string>` ::
361 Owner user name or id.
363 *pct push* `<vmid> <file> <destination>` `[OPTIONS]`
365 Copy a local file to the container.
367 `<vmid>`: `<integer> (1 - N)` ::
369 The (unique) ID of the VM.
371 `<file>`: `<string>` ::
373 Path to a local file.
375 `<destination>`: `<string>` ::
377 Destination inside the container to write to.
379 `--group` `<string>` ::
381 Owner group name or id. When using a name it must exist inside the container.
383 `--perms` `<string>` ::
385 File permissions to use (octal by default, prefix with '0x' for hexadecimal).
387 `--user` `<string>` ::
389 Owner user name or id. When using a name it must exist inside the container.
391 *pct resize* `<vmid> <disk> <size>` `[OPTIONS]`
393 Resize a container mount point.
395 `<vmid>`: `<integer> (1 - N)` ::
397 The (unique) ID of the VM.
399 `<disk>`: `<mp0 | mp1 | mp2 | mp3 | mp4 | mp5 | mp6 | mp7 | mp8 | mp9 | rootfs>` ::
401 The disk you want to resize.
403 `<size>`: `\+?\d+(\.\d+)?[KMGT]?` ::
405 The new size. With the '+' sign the value is added to the actual size of the volume and without it, the value is taken as an absolute one. Shrinking disk size is not supported.
407 `--digest` `<string>` ::
409 Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications.
411 *pct restore* `<vmid> <ostemplate>` `[OPTIONS]`
413 Create or restore a container.
415 `<vmid>`: `<integer> (1 - N)` ::
417 The (unique) ID of the VM.
419 `<ostemplate>`: `<string>` ::
421 The OS template or backup file.
423 `--arch` `<amd64 | i386>` ('default =' `amd64`)::
425 OS architecture type.
427 `--cmode` `<console | shell | tty>` ('default =' `tty`)::
429 Console mode. By default, the console command tries to open a connection to one of the available tty devices. By setting cmode to 'console' it tries to attach to /dev/console instead. If you set cmode to 'shell', it simply invokes a shell inside the container (no login).
431 `--console` `<boolean>` ('default =' `1`)::
433 Attach a console device (/dev/console) to the container.
435 `--cores` `<integer> (1 - 128)` ::
437 The number of cores assigned to the container. A container can use all available cores by default.
439 `--cpulimit` `<number> (0 - 128)` ('default =' `0`)::
443 NOTE: If the computer has 2 CPUs, it has a total of '2' CPU time. Value '0' indicates no CPU limit.
445 `--cpuunits` `<integer> (0 - 500000)` ('default =' `1024`)::
447 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 the weights of all the other running VMs.
449 NOTE: You can disable fair-scheduler configuration by setting this to 0.
451 `--description` `<string>` ::
453 Container description. Only used on the configuration web interface.
455 `--force` `<boolean>` ::
457 Allow to overwrite existing container.
459 `--hostname` `<string>` ::
461 Set a host name for the container.
463 `--ignore-unpack-errors` `<boolean>` ::
465 Ignore errors when extracting the template.
467 `--lock` `<backup | migrate | rollback | snapshot>` ::
471 `--memory` `<integer> (16 - N)` ('default =' `512`)::
473 Amount of RAM for the VM in MB.
475 `--mp[n]` `[volume=]<volume> ,mp=<Path> [,acl=<1|0>] [,backup=<1|0>] [,quota=<1|0>] [,replicate=<1|0>] [,ro=<1|0>] [,shared=<1|0>] [,size=<DiskSize>]` ::
477 Use volume as container mount point.
479 `--nameserver` `<string>` ::
481 Sets DNS server IP address for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.
483 `--net[n]` `name=<string> [,bridge=<bridge>] [,firewall=<1|0>] [,gw=<GatewayIPv4>] [,gw6=<GatewayIPv6>] [,hwaddr=<XX:XX:XX:XX:XX:XX>] [,ip=<(IPv4/CIDR|dhcp|manual)>] [,ip6=<(IPv6/CIDR|auto|dhcp|manual)>] [,mtu=<integer>] [,rate=<mbps>] [,tag=<integer>] [,trunks=<vlanid[;vlanid...]>] [,type=<veth>]` ::
485 Specifies network interfaces for the container.
487 `--onboot` `<boolean>` ('default =' `0`)::
489 Specifies whether a VM will be started during system bootup.
491 `--ostype` `<alpine | archlinux | centos | debian | fedora | gentoo | opensuse | ubuntu | unmanaged>` ::
493 OS type. This is used to setup configuration inside the container, and corresponds to lxc setup scripts in /usr/share/lxc/config/<ostype>.common.conf. Value 'unmanaged' can be used to skip and OS specific setup.
497 Sets root password inside container.
499 `--pool` `<string>` ::
501 Add the VM to the specified pool.
503 `--protection` `<boolean>` ('default =' `0`)::
505 Sets the protection flag of the container. This will prevent the CT or CT's disk remove/update operation.
507 `--rootfs` `[volume=]<volume> [,acl=<1|0>] [,quota=<1|0>] [,replicate=<1|0>] [,ro=<1|0>] [,shared=<1|0>] [,size=<DiskSize>]` ::
509 Use volume as container root.
511 `--searchdomain` `<string>` ::
513 Sets DNS search domains for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.
515 `--ssh-public-keys` `<filepath>` ::
517 Setup public SSH keys (one key per line, OpenSSH format).
519 `--startup` `[[order=]\d+] [,up=\d+] [,down=\d+] ` ::
521 Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the 'up' or 'down' delay in seconds, which specifies a delay to wait before the next VM is started or stopped.
523 `--storage` `<string>` ('default =' `local`)::
527 `--swap` `<integer> (0 - N)` ('default =' `512`)::
529 Amount of SWAP for the VM in MB.
531 `--template` `<boolean>` ('default =' `0`)::
533 Enable/disable Template.
535 `--tty` `<integer> (0 - 6)` ('default =' `2`)::
537 Specify the number of tty available to the container
539 `--unprivileged` `<boolean>` ('default =' `0`)::
541 Makes the container run as unprivileged user. (Should not be modified manually.)
543 `--unused[n]` `<string>` ::
545 Reference to unused volumes. This is used internally, and should not be modified manually.
547 *pct resume* `<vmid>`
549 Resume the container.
551 `<vmid>`: `<integer> (1 - N)` ::
553 The (unique) ID of the VM.
555 *pct rollback* `<vmid> <snapname>`
557 Rollback LXC state to specified snapshot.
559 `<vmid>`: `<integer> (1 - N)` ::
561 The (unique) ID of the VM.
563 `<snapname>`: `<string>` ::
565 The name of the snapshot.
567 *pct set* `<vmid>` `[OPTIONS]`
569 Set container options.
571 `<vmid>`: `<integer> (1 - N)` ::
573 The (unique) ID of the VM.
575 `--arch` `<amd64 | i386>` ('default =' `amd64`)::
577 OS architecture type.
579 `--cmode` `<console | shell | tty>` ('default =' `tty`)::
581 Console mode. By default, the console command tries to open a connection to one of the available tty devices. By setting cmode to 'console' it tries to attach to /dev/console instead. If you set cmode to 'shell', it simply invokes a shell inside the container (no login).
583 `--console` `<boolean>` ('default =' `1`)::
585 Attach a console device (/dev/console) to the container.
587 `--cores` `<integer> (1 - 128)` ::
589 The number of cores assigned to the container. A container can use all available cores by default.
591 `--cpulimit` `<number> (0 - 128)` ('default =' `0`)::
595 NOTE: If the computer has 2 CPUs, it has a total of '2' CPU time. Value '0' indicates no CPU limit.
597 `--cpuunits` `<integer> (0 - 500000)` ('default =' `1024`)::
599 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 the weights of all the other running VMs.
601 NOTE: You can disable fair-scheduler configuration by setting this to 0.
603 `--delete` `<string>` ::
605 A list of settings you want to delete.
607 `--description` `<string>` ::
609 Container description. Only used on the configuration web interface.
611 `--digest` `<string>` ::
613 Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications.
615 `--hostname` `<string>` ::
617 Set a host name for the container.
619 `--lock` `<backup | migrate | rollback | snapshot>` ::
623 `--memory` `<integer> (16 - N)` ('default =' `512`)::
625 Amount of RAM for the VM in MB.
627 `--mp[n]` `[volume=]<volume> ,mp=<Path> [,acl=<1|0>] [,backup=<1|0>] [,quota=<1|0>] [,replicate=<1|0>] [,ro=<1|0>] [,shared=<1|0>] [,size=<DiskSize>]` ::
629 Use volume as container mount point.
631 `--nameserver` `<string>` ::
633 Sets DNS server IP address for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.
635 `--net[n]` `name=<string> [,bridge=<bridge>] [,firewall=<1|0>] [,gw=<GatewayIPv4>] [,gw6=<GatewayIPv6>] [,hwaddr=<XX:XX:XX:XX:XX:XX>] [,ip=<(IPv4/CIDR|dhcp|manual)>] [,ip6=<(IPv6/CIDR|auto|dhcp|manual)>] [,mtu=<integer>] [,rate=<mbps>] [,tag=<integer>] [,trunks=<vlanid[;vlanid...]>] [,type=<veth>]` ::
637 Specifies network interfaces for the container.
639 `--onboot` `<boolean>` ('default =' `0`)::
641 Specifies whether a VM will be started during system bootup.
643 `--ostype` `<alpine | archlinux | centos | debian | fedora | gentoo | opensuse | ubuntu | unmanaged>` ::
645 OS type. This is used to setup configuration inside the container, and corresponds to lxc setup scripts in /usr/share/lxc/config/<ostype>.common.conf. Value 'unmanaged' can be used to skip and OS specific setup.
647 `--protection` `<boolean>` ('default =' `0`)::
649 Sets the protection flag of the container. This will prevent the CT or CT's disk remove/update operation.
651 `--rootfs` `[volume=]<volume> [,acl=<1|0>] [,quota=<1|0>] [,replicate=<1|0>] [,ro=<1|0>] [,shared=<1|0>] [,size=<DiskSize>]` ::
653 Use volume as container root.
655 `--searchdomain` `<string>` ::
657 Sets DNS search domains for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.
659 `--startup` `[[order=]\d+] [,up=\d+] [,down=\d+] ` ::
661 Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the 'up' or 'down' delay in seconds, which specifies a delay to wait before the next VM is started or stopped.
663 `--swap` `<integer> (0 - N)` ('default =' `512`)::
665 Amount of SWAP for the VM in MB.
667 `--template` `<boolean>` ('default =' `0`)::
669 Enable/disable Template.
671 `--tty` `<integer> (0 - 6)` ('default =' `2`)::
673 Specify the number of tty available to the container
675 `--unprivileged` `<boolean>` ('default =' `0`)::
677 Makes the container run as unprivileged user. (Should not be modified manually.)
679 `--unused[n]` `<string>` ::
681 Reference to unused volumes. This is used internally, and should not be modified manually.
683 *pct shutdown* `<vmid>` `[OPTIONS]`
685 Shutdown the container. This will trigger a clean shutdown of the
686 container, see lxc-stop(1) for details.
688 `<vmid>`: `<integer> (1 - N)` ::
690 The (unique) ID of the VM.
692 `--forceStop` `<boolean>` ('default =' `0`)::
694 Make sure the Container stops.
696 `--timeout` `<integer> (0 - N)` ('default =' `60`)::
698 Wait maximal timeout seconds.
700 *pct snapshot* `<vmid> <snapname>` `[OPTIONS]`
702 Snapshot a container.
704 `<vmid>`: `<integer> (1 - N)` ::
706 The (unique) ID of the VM.
708 `<snapname>`: `<string>` ::
710 The name of the snapshot.
712 `--description` `<string>` ::
714 A textual description or comment.
716 *pct start* `<vmid>` `[OPTIONS]`
720 `<vmid>`: `<integer> (1 - N)` ::
722 The (unique) ID of the VM.
724 `--skiplock` `<boolean>` ::
726 Ignore locks - only root is allowed to use this option.
728 *pct status* `<vmid>` `[OPTIONS]`
732 `<vmid>`: `<integer> (1 - N)` ::
734 The (unique) ID of the VM.
736 `--verbose` `<boolean>` ::
738 Verbose output format
740 *pct stop* `<vmid>` `[OPTIONS]`
742 Stop the container. This will abruptly stop all processes running in the
745 `<vmid>`: `<integer> (1 - N)` ::
747 The (unique) ID of the VM.
749 `--skiplock` `<boolean>` ::
751 Ignore locks - only root is allowed to use this option.
753 *pct suspend* `<vmid>`
755 Suspend the container.
757 `<vmid>`: `<integer> (1 - N)` ::
759 The (unique) ID of the VM.
761 *pct template* `<vmid> --experimental <boolean>` `[OPTIONS]`
765 `<vmid>`: `<integer> (1 - N)` ::
767 The (unique) ID of the VM.
769 `--experimental` `<boolean>` ('default =' `0`)::
771 The template feature is experimental, set this flag if you know what you are doing.
773 *pct unlock* `<vmid>`
777 `<vmid>`: `<integer> (1 - N)` ::
779 The (unique) ID of the VM.
781 *pct unmount* `<vmid>`
783 Unmount the container's filesystem.
785 `<vmid>`: `<integer> (1 - N)` ::
787 The (unique) ID of the VM.