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.
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`
50 Get container configuration.
52 `<vmid>` `integer (1 - N)` ::
54 The (unique) ID of the VM.
59 *pct console* `<vmid>`
61 Launch a console for the specified container.
63 `<vmid>` `integer (1 - N)` ::
65 The (unique) ID of the VM.
70 *pct create* `<vmid> <ostemplate>` `[OPTIONS]`
72 Create or restore a container.
74 `<vmid>` `integer (1 - N)` ::
76 The (unique) ID of the VM.
78 `<ostemplate>` `string` ::
80 The OS template or backup file.
82 `-arch` `(amd64 | i386)` (default=`amd64`)::
86 `-cmode` `(console | shell | tty)` (default=`tty`)::
88 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).
90 `-console` `boolean` (default=`1`)::
92 Attach a console device (/dev/console) to the container.
94 `-cpulimit` `number (0 - 128)` (default=`0`)::
98 NOTE: If the computer has 2 CPUs, it has a total of '2' CPU time. Value '0' indicates no CPU limit.
100 `-cpuunits` `integer (0 - 500000)` (default=`1024`)::
102 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.
104 NOTE: You can disable fair-scheduler configuration by setting this to 0.
106 `-description` `string` ::
108 Container description. Only used on the configuration web interface.
110 `-force` `boolean` ::
112 Allow to overwrite existing container.
114 `-hostname` `string` ::
116 Set a host name for the container.
118 `-ignore-unpack-errors` `boolean` ::
120 Ignore errors when extracting the template.
122 `-lock` `(backup | migrate | rollback | snapshot)` ::
126 `-memory` `integer (16 - N)` (default=`512`)::
128 Amount of RAM for the VM in MB.
130 `-mp[n]` `[volume=]<volume> ,mp=<Path> [,acl=<1|0>] [,backup=<1|0>] [,quota=<1|0>] [,ro=<1|0>] [,size=<DiskSize>]` ::
132 Use volume as container mount point.
134 `-nameserver` `string` ::
136 Sets DNS server IP address for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.
138 `-net[n]` `name=<string> [,bridge=<bridge>] [,firewall=<1|0>] [,gw=<GatewayIPv4>] [,gw6=<GatewayIPv6>] [,hwaddr=<XX:XX:XX:XX:XX:XX>] [,ip=<IPv4Format/CIDR>] [,ip6=<IPv6Format/CIDR>] [,mtu=<integer>] [,rate=<mbps>] [,tag=<integer>] [,trunks=<vlanid[;vlanid...]>] [,type=<veth>]` ::
140 Specifies network interfaces for the container.
142 `-onboot` `boolean` (default=`0`)::
144 Specifies whether a VM will be started during system bootup.
146 `-ostype` `(alpine | archlinux | centos | debian | fedora | gentoo | opensuse | ubuntu | unmanaged)` ::
148 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.
152 Sets root password inside container.
156 Add the VM to the specified pool.
158 `-protection` `boolean` (default=`0`)::
160 Sets the protection flag of the container. This will prevent the CT or CT's disk remove/update operation.
162 `-restore` `boolean` ::
164 Mark this as restore task.
166 `-rootfs` `[volume=]<volume> [,acl=<1|0>] [,quota=<1|0>] [,ro=<1|0>] [,size=<DiskSize>]` ::
168 Use volume as container root.
170 `-searchdomain` `string` ::
172 Sets DNS search domains for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.
174 `-ssh-public-keys` `filepath` ::
176 Setup public SSH keys (one key per line, OpenSSH format).
178 `-startup` `[[order=]\d+] [,up=\d+] [,down=\d+] ` ::
180 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.
182 `-storage` `string` (default=`local`)::
186 `-swap` `integer (0 - N)` (default=`512`)::
188 Amount of SWAP for the VM in MB.
190 `-template` `boolean` (default=`0`)::
192 Enable/disable Template.
194 `-tty` `integer (0 - 6)` (default=`2`)::
196 Specify the number of tty available to the container
198 `-unprivileged` `boolean` (default=`0`)::
200 Makes the container run as unprivileged user. (Should not be modified manually.)
202 `-unused[n]` `string` ::
204 Reference to unused volumes. This is used internally, and should not be modified manually.
209 *pct delsnapshot* `<vmid> <snapname>` `[OPTIONS]`
211 Delete a LXC snapshot.
213 `<vmid>` `integer (1 - N)` ::
215 The (unique) ID of the VM.
217 `<snapname>` `string` ::
219 The name of the snapshot.
221 `-force` `boolean` ::
223 For removal from config file, even if removing disk snapshots fails.
228 *pct destroy* `<vmid>`
230 Destroy the container (also delete all uses files).
232 `<vmid>` `integer (1 - N)` ::
234 The (unique) ID of the VM.
241 Launch a shell for the specified container.
243 `<vmid>` `integer (1 - N)` ::
245 The (unique) ID of the VM.
249 *pct exec* `<vmid> [<extra-args>]`
251 Launch a command inside the specified container.
253 `<vmid>` `integer (1 - N)` ::
255 The (unique) ID of the VM.
257 `<extra-args>` `array` ::
259 Extra arguments as array
263 *pct fsck* `<vmid>` `[OPTIONS]`
265 Run a filesystem check (fsck) on a container volume.
267 `<vmid>` `integer (1 - N)` ::
269 The (unique) ID of the VM.
271 `-device` `(mp0 | mp1 | mp2 | mp3 | mp4 | mp5 | mp6 | mp7 | mp8 | mp9 | rootfs)` ::
273 A volume on which to run the filesystem check
275 `-force` `boolean` (default=`0`)::
277 Force checking, even if the filesystem seems clean
282 *pct help* `[<cmd>]` `[OPTIONS]`
284 Get help about specified command.
290 `-verbose` `boolean` ::
292 Verbose output format.
299 LXC container index (per node).
304 *pct listsnapshot* `<vmid>`
308 `<vmid>` `integer (1 - N)` ::
310 The (unique) ID of the VM.
315 *pct migrate* `<vmid> <target>` `[OPTIONS]`
317 Migrate the container to another node. Creates a new migration task.
319 `<vmid>` `integer (1 - N)` ::
321 The (unique) ID of the VM.
323 `<target>` `string` ::
327 `-force` `boolean` ::
329 Force migration despite local bind / device mounts. WARNING: identical bind / device mounts need to be available on the target node.
331 `-online` `boolean` ::
333 Use online/live migration.
340 Mount the container's filesystem on the host. This will hold a lock on the
341 container and is meant for emergency maintenance only as it will prevent
342 further operations on the container other than start and stop.
344 `<vmid>` `integer (1 - N)` ::
346 The (unique) ID of the VM.
350 *pct pull* `<vmid> <path> <destination>` `[OPTIONS]`
352 Copy a file from the container to the local system.
354 `<vmid>` `integer (1 - N)` ::
356 The (unique) ID of the VM.
360 Path to a file inside the container to pull.
362 `<destination>` `string` ::
368 Owner group name or id.
372 File permissions to use (octal by default, prefix with '0x' for hexadecimal).
376 Owner user name or id.
380 *pct push* `<vmid> <file> <destination>` `[OPTIONS]`
382 Copy a local file to the container.
384 `<vmid>` `integer (1 - N)` ::
386 The (unique) ID of the VM.
390 Path to a local file.
392 `<destination>` `string` ::
394 Destination inside the container to write to.
398 Owner group name or id. When using a name it must exist inside the container.
402 File permissions to use (octal by default, prefix with '0x' for hexadecimal).
406 Owner user name or id. When using a name it must exist inside the container.
411 *pct resize* `<vmid> <disk> <size>` `[OPTIONS]`
413 Resize a container mountpoint.
415 `<vmid>` `integer (1 - N)` ::
417 The (unique) ID of the VM.
419 `<disk>` `(mp0 | mp1 | mp2 | mp3 | mp4 | mp5 | mp6 | mp7 | mp8 | mp9 | rootfs)` ::
421 The disk you want to resize.
423 `<size>` `\+?\d+(\.\d+)?[KMGT]?` ::
425 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.
427 `-digest` `string` ::
429 Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications.
433 *pct restore* `<vmid> <ostemplate>` `[OPTIONS]`
435 Create or restore a container.
437 `<vmid>` `integer (1 - N)` ::
439 The (unique) ID of the VM.
441 `<ostemplate>` `string` ::
443 The OS template or backup file.
445 `-arch` `(amd64 | i386)` (default=`amd64`)::
447 OS architecture type.
449 `-cmode` `(console | shell | tty)` (default=`tty`)::
451 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).
453 `-console` `boolean` (default=`1`)::
455 Attach a console device (/dev/console) to the container.
457 `-cpulimit` `number (0 - 128)` (default=`0`)::
461 NOTE: If the computer has 2 CPUs, it has a total of '2' CPU time. Value '0' indicates no CPU limit.
463 `-cpuunits` `integer (0 - 500000)` (default=`1024`)::
465 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.
467 NOTE: You can disable fair-scheduler configuration by setting this to 0.
469 `-description` `string` ::
471 Container description. Only used on the configuration web interface.
473 `-force` `boolean` ::
475 Allow to overwrite existing container.
477 `-hostname` `string` ::
479 Set a host name for the container.
481 `-ignore-unpack-errors` `boolean` ::
483 Ignore errors when extracting the template.
485 `-lock` `(backup | migrate | rollback | snapshot)` ::
489 `-memory` `integer (16 - N)` (default=`512`)::
491 Amount of RAM for the VM in MB.
493 `-mp[n]` `[volume=]<volume> ,mp=<Path> [,acl=<1|0>] [,backup=<1|0>] [,quota=<1|0>] [,ro=<1|0>] [,size=<DiskSize>]` ::
495 Use volume as container mount point.
497 `-nameserver` `string` ::
499 Sets DNS server IP address for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.
501 `-net[n]` `name=<string> [,bridge=<bridge>] [,firewall=<1|0>] [,gw=<GatewayIPv4>] [,gw6=<GatewayIPv6>] [,hwaddr=<XX:XX:XX:XX:XX:XX>] [,ip=<IPv4Format/CIDR>] [,ip6=<IPv6Format/CIDR>] [,mtu=<integer>] [,rate=<mbps>] [,tag=<integer>] [,trunks=<vlanid[;vlanid...]>] [,type=<veth>]` ::
503 Specifies network interfaces for the container.
505 `-onboot` `boolean` (default=`0`)::
507 Specifies whether a VM will be started during system bootup.
509 `-ostype` `(alpine | archlinux | centos | debian | fedora | gentoo | opensuse | ubuntu | unmanaged)` ::
511 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.
515 Sets root password inside container.
519 Add the VM to the specified pool.
521 `-protection` `boolean` (default=`0`)::
523 Sets the protection flag of the container. This will prevent the CT or CT's disk remove/update operation.
525 `-rootfs` `[volume=]<volume> [,acl=<1|0>] [,quota=<1|0>] [,ro=<1|0>] [,size=<DiskSize>]` ::
527 Use volume as container root.
529 `-searchdomain` `string` ::
531 Sets DNS search domains for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.
533 `-ssh-public-keys` `filepath` ::
535 Setup public SSH keys (one key per line, OpenSSH format).
537 `-startup` `[[order=]\d+] [,up=\d+] [,down=\d+] ` ::
539 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.
541 `-storage` `string` (default=`local`)::
545 `-swap` `integer (0 - N)` (default=`512`)::
547 Amount of SWAP for the VM in MB.
549 `-template` `boolean` (default=`0`)::
551 Enable/disable Template.
553 `-tty` `integer (0 - 6)` (default=`2`)::
555 Specify the number of tty available to the container
557 `-unprivileged` `boolean` (default=`0`)::
559 Makes the container run as unprivileged user. (Should not be modified manually.)
561 `-unused[n]` `string` ::
563 Reference to unused volumes. This is used internally, and should not be modified manually.
568 *pct resume* `<vmid>`
570 Resume the container.
572 `<vmid>` `integer (1 - N)` ::
574 The (unique) ID of the VM.
579 *pct rollback* `<vmid> <snapname>`
581 Rollback LXC state to specified snapshot.
583 `<vmid>` `integer (1 - N)` ::
585 The (unique) ID of the VM.
587 `<snapname>` `string` ::
589 The name of the snapshot.
594 *pct set* `<vmid>` `[OPTIONS]`
596 Set container options.
598 `<vmid>` `integer (1 - N)` ::
600 The (unique) ID of the VM.
602 `-arch` `(amd64 | i386)` (default=`amd64`)::
604 OS architecture type.
606 `-cmode` `(console | shell | tty)` (default=`tty`)::
608 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).
610 `-console` `boolean` (default=`1`)::
612 Attach a console device (/dev/console) to the container.
614 `-cpulimit` `number (0 - 128)` (default=`0`)::
618 NOTE: If the computer has 2 CPUs, it has a total of '2' CPU time. Value '0' indicates no CPU limit.
620 `-cpuunits` `integer (0 - 500000)` (default=`1024`)::
622 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.
624 NOTE: You can disable fair-scheduler configuration by setting this to 0.
626 `-delete` `string` ::
628 A list of settings you want to delete.
630 `-description` `string` ::
632 Container description. Only used on the configuration web interface.
634 `-digest` `string` ::
636 Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications.
638 `-hostname` `string` ::
640 Set a host name for the container.
642 `-lock` `(backup | migrate | rollback | snapshot)` ::
646 `-memory` `integer (16 - N)` (default=`512`)::
648 Amount of RAM for the VM in MB.
650 `-mp[n]` `[volume=]<volume> ,mp=<Path> [,acl=<1|0>] [,backup=<1|0>] [,quota=<1|0>] [,ro=<1|0>] [,size=<DiskSize>]` ::
652 Use volume as container mount point.
654 `-nameserver` `string` ::
656 Sets DNS server IP address for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.
658 `-net[n]` `name=<string> [,bridge=<bridge>] [,firewall=<1|0>] [,gw=<GatewayIPv4>] [,gw6=<GatewayIPv6>] [,hwaddr=<XX:XX:XX:XX:XX:XX>] [,ip=<IPv4Format/CIDR>] [,ip6=<IPv6Format/CIDR>] [,mtu=<integer>] [,rate=<mbps>] [,tag=<integer>] [,trunks=<vlanid[;vlanid...]>] [,type=<veth>]` ::
660 Specifies network interfaces for the container.
662 `-onboot` `boolean` (default=`0`)::
664 Specifies whether a VM will be started during system bootup.
666 `-ostype` `(alpine | archlinux | centos | debian | fedora | gentoo | opensuse | ubuntu | unmanaged)` ::
668 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.
670 `-protection` `boolean` (default=`0`)::
672 Sets the protection flag of the container. This will prevent the CT or CT's disk remove/update operation.
674 `-rootfs` `[volume=]<volume> [,acl=<1|0>] [,quota=<1|0>] [,ro=<1|0>] [,size=<DiskSize>]` ::
676 Use volume as container root.
678 `-searchdomain` `string` ::
680 Sets DNS search domains for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.
682 `-startup` `[[order=]\d+] [,up=\d+] [,down=\d+] ` ::
684 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.
686 `-swap` `integer (0 - N)` (default=`512`)::
688 Amount of SWAP for the VM in MB.
690 `-template` `boolean` (default=`0`)::
692 Enable/disable Template.
694 `-tty` `integer (0 - 6)` (default=`2`)::
696 Specify the number of tty available to the container
698 `-unprivileged` `boolean` (default=`0`)::
700 Makes the container run as unprivileged user. (Should not be modified manually.)
702 `-unused[n]` `string` ::
704 Reference to unused volumes. This is used internally, and should not be modified manually.
709 *pct shutdown* `<vmid>` `[OPTIONS]`
711 Shutdown the container. This will trigger a clean shutdown of the
712 container, see lxc-stop(1) for details.
714 `<vmid>` `integer (1 - N)` ::
716 The (unique) ID of the VM.
718 `-forceStop` `boolean` (default=`0`)::
720 Make sure the Container stops.
722 `-timeout` `integer (0 - N)` (default=`60`)::
724 Wait maximal timeout seconds.
729 *pct snapshot* `<vmid> <snapname>` `[OPTIONS]`
731 Snapshot a container.
733 `<vmid>` `integer (1 - N)` ::
735 The (unique) ID of the VM.
737 `<snapname>` `string` ::
739 The name of the snapshot.
741 `-description` `string` ::
743 A textual description or comment.
748 *pct start* `<vmid>` `[OPTIONS]`
752 `<vmid>` `integer (1 - N)` ::
754 The (unique) ID of the VM.
756 `-skiplock` `boolean` ::
758 Ignore locks - only root is allowed to use this option.
762 *pct stop* `<vmid>` `[OPTIONS]`
764 Stop the container. This will abruptly stop all processes running in the
767 `<vmid>` `integer (1 - N)` ::
769 The (unique) ID of the VM.
771 `-skiplock` `boolean` ::
773 Ignore locks - only root is allowed to use this option.
777 *pct suspend* `<vmid>`
779 Suspend the container.
781 `<vmid>` `integer (1 - N)` ::
783 The (unique) ID of the VM.
788 *pct template* `<vmid> -experimental <boolean>` `[OPTIONS]`
792 `<vmid>` `integer (1 - N)` ::
794 The (unique) ID of the VM.
796 `-experimental` `boolean` (default=`0`)::
798 The template feature is experimental, set this flag if you know what you are doing.
803 *pct unlock* `<vmid>`
807 `<vmid>` `integer (1 - N)` ::
809 The (unique) ID of the VM.
813 *pct unmount* `<vmid>`
815 Unmount the container's filesystem.
817 `<vmid>` `integer (1 - N)` ::
819 The (unique) ID of the VM.