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
24 `-full` `boolean` (default=`0`)::
26 Create a full copy of all disk. This is always done when you clone a normal
27 CT. For CT templates, we try to create a linked clone by default.
29 `-hostname` `string` ::
31 Set a hostname for the new CT.
35 Add the new CT to the specified pool.
37 `-snapname` `string` ::
39 The name of the snapshot.
41 `-storage` `string` ::
43 Target storage for full clone.
45 NOTE: Requires option(s): `full`
52 Get container configuration.
54 `<vmid>` `integer (1 - N)` ::
56 The (unique) ID of the VM.
61 *pct console* `<vmid>`
63 Launch a console for the specified container.
65 `<vmid>` `integer (1 - N)` ::
67 The (unique) ID of the VM.
72 *pct create* `<vmid> <ostemplate>` `[OPTIONS]`
74 Create or restore a container.
76 `<vmid>` `integer (1 - N)` ::
78 The (unique) ID of the VM.
80 `<ostemplate>` `string` ::
82 The OS template or backup file.
84 `-arch` `(amd64 | i386)` (default=`amd64`)::
88 `-cmode` `(console | shell | tty)` (default=`tty`)::
90 Console mode. By default, the console command tries to open a connection to
91 one of the available tty devices. By setting cmode to 'console' it tries to
92 attach to /dev/console instead. If you set cmode to 'shell', it simply
93 invokes a shell inside the container (no login).
95 `-console` `boolean` (default=`1`)::
97 Attach a console device (/dev/console) to the container.
99 `-cpulimit` `number (0 - 128)` (default=`0`)::
103 NOTE: If the computer has 2 CPUs, it has a total of '2' CPU time. Value '0'
104 indicates no CPU limit.
106 `-cpuunits` `integer (0 - 500000)` (default=`1024`)::
108 CPU weight for a VM. Argument is used in the kernel fair scheduler. The
109 larger the number is, the more CPU time this VM gets. Number is relative to
110 the weights of all the other running VMs.
112 NOTE: You can disable fair-scheduler configuration by setting this to 0.
114 `-description` `string` ::
116 Container description. Only used on the configuration web interface.
118 `-force` `boolean` ::
120 Allow to overwrite existing container.
122 `-hostname` `string` ::
124 Set a host name for the container.
126 `-ignore-unpack-errors` `boolean` ::
128 Ignore errors when extracting the template.
130 `-lock` `(backup | migrate | rollback | snapshot)` ::
134 `-memory` `integer (16 - N)` (default=`512`)::
136 Amount of RAM for the VM in MB.
138 `-mp[n]` `mp=<Path>, [volume=]<volume> [,acl=<acl>] [,backup=<[1|0]>] [,quota=<[0|1]>] [,ro=<ro>] [,size=<DiskSize>]` ::
140 Use volume as container mount point (experimental feature).
142 `-nameserver` `string` ::
144 Sets DNS server IP address for a container. Create will automatically use
145 the setting from the host if you neither set searchdomain nor nameserver.
147 `-net[n]` `name=<String> [,bridge=<vmbr<Number>>] [,firewall=<[1|0]>] [,gw=<GatewayIPv4>] [,gw6=<GatewayIPv6>] [,hwaddr=<MAC>] [,ip=<IPv4Format/CIDR>] [,ip6=<IPv6Format/CIDR>] [,mtu=<Number>] [,rate=<mbps>] [,tag=<VlanNo>] [,trunks=<vlanid[;vlanid...]>] [,type=<veth>]` ::
149 Specifies network interfaces for the container.
151 `-onboot` `boolean` (default=`0`)::
153 Specifies whether a VM will be started during system bootup.
155 `-ostype` `(alpine | archlinux | centos | debian | fedora | opensuse | ubuntu | unmanaged)` ::
157 OS type. This is used to setup configuration inside the container, and
158 corresponds to lxc setup scripts in
159 /usr/share/lxc/config/<ostype>.common.conf. Value 'unmanaged' can be used
160 to skip and OS specific setup.
164 Sets root password inside container.
168 Add the VM to the specified pool.
170 `-protection` `boolean` (default=`0`)::
172 Sets the protection flag of the container. This will prevent the CT or CT's
173 disk remove/update operation.
175 `-restore` `boolean` ::
177 Mark this as restore task.
179 `-rootfs` `[volume=]<volume> [,acl=<acl>] [,backup=<[1|0]>] [,quota=<[0|1]>] [,ro=<ro>] [,size=<DiskSize>]` ::
181 Use volume as container root.
183 `-searchdomain` `string` ::
185 Sets DNS search domains for a container. Create will automatically use the
186 setting from the host if you neither set searchdomain nor nameserver.
188 `-ssh-public-keys` `filepath` ::
190 Setup public SSH keys (one key per line, OpenSSH format).
192 `-startup` `[[order=]\d+] [,up=\d+] [,down=\d+] ` ::
194 Startup and shutdown behavior. Order is a non-negative number defining the
195 general startup order. Shutdown in done with reverse ordering. Additionally
196 you can set the 'up' or 'down' delay in seconds, which specifies a delay to
197 wait before the next VM is started or stopped.
199 `-storage` `string` (default=`local`)::
203 `-swap` `integer (0 - N)` (default=`512`)::
205 Amount of SWAP for the VM in MB.
207 `-template` `boolean` (default=`0`)::
209 Enable/disable Template.
211 `-tty` `integer (0 - 6)` (default=`2`)::
213 Specify the number of tty available to the container
215 `-unprivileged` `boolean` (default=`0`)::
217 Makes the container run as unprivileged user. (Should not be modified
220 `-unused[n]` `string` ::
222 Reference to unused volumes.
227 *pct delsnapshot* `<vmid> <snapname>` `[OPTIONS]`
229 Delete a LXC snapshot.
231 `<vmid>` `integer (1 - N)` ::
233 The (unique) ID of the VM.
235 `<snapname>` `string` ::
237 The name of the snapshot.
239 `-force` `boolean` ::
241 For removal from config file, even if removing disk snapshots fails.
246 *pct destroy* `<vmid>`
248 Destroy the container (also delete all uses files).
250 `<vmid>` `integer (1 - N)` ::
252 The (unique) ID of the VM.
259 Launch a shell for the specified container.
261 `<vmid>` `integer (1 - N)` ::
263 The (unique) ID of the VM.
267 *pct exec* `<vmid> [<extra-args>]`
269 Launch a command inside the specified container.
271 `<vmid>` `integer (1 - N)` ::
273 The (unique) ID of the VM.
275 `<extra-args>` `array` ::
277 Extra arguments as array
281 *pct fsck* `<vmid>` `[OPTIONS]`
283 Run a filesystem check (fsck) on a container volume.
285 `<vmid>` `integer (1 - N)` ::
287 The (unique) ID of the VM.
289 `-device` `(mp0 | mp1 | mp2 | mp3 | mp4 | mp5 | mp6 | mp7 | mp8 | mp9 | rootfs)` ::
291 A volume on which to run the filesystem check
293 `-force` `boolean` (default=`0`)::
295 Force checking, even if the filesystem seems clean
300 *pct help* `[<cmd>]` `[OPTIONS]`
302 Get help about specified command.
308 `-verbose` `boolean` ::
310 Verbose output format.
317 LXC container index (per node).
322 *pct listsnapshot* `<vmid>`
326 `<vmid>` `integer (1 - N)` ::
328 The (unique) ID of the VM.
333 *pct migrate* `<vmid> <target>` `[OPTIONS]`
335 Migrate the container to another node. Creates a new migration task.
337 `<vmid>` `integer (1 - N)` ::
339 The (unique) ID of the VM.
341 `<target>` `string` ::
345 `-force` `boolean` ::
347 Force migration despite local bind / device mounts. WARNING: identical bind
348 / device mounts need to be available on the target node.
350 `-online` `boolean` ::
352 Use online/live migration.
359 Mount the container's filesystem on the host. This will hold a lock on the
360 container and is meant for emergency maintenance only as it will prevent
361 further operations on the container other than start and stop.
363 `<vmid>` `integer (1 - N)` ::
365 The (unique) ID of the VM.
369 *pct pull* `<vmid> <path> <destination>` `[OPTIONS]`
371 Copy a file from the container to the local system.
373 `<vmid>` `integer (1 - N)` ::
375 The (unique) ID of the VM.
379 Path to a file inside the container to pull.
381 `<destination>` `string` ::
387 Owner group name or id.
391 File permissions to use (octal by default, prefix with '0x' for
396 Owner user name or id.
400 *pct push* `<vmid> <file> <destination>` `[OPTIONS]`
402 Copy a local file to the container.
404 `<vmid>` `integer (1 - N)` ::
406 The (unique) ID of the VM.
410 Path to a local file.
412 `<destination>` `string` ::
414 Destination inside the container to write to.
418 Owner group name or id. When using a name it must exist inside the
423 File permissions to use (octal by default, prefix with '0x' for
428 Owner user name or id. When using a name it must exist inside the
434 *pct resize* `<vmid> <disk> <size>` `[OPTIONS]`
436 Resize a container mountpoint.
438 `<vmid>` `integer (1 - N)` ::
440 The (unique) ID of the VM.
442 `<disk>` `(mp0 | mp1 | mp2 | mp3 | mp4 | mp5 | mp6 | mp7 | mp8 | mp9 | rootfs)` ::
444 The disk you want to resize.
446 `<size>` `\+?\d+(\.\d+)?[KMGT]?` ::
448 The new size. With the '+' sign the value is added to the actual size of
449 the volume and without it, the value is taken as an absolute one. Shrinking
450 disk size is not supported.
452 `-digest` `string` ::
454 Prevent changes if current configuration file has different SHA1 digest.
455 This can be used to prevent concurrent modifications.
459 *pct restore* `<vmid> <ostemplate>` `[OPTIONS]`
461 Create or restore a container.
463 `<vmid>` `integer (1 - N)` ::
465 The (unique) ID of the VM.
467 `<ostemplate>` `string` ::
469 The OS template or backup file.
471 `-arch` `(amd64 | i386)` (default=`amd64`)::
473 OS architecture type.
475 `-cmode` `(console | shell | tty)` (default=`tty`)::
477 Console mode. By default, the console command tries to open a connection to
478 one of the available tty devices. By setting cmode to 'console' it tries to
479 attach to /dev/console instead. If you set cmode to 'shell', it simply
480 invokes a shell inside the container (no login).
482 `-console` `boolean` (default=`1`)::
484 Attach a console device (/dev/console) to the container.
486 `-cpulimit` `number (0 - 128)` (default=`0`)::
490 NOTE: If the computer has 2 CPUs, it has a total of '2' CPU time. Value '0'
491 indicates no CPU limit.
493 `-cpuunits` `integer (0 - 500000)` (default=`1024`)::
495 CPU weight for a VM. Argument is used in the kernel fair scheduler. The
496 larger the number is, the more CPU time this VM gets. Number is relative to
497 the weights of all the other running VMs.
499 NOTE: You can disable fair-scheduler configuration by setting this to 0.
501 `-description` `string` ::
503 Container description. Only used on the configuration web interface.
505 `-force` `boolean` ::
507 Allow to overwrite existing container.
509 `-hostname` `string` ::
511 Set a host name for the container.
513 `-ignore-unpack-errors` `boolean` ::
515 Ignore errors when extracting the template.
517 `-lock` `(backup | migrate | rollback | snapshot)` ::
521 `-memory` `integer (16 - N)` (default=`512`)::
523 Amount of RAM for the VM in MB.
525 `-mp[n]` `mp=<Path>, [volume=]<volume> [,acl=<acl>] [,backup=<[1|0]>] [,quota=<[0|1]>] [,ro=<ro>] [,size=<DiskSize>]` ::
527 Use volume as container mount point (experimental feature).
529 `-nameserver` `string` ::
531 Sets DNS server IP address for a container. Create will automatically use
532 the setting from the host if you neither set searchdomain nor nameserver.
534 `-net[n]` `name=<String> [,bridge=<vmbr<Number>>] [,firewall=<[1|0]>] [,gw=<GatewayIPv4>] [,gw6=<GatewayIPv6>] [,hwaddr=<MAC>] [,ip=<IPv4Format/CIDR>] [,ip6=<IPv6Format/CIDR>] [,mtu=<Number>] [,rate=<mbps>] [,tag=<VlanNo>] [,trunks=<vlanid[;vlanid...]>] [,type=<veth>]` ::
536 Specifies network interfaces for the container.
538 `-onboot` `boolean` (default=`0`)::
540 Specifies whether a VM will be started during system bootup.
542 `-ostype` `(alpine | archlinux | centos | debian | fedora | opensuse | ubuntu | unmanaged)` ::
544 OS type. This is used to setup configuration inside the container, and
545 corresponds to lxc setup scripts in
546 /usr/share/lxc/config/<ostype>.common.conf. Value 'unmanaged' can be used
547 to skip and OS specific setup.
551 Sets root password inside container.
555 Add the VM to the specified pool.
557 `-protection` `boolean` (default=`0`)::
559 Sets the protection flag of the container. This will prevent the CT or CT's
560 disk remove/update operation.
562 `-rootfs` `[volume=]<volume> [,acl=<acl>] [,backup=<[1|0]>] [,quota=<[0|1]>] [,ro=<ro>] [,size=<DiskSize>]` ::
564 Use volume as container root.
566 `-searchdomain` `string` ::
568 Sets DNS search domains for a container. Create will automatically use the
569 setting from the host if you neither set searchdomain nor nameserver.
571 `-ssh-public-keys` `filepath` ::
573 Setup public SSH keys (one key per line, OpenSSH format).
575 `-startup` `[[order=]\d+] [,up=\d+] [,down=\d+] ` ::
577 Startup and shutdown behavior. Order is a non-negative number defining the
578 general startup order. Shutdown in done with reverse ordering. Additionally
579 you can set the 'up' or 'down' delay in seconds, which specifies a delay to
580 wait before the next VM is started or stopped.
582 `-storage` `string` (default=`local`)::
586 `-swap` `integer (0 - N)` (default=`512`)::
588 Amount of SWAP for the VM in MB.
590 `-template` `boolean` (default=`0`)::
592 Enable/disable Template.
594 `-tty` `integer (0 - 6)` (default=`2`)::
596 Specify the number of tty available to the container
598 `-unprivileged` `boolean` (default=`0`)::
600 Makes the container run as unprivileged user. (Should not be modified
603 `-unused[n]` `string` ::
605 Reference to unused volumes.
610 *pct resume* `<vmid>`
612 Resume the container.
614 `<vmid>` `integer (1 - N)` ::
616 The (unique) ID of the VM.
621 *pct rollback* `<vmid> <snapname>`
623 Rollback LXC state to specified snapshot.
625 `<vmid>` `integer (1 - N)` ::
627 The (unique) ID of the VM.
629 `<snapname>` `string` ::
631 The name of the snapshot.
636 *pct set* `<vmid>` `[OPTIONS]`
638 Set container options.
640 `<vmid>` `integer (1 - N)` ::
642 The (unique) ID of the VM.
644 `-arch` `(amd64 | i386)` (default=`amd64`)::
646 OS architecture type.
648 `-cmode` `(console | shell | tty)` (default=`tty`)::
650 Console mode. By default, the console command tries to open a connection to
651 one of the available tty devices. By setting cmode to 'console' it tries to
652 attach to /dev/console instead. If you set cmode to 'shell', it simply
653 invokes a shell inside the container (no login).
655 `-console` `boolean` (default=`1`)::
657 Attach a console device (/dev/console) to the container.
659 `-cpulimit` `number (0 - 128)` (default=`0`)::
663 NOTE: If the computer has 2 CPUs, it has a total of '2' CPU time. Value '0'
664 indicates no CPU limit.
666 `-cpuunits` `integer (0 - 500000)` (default=`1024`)::
668 CPU weight for a VM. Argument is used in the kernel fair scheduler. The
669 larger the number is, the more CPU time this VM gets. Number is relative to
670 the weights of all the other running VMs.
672 NOTE: You can disable fair-scheduler configuration by setting this to 0.
674 `-delete` `string` ::
676 A list of settings you want to delete.
678 `-description` `string` ::
680 Container description. Only used on the configuration web interface.
682 `-digest` `string` ::
684 Prevent changes if current configuration file has different SHA1 digest.
685 This can be used to prevent concurrent modifications.
687 `-hostname` `string` ::
689 Set a host name for the container.
691 `-lock` `(backup | migrate | rollback | snapshot)` ::
695 `-memory` `integer (16 - N)` (default=`512`)::
697 Amount of RAM for the VM in MB.
699 `-mp[n]` `mp=<Path>, [volume=]<volume> [,acl=<acl>] [,backup=<[1|0]>] [,quota=<[0|1]>] [,ro=<ro>] [,size=<DiskSize>]` ::
701 Use volume as container mount point (experimental feature).
703 `-nameserver` `string` ::
705 Sets DNS server IP address for a container. Create will automatically use
706 the setting from the host if you neither set searchdomain nor nameserver.
708 `-net[n]` `name=<String> [,bridge=<vmbr<Number>>] [,firewall=<[1|0]>] [,gw=<GatewayIPv4>] [,gw6=<GatewayIPv6>] [,hwaddr=<MAC>] [,ip=<IPv4Format/CIDR>] [,ip6=<IPv6Format/CIDR>] [,mtu=<Number>] [,rate=<mbps>] [,tag=<VlanNo>] [,trunks=<vlanid[;vlanid...]>] [,type=<veth>]` ::
710 Specifies network interfaces for the container.
712 `-onboot` `boolean` (default=`0`)::
714 Specifies whether a VM will be started during system bootup.
716 `-ostype` `(alpine | archlinux | centos | debian | fedora | opensuse | ubuntu | unmanaged)` ::
718 OS type. This is used to setup configuration inside the container, and
719 corresponds to lxc setup scripts in
720 /usr/share/lxc/config/<ostype>.common.conf. Value 'unmanaged' can be used
721 to skip and OS specific setup.
723 `-protection` `boolean` (default=`0`)::
725 Sets the protection flag of the container. This will prevent the CT or CT's
726 disk remove/update operation.
728 `-rootfs` `[volume=]<volume> [,acl=<acl>] [,backup=<[1|0]>] [,quota=<[0|1]>] [,ro=<ro>] [,size=<DiskSize>]` ::
730 Use volume as container root.
732 `-searchdomain` `string` ::
734 Sets DNS search domains for a container. Create will automatically use the
735 setting from the host if you neither set searchdomain nor nameserver.
737 `-startup` `[[order=]\d+] [,up=\d+] [,down=\d+] ` ::
739 Startup and shutdown behavior. Order is a non-negative number defining the
740 general startup order. Shutdown in done with reverse ordering. Additionally
741 you can set the 'up' or 'down' delay in seconds, which specifies a delay to
742 wait before the next VM is started or stopped.
744 `-swap` `integer (0 - N)` (default=`512`)::
746 Amount of SWAP for the VM in MB.
748 `-template` `boolean` (default=`0`)::
750 Enable/disable Template.
752 `-tty` `integer (0 - 6)` (default=`2`)::
754 Specify the number of tty available to the container
756 `-unprivileged` `boolean` (default=`0`)::
758 Makes the container run as unprivileged user. (Should not be modified
761 `-unused[n]` `string` ::
763 Reference to unused volumes.
768 *pct shutdown* `<vmid>` `[OPTIONS]`
770 Shutdown the container. This will trigger a clean shutdown of the
771 container, see lxc-stop(1) for details.
773 `<vmid>` `integer (1 - N)` ::
775 The (unique) ID of the VM.
777 `-forceStop` `boolean` (default=`0`)::
779 Make sure the Container stops.
781 `-timeout` `integer (0 - N)` (default=`60`)::
783 Wait maximal timeout seconds.
788 *pct snapshot* `<vmid> <snapname>` `[OPTIONS]`
790 Snapshot a container.
792 `<vmid>` `integer (1 - N)` ::
794 The (unique) ID of the VM.
796 `<snapname>` `string` ::
798 The name of the snapshot.
800 `-description` `string` ::
802 A textual description or comment.
807 *pct start* `<vmid>` `[OPTIONS]`
811 `<vmid>` `integer (1 - N)` ::
813 The (unique) ID of the VM.
815 `-skiplock` `boolean` ::
817 Ignore locks - only root is allowed to use this option.
821 *pct stop* `<vmid>` `[OPTIONS]`
823 Stop the container. This will abruptly stop all processes running in the
826 `<vmid>` `integer (1 - N)` ::
828 The (unique) ID of the VM.
830 `-skiplock` `boolean` ::
832 Ignore locks - only root is allowed to use this option.
836 *pct suspend* `<vmid>`
838 Suspend the container.
840 `<vmid>` `integer (1 - N)` ::
842 The (unique) ID of the VM.
847 *pct template* `<vmid> -experimental <boolean>` `[OPTIONS]`
851 `<vmid>` `integer (1 - N)` ::
853 The (unique) ID of the VM.
855 `-experimental` `boolean` (default=`0`)::
857 The template feature is experimental, set this flag if you know what you
863 *pct unlock* `<vmid>`
867 `<vmid>` `integer (1 - N)` ::
869 The (unique) ID of the VM.
873 *pct unmount* `<vmid>`
875 Unmount the container's filesystem.
877 `<vmid>` `integer (1 - N)` ::
879 The (unique) ID of the VM.