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.
395 Owner user name or id.
399 *pct push* `<vmid> <file> <destination>` `[OPTIONS]`
401 Copy a local file to the container.
403 `<vmid>` `integer (1 - N)` ::
405 The (unique) ID of the VM.
409 Path to a local file.
411 `<destination>` `string` ::
413 Destination inside the container to write to.
417 Owner group name or id. When using a name it must exist inside the
422 File permissions to use.
426 Owner user name or id. When using a name it must exist inside the
432 *pct resize* `<vmid> <disk> <size>` `[OPTIONS]`
434 Resize a container mountpoint.
436 `<vmid>` `integer (1 - N)` ::
438 The (unique) ID of the VM.
440 `<disk>` `(mp0 | mp1 | mp2 | mp3 | mp4 | mp5 | mp6 | mp7 | mp8 | mp9 | rootfs)` ::
442 The disk you want to resize.
444 `<size>` `\+?\d+(\.\d+)?[KMGT]?` ::
446 The new size. With the '+' sign the value is added to the actual size of
447 the volume and without it, the value is taken as an absolute one. Shrinking
448 disk size is not supported.
450 `-digest` `string` ::
452 Prevent changes if current configuration file has different SHA1 digest.
453 This can be used to prevent concurrent modifications.
457 *pct restore* `<vmid> <ostemplate>` `[OPTIONS]`
459 Create or restore a container.
461 `<vmid>` `integer (1 - N)` ::
463 The (unique) ID of the VM.
465 `<ostemplate>` `string` ::
467 The OS template or backup file.
469 `-arch` `(amd64 | i386)` (default=`amd64`)::
471 OS architecture type.
473 `-cmode` `(console | shell | tty)` (default=`tty`)::
475 Console mode. By default, the console command tries to open a connection to
476 one of the available tty devices. By setting cmode to 'console' it tries to
477 attach to /dev/console instead. If you set cmode to 'shell', it simply
478 invokes a shell inside the container (no login).
480 `-console` `boolean` (default=`1`)::
482 Attach a console device (/dev/console) to the container.
484 `-cpulimit` `number (0 - 128)` (default=`0`)::
488 NOTE: If the computer has 2 CPUs, it has a total of '2' CPU time. Value '0'
489 indicates no CPU limit.
491 `-cpuunits` `integer (0 - 500000)` (default=`1024`)::
493 CPU weight for a VM. Argument is used in the kernel fair scheduler. The
494 larger the number is, the more CPU time this VM gets. Number is relative to
495 the weights of all the other running VMs.
497 NOTE: You can disable fair-scheduler configuration by setting this to 0.
499 `-description` `string` ::
501 Container description. Only used on the configuration web interface.
503 `-force` `boolean` ::
505 Allow to overwrite existing container.
507 `-hostname` `string` ::
509 Set a host name for the container.
511 `-ignore-unpack-errors` `boolean` ::
513 Ignore errors when extracting the template.
515 `-lock` `(backup | migrate | rollback | snapshot)` ::
519 `-memory` `integer (16 - N)` (default=`512`)::
521 Amount of RAM for the VM in MB.
523 `-mp[n]` `mp=<Path>, [volume=]<volume> [,acl=<acl>] [,backup=<[1|0]>] [,quota=<[0|1]>] [,ro=<ro>] [,size=<DiskSize>]` ::
525 Use volume as container mount point (experimental feature).
527 `-nameserver` `string` ::
529 Sets DNS server IP address for a container. Create will automatically use
530 the setting from the host if you neither set searchdomain nor nameserver.
532 `-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>]` ::
534 Specifies network interfaces for the container.
536 `-onboot` `boolean` (default=`0`)::
538 Specifies whether a VM will be started during system bootup.
540 `-ostype` `(alpine | archlinux | centos | debian | fedora | opensuse | ubuntu | unmanaged)` ::
542 OS type. This is used to setup configuration inside the container, and
543 corresponds to lxc setup scripts in
544 /usr/share/lxc/config/<ostype>.common.conf. Value 'unmanaged' can be used
545 to skip and OS specific setup.
549 Sets root password inside container.
553 Add the VM to the specified pool.
555 `-protection` `boolean` (default=`0`)::
557 Sets the protection flag of the container. This will prevent the CT or CT's
558 disk remove/update operation.
560 `-rootfs` `[volume=]<volume> [,acl=<acl>] [,backup=<[1|0]>] [,quota=<[0|1]>] [,ro=<ro>] [,size=<DiskSize>]` ::
562 Use volume as container root.
564 `-searchdomain` `string` ::
566 Sets DNS search domains for a container. Create will automatically use the
567 setting from the host if you neither set searchdomain nor nameserver.
569 `-ssh-public-keys` `filepath` ::
571 Setup public SSH keys (one key per line, OpenSSH format).
573 `-startup` `[[order=]\d+] [,up=\d+] [,down=\d+] ` ::
575 Startup and shutdown behavior. Order is a non-negative number defining the
576 general startup order. Shutdown in done with reverse ordering. Additionally
577 you can set the 'up' or 'down' delay in seconds, which specifies a delay to
578 wait before the next VM is started or stopped.
580 `-storage` `string` (default=`local`)::
584 `-swap` `integer (0 - N)` (default=`512`)::
586 Amount of SWAP for the VM in MB.
588 `-template` `boolean` (default=`0`)::
590 Enable/disable Template.
592 `-tty` `integer (0 - 6)` (default=`2`)::
594 Specify the number of tty available to the container
596 `-unprivileged` `boolean` (default=`0`)::
598 Makes the container run as unprivileged user. (Should not be modified
601 `-unused[n]` `string` ::
603 Reference to unused volumes.
608 *pct resume* `<vmid>`
610 Resume the container.
612 `<vmid>` `integer (1 - N)` ::
614 The (unique) ID of the VM.
619 *pct rollback* `<vmid> <snapname>`
621 Rollback LXC state to specified snapshot.
623 `<vmid>` `integer (1 - N)` ::
625 The (unique) ID of the VM.
627 `<snapname>` `string` ::
629 The name of the snapshot.
634 *pct set* `<vmid>` `[OPTIONS]`
636 Set container options.
638 `<vmid>` `integer (1 - N)` ::
640 The (unique) ID of the VM.
642 `-arch` `(amd64 | i386)` (default=`amd64`)::
644 OS architecture type.
646 `-cmode` `(console | shell | tty)` (default=`tty`)::
648 Console mode. By default, the console command tries to open a connection to
649 one of the available tty devices. By setting cmode to 'console' it tries to
650 attach to /dev/console instead. If you set cmode to 'shell', it simply
651 invokes a shell inside the container (no login).
653 `-console` `boolean` (default=`1`)::
655 Attach a console device (/dev/console) to the container.
657 `-cpulimit` `number (0 - 128)` (default=`0`)::
661 NOTE: If the computer has 2 CPUs, it has a total of '2' CPU time. Value '0'
662 indicates no CPU limit.
664 `-cpuunits` `integer (0 - 500000)` (default=`1024`)::
666 CPU weight for a VM. Argument is used in the kernel fair scheduler. The
667 larger the number is, the more CPU time this VM gets. Number is relative to
668 the weights of all the other running VMs.
670 NOTE: You can disable fair-scheduler configuration by setting this to 0.
672 `-delete` `string` ::
674 A list of settings you want to delete.
676 `-description` `string` ::
678 Container description. Only used on the configuration web interface.
680 `-digest` `string` ::
682 Prevent changes if current configuration file has different SHA1 digest.
683 This can be used to prevent concurrent modifications.
685 `-hostname` `string` ::
687 Set a host name for the container.
689 `-lock` `(backup | migrate | rollback | snapshot)` ::
693 `-memory` `integer (16 - N)` (default=`512`)::
695 Amount of RAM for the VM in MB.
697 `-mp[n]` `mp=<Path>, [volume=]<volume> [,acl=<acl>] [,backup=<[1|0]>] [,quota=<[0|1]>] [,ro=<ro>] [,size=<DiskSize>]` ::
699 Use volume as container mount point (experimental feature).
701 `-nameserver` `string` ::
703 Sets DNS server IP address for a container. Create will automatically use
704 the setting from the host if you neither set searchdomain nor nameserver.
706 `-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>]` ::
708 Specifies network interfaces for the container.
710 `-onboot` `boolean` (default=`0`)::
712 Specifies whether a VM will be started during system bootup.
714 `-ostype` `(alpine | archlinux | centos | debian | fedora | opensuse | ubuntu | unmanaged)` ::
716 OS type. This is used to setup configuration inside the container, and
717 corresponds to lxc setup scripts in
718 /usr/share/lxc/config/<ostype>.common.conf. Value 'unmanaged' can be used
719 to skip and OS specific setup.
721 `-protection` `boolean` (default=`0`)::
723 Sets the protection flag of the container. This will prevent the CT or CT's
724 disk remove/update operation.
726 `-rootfs` `[volume=]<volume> [,acl=<acl>] [,backup=<[1|0]>] [,quota=<[0|1]>] [,ro=<ro>] [,size=<DiskSize>]` ::
728 Use volume as container root.
730 `-searchdomain` `string` ::
732 Sets DNS search domains for a container. Create will automatically use the
733 setting from the host if you neither set searchdomain nor nameserver.
735 `-startup` `[[order=]\d+] [,up=\d+] [,down=\d+] ` ::
737 Startup and shutdown behavior. Order is a non-negative number defining the
738 general startup order. Shutdown in done with reverse ordering. Additionally
739 you can set the 'up' or 'down' delay in seconds, which specifies a delay to
740 wait before the next VM is started or stopped.
742 `-swap` `integer (0 - N)` (default=`512`)::
744 Amount of SWAP for the VM in MB.
746 `-template` `boolean` (default=`0`)::
748 Enable/disable Template.
750 `-tty` `integer (0 - 6)` (default=`2`)::
752 Specify the number of tty available to the container
754 `-unprivileged` `boolean` (default=`0`)::
756 Makes the container run as unprivileged user. (Should not be modified
759 `-unused[n]` `string` ::
761 Reference to unused volumes.
766 *pct shutdown* `<vmid>` `[OPTIONS]`
768 Shutdown the container. This will trigger a clean shutdown of the
769 container, see lxc-stop(1) for details.
771 `<vmid>` `integer (1 - N)` ::
773 The (unique) ID of the VM.
775 `-forceStop` `boolean` (default=`0`)::
777 Make sure the Container stops.
779 `-timeout` `integer (0 - N)` (default=`60`)::
781 Wait maximal timeout seconds.
786 *pct snapshot* `<vmid> <snapname>` `[OPTIONS]`
788 Snapshot a container.
790 `<vmid>` `integer (1 - N)` ::
792 The (unique) ID of the VM.
794 `<snapname>` `string` ::
796 The name of the snapshot.
798 `-description` `string` ::
800 A textual description or comment.
805 *pct start* `<vmid>` `[OPTIONS]`
809 `<vmid>` `integer (1 - N)` ::
811 The (unique) ID of the VM.
813 `-skiplock` `boolean` ::
815 Ignore locks - only root is allowed to use this option.
819 *pct stop* `<vmid>` `[OPTIONS]`
821 Stop the container. This will abruptly stop all processes running in the
824 `<vmid>` `integer (1 - N)` ::
826 The (unique) ID of the VM.
828 `-skiplock` `boolean` ::
830 Ignore locks - only root is allowed to use this option.
834 *pct suspend* `<vmid>`
836 Suspend the container.
838 `<vmid>` `integer (1 - N)` ::
840 The (unique) ID of the VM.
845 *pct template* `<vmid> -experimental <boolean>` `[OPTIONS]`
849 `<vmid>` `integer (1 - N)` ::
851 The (unique) ID of the VM.
853 `-experimental` `boolean` (default=`0`)::
855 The template feature is experimental, set this flag if you know what you
861 *pct unlock* `<vmid>`
865 `<vmid>` `integer (1 - N)` ::
867 The (unique) ID of the VM.
871 *pct unmount* `<vmid>`
873 Unmount the container's filesystem.
875 `<vmid>` `integer (1 - N)` ::
877 The (unique) ID of the VM.