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.
71 Print the list of assigned CPU sets.
76 *pct create* `<vmid> <ostemplate>` `[OPTIONS]`
78 Create or restore a container.
80 `<vmid>`: `<integer> (1 - N)` ::
82 The (unique) ID of the VM.
84 `<ostemplate>`: `<string>` ::
86 The OS template or backup file.
88 `-arch` `<amd64 | i386>` ('default =' `amd64`)::
92 `-cmode` `<console | shell | tty>` ('default =' `tty`)::
94 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).
96 `-console` `<boolean>` ('default =' `1`)::
98 Attach a console device (/dev/console) to the container.
100 `-cores` `<integer> (1 - 128)` ::
102 The number of cores assigned to the container. A container can use all available cores by default.
104 `-cpulimit` `<number> (0 - 128)` ('default =' `0`)::
108 NOTE: If the computer has 2 CPUs, it has a total of '2' CPU time. Value '0' indicates no CPU limit.
110 `-cpuunits` `<integer> (0 - 500000)` ('default =' `1024`)::
112 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.
114 NOTE: You can disable fair-scheduler configuration by setting this to 0.
116 `-description` `<string>` ::
118 Container description. Only used on the configuration web interface.
120 `-force` `<boolean>` ::
122 Allow to overwrite existing container.
124 `-hostname` `<string>` ::
126 Set a host name for the container.
128 `-ignore-unpack-errors` `<boolean>` ::
130 Ignore errors when extracting the template.
132 `-lock` `<backup | migrate | rollback | snapshot>` ::
136 `-memory` `<integer> (16 - N)` ('default =' `512`)::
138 Amount of RAM for the VM in MB.
140 `-mp[n]` `[volume=]<volume> ,mp=<Path> [,acl=<1|0>] [,backup=<1|0>] [,quota=<1|0>] [,ro=<1|0>] [,shared=<1|0>] [,size=<DiskSize>]` ::
142 Use volume as container mount point.
144 `-nameserver` `<string>` ::
146 Sets DNS server IP address for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.
148 `-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>]` ::
150 Specifies network interfaces for the container.
152 `-onboot` `<boolean>` ('default =' `0`)::
154 Specifies whether a VM will be started during system bootup.
156 `-ostype` `<alpine | archlinux | centos | debian | fedora | gentoo | opensuse | ubuntu | unmanaged>` ::
158 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.
162 Sets root password inside container.
164 `-pool` `<string>` ::
166 Add the VM to the specified pool.
168 `-protection` `<boolean>` ('default =' `0`)::
170 Sets the protection flag of the container. This will prevent the CT or CT's disk remove/update operation.
172 `-restore` `<boolean>` ::
174 Mark this as restore task.
176 `-rootfs` `[volume=]<volume> [,acl=<1|0>] [,quota=<1|0>] [,ro=<1|0>] [,shared=<1|0>] [,size=<DiskSize>]` ::
178 Use volume as container root.
180 `-searchdomain` `<string>` ::
182 Sets DNS search domains for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.
184 `-ssh-public-keys` `<string>` ::
186 Setup public SSH keys (one key per line, OpenSSH format).
188 `-startup` `[[order=]\d+] [,up=\d+] [,down=\d+] ` ::
190 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.
192 `-storage` `<string>` ('default =' `local`)::
196 `-swap` `<integer> (0 - N)` ('default =' `512`)::
198 Amount of SWAP for the VM in MB.
200 `-template` `<boolean>` ('default =' `0`)::
202 Enable/disable Template.
204 `-tty` `<integer> (0 - 6)` ('default =' `2`)::
206 Specify the number of tty available to the container
208 `-unprivileged` `<boolean>` ('default =' `0`)::
210 Makes the container run as unprivileged user. (Should not be modified manually.)
212 `-unused[n]` `<string>` ::
214 Reference to unused volumes. This is used internally, and should not be modified manually.
219 *pct delsnapshot* `<vmid> <snapname>` `[OPTIONS]`
221 Delete a LXC snapshot.
223 `<vmid>`: `<integer> (1 - N)` ::
225 The (unique) ID of the VM.
227 `<snapname>`: `<string>` ::
229 The name of the snapshot.
231 `-force` `<boolean>` ::
233 For removal from config file, even if removing disk snapshots fails.
238 *pct destroy* `<vmid>`
240 Destroy the container (also delete all uses files).
242 `<vmid>`: `<integer> (1 - N)` ::
244 The (unique) ID of the VM.
251 Get the container's current disk usage.
253 `<vmid>`: `<integer> (1 - N)` ::
255 The (unique) ID of the VM.
261 Launch a shell for the specified container.
263 `<vmid>`: `<integer> (1 - N)` ::
265 The (unique) ID of the VM.
269 *pct exec* `<vmid> [<extra-args>]`
271 Launch a command inside the specified container.
273 `<vmid>`: `<integer> (1 - N)` ::
275 The (unique) ID of the VM.
277 `<extra-args>`: `<array>` ::
279 Extra arguments as array
283 *pct fsck* `<vmid>` `[OPTIONS]`
285 Run a filesystem check (fsck) on a container volume.
287 `<vmid>`: `<integer> (1 - N)` ::
289 The (unique) ID of the VM.
291 `-device` `<mp0 | mp1 | mp2 | mp3 | mp4 | mp5 | mp6 | mp7 | mp8 | mp9 | rootfs>` ::
293 A volume on which to run the filesystem check
295 `-force` `<boolean>` ('default =' `0`)::
297 Force checking, even if the filesystem seems clean
302 *pct help* `[<cmd>]` `[OPTIONS]`
304 Get help about specified command.
306 `<cmd>`: `<string>` ::
310 `-verbose` `<boolean>` ::
312 Verbose output format.
319 LXC container index (per node).
324 *pct listsnapshot* `<vmid>`
328 `<vmid>`: `<integer> (1 - N)` ::
330 The (unique) ID of the VM.
335 *pct migrate* `<vmid> <target>` `[OPTIONS]`
337 Migrate the container to another node. Creates a new migration task.
339 `<vmid>`: `<integer> (1 - N)` ::
341 The (unique) ID of the VM.
343 `<target>`: `<string>` ::
347 `-force` `<boolean>` ::
349 Force migration despite local bind / device mounts. NOTE: deprecated, use 'shared' property of mount point instead.
351 `-online` `<boolean>` ::
353 Use online/live migration.
355 `-restart` `<boolean>` ::
357 Use restart migration
359 `-timeout` `<integer>` ('default =' `180`)::
361 Timeout in seconds for shutdown for restart migration
368 Mount the container's filesystem on the host. This will hold a lock on the
369 container and is meant for emergency maintenance only as it will prevent
370 further operations on the container other than start and stop.
372 `<vmid>`: `<integer> (1 - N)` ::
374 The (unique) ID of the VM.
378 *pct pull* `<vmid> <path> <destination>` `[OPTIONS]`
380 Copy a file from the container to the local system.
382 `<vmid>`: `<integer> (1 - N)` ::
384 The (unique) ID of the VM.
386 `<path>`: `<string>` ::
388 Path to a file inside the container to pull.
390 `<destination>`: `<string>` ::
394 `-group` `<string>` ::
396 Owner group name or id.
398 `-perms` `<string>` ::
400 File permissions to use (octal by default, prefix with '0x' for hexadecimal).
402 `-user` `<string>` ::
404 Owner user name or id.
408 *pct push* `<vmid> <file> <destination>` `[OPTIONS]`
410 Copy a local file to the container.
412 `<vmid>`: `<integer> (1 - N)` ::
414 The (unique) ID of the VM.
416 `<file>`: `<string>` ::
418 Path to a local file.
420 `<destination>`: `<string>` ::
422 Destination inside the container to write to.
424 `-group` `<string>` ::
426 Owner group name or id. When using a name it must exist inside the container.
428 `-perms` `<string>` ::
430 File permissions to use (octal by default, prefix with '0x' for hexadecimal).
432 `-user` `<string>` ::
434 Owner user name or id. When using a name it must exist inside the container.
439 *pct resize* `<vmid> <disk> <size>` `[OPTIONS]`
441 Resize a container mount point.
443 `<vmid>`: `<integer> (1 - N)` ::
445 The (unique) ID of the VM.
447 `<disk>`: `<mp0 | mp1 | mp2 | mp3 | mp4 | mp5 | mp6 | mp7 | mp8 | mp9 | rootfs>` ::
449 The disk you want to resize.
451 `<size>`: `\+?\d+(\.\d+)?[KMGT]?` ::
453 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.
455 `-digest` `<string>` ::
457 Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications.
461 *pct restore* `<vmid> <ostemplate>` `[OPTIONS]`
463 Create or restore a container.
465 `<vmid>`: `<integer> (1 - N)` ::
467 The (unique) ID of the VM.
469 `<ostemplate>`: `<string>` ::
471 The OS template or backup file.
473 `-arch` `<amd64 | i386>` ('default =' `amd64`)::
475 OS architecture type.
477 `-cmode` `<console | shell | tty>` ('default =' `tty`)::
479 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).
481 `-console` `<boolean>` ('default =' `1`)::
483 Attach a console device (/dev/console) to the container.
485 `-cores` `<integer> (1 - 128)` ::
487 The number of cores assigned to the container. A container can use all available cores by default.
489 `-cpulimit` `<number> (0 - 128)` ('default =' `0`)::
493 NOTE: If the computer has 2 CPUs, it has a total of '2' CPU time. Value '0' indicates no CPU limit.
495 `-cpuunits` `<integer> (0 - 500000)` ('default =' `1024`)::
497 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.
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]` `[volume=]<volume> ,mp=<Path> [,acl=<1|0>] [,backup=<1|0>] [,quota=<1|0>] [,ro=<1|0>] [,shared=<1|0>] [,size=<DiskSize>]` ::
527 Use volume as container mount point.
529 `-nameserver` `<string>` ::
531 Sets DNS server IP address for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.
533 `-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>]` ::
535 Specifies network interfaces for the container.
537 `-onboot` `<boolean>` ('default =' `0`)::
539 Specifies whether a VM will be started during system bootup.
541 `-ostype` `<alpine | archlinux | centos | debian | fedora | gentoo | opensuse | ubuntu | unmanaged>` ::
543 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.
547 Sets root password inside container.
549 `-pool` `<string>` ::
551 Add the VM to the specified pool.
553 `-protection` `<boolean>` ('default =' `0`)::
555 Sets the protection flag of the container. This will prevent the CT or CT's disk remove/update operation.
557 `-rootfs` `[volume=]<volume> [,acl=<1|0>] [,quota=<1|0>] [,ro=<1|0>] [,shared=<1|0>] [,size=<DiskSize>]` ::
559 Use volume as container root.
561 `-searchdomain` `<string>` ::
563 Sets DNS search domains for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.
565 `-ssh-public-keys` `<string>` ::
567 Setup public SSH keys (one key per line, OpenSSH format).
569 `-startup` `[[order=]\d+] [,up=\d+] [,down=\d+] ` ::
571 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.
573 `-storage` `<string>` ('default =' `local`)::
577 `-swap` `<integer> (0 - N)` ('default =' `512`)::
579 Amount of SWAP for the VM in MB.
581 `-template` `<boolean>` ('default =' `0`)::
583 Enable/disable Template.
585 `-tty` `<integer> (0 - 6)` ('default =' `2`)::
587 Specify the number of tty available to the container
589 `-unprivileged` `<boolean>` ('default =' `0`)::
591 Makes the container run as unprivileged user. (Should not be modified manually.)
593 `-unused[n]` `<string>` ::
595 Reference to unused volumes. This is used internally, and should not be modified manually.
600 *pct resume* `<vmid>`
602 Resume the container.
604 `<vmid>`: `<integer> (1 - N)` ::
606 The (unique) ID of the VM.
611 *pct rollback* `<vmid> <snapname>`
613 Rollback LXC state to specified snapshot.
615 `<vmid>`: `<integer> (1 - N)` ::
617 The (unique) ID of the VM.
619 `<snapname>`: `<string>` ::
621 The name of the snapshot.
626 *pct set* `<vmid>` `[OPTIONS]`
628 Set container options.
630 `<vmid>`: `<integer> (1 - N)` ::
632 The (unique) ID of the VM.
634 `-arch` `<amd64 | i386>` ('default =' `amd64`)::
636 OS architecture type.
638 `-cmode` `<console | shell | tty>` ('default =' `tty`)::
640 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).
642 `-console` `<boolean>` ('default =' `1`)::
644 Attach a console device (/dev/console) to the container.
646 `-cores` `<integer> (1 - 128)` ::
648 The number of cores assigned to the container. A container can use all available cores by default.
650 `-cpulimit` `<number> (0 - 128)` ('default =' `0`)::
654 NOTE: If the computer has 2 CPUs, it has a total of '2' CPU time. Value '0' indicates no CPU limit.
656 `-cpuunits` `<integer> (0 - 500000)` ('default =' `1024`)::
658 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.
660 NOTE: You can disable fair-scheduler configuration by setting this to 0.
662 `-delete` `<string>` ::
664 A list of settings you want to delete.
666 `-description` `<string>` ::
668 Container description. Only used on the configuration web interface.
670 `-digest` `<string>` ::
672 Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications.
674 `-hostname` `<string>` ::
676 Set a host name for the container.
678 `-lock` `<backup | migrate | rollback | snapshot>` ::
682 `-memory` `<integer> (16 - N)` ('default =' `512`)::
684 Amount of RAM for the VM in MB.
686 `-mp[n]` `[volume=]<volume> ,mp=<Path> [,acl=<1|0>] [,backup=<1|0>] [,quota=<1|0>] [,ro=<1|0>] [,shared=<1|0>] [,size=<DiskSize>]` ::
688 Use volume as container mount point.
690 `-nameserver` `<string>` ::
692 Sets DNS server IP address for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.
694 `-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>]` ::
696 Specifies network interfaces for the container.
698 `-onboot` `<boolean>` ('default =' `0`)::
700 Specifies whether a VM will be started during system bootup.
702 `-ostype` `<alpine | archlinux | centos | debian | fedora | gentoo | opensuse | ubuntu | unmanaged>` ::
704 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.
706 `-protection` `<boolean>` ('default =' `0`)::
708 Sets the protection flag of the container. This will prevent the CT or CT's disk remove/update operation.
710 `-rootfs` `[volume=]<volume> [,acl=<1|0>] [,quota=<1|0>] [,ro=<1|0>] [,shared=<1|0>] [,size=<DiskSize>]` ::
712 Use volume as container root.
714 `-searchdomain` `<string>` ::
716 Sets DNS search domains for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.
718 `-startup` `[[order=]\d+] [,up=\d+] [,down=\d+] ` ::
720 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.
722 `-swap` `<integer> (0 - N)` ('default =' `512`)::
724 Amount of SWAP for the VM in MB.
726 `-template` `<boolean>` ('default =' `0`)::
728 Enable/disable Template.
730 `-tty` `<integer> (0 - 6)` ('default =' `2`)::
732 Specify the number of tty available to the container
734 `-unprivileged` `<boolean>` ('default =' `0`)::
736 Makes the container run as unprivileged user. (Should not be modified manually.)
738 `-unused[n]` `<string>` ::
740 Reference to unused volumes. This is used internally, and should not be modified manually.
745 *pct shutdown* `<vmid>` `[OPTIONS]`
747 Shutdown the container. This will trigger a clean shutdown of the
748 container, see lxc-stop(1) for details.
750 `<vmid>`: `<integer> (1 - N)` ::
752 The (unique) ID of the VM.
754 `-forceStop` `<boolean>` ('default =' `0`)::
756 Make sure the Container stops.
758 `-timeout` `<integer> (0 - N)` ('default =' `60`)::
760 Wait maximal timeout seconds.
765 *pct snapshot* `<vmid> <snapname>` `[OPTIONS]`
767 Snapshot a container.
769 `<vmid>`: `<integer> (1 - N)` ::
771 The (unique) ID of the VM.
773 `<snapname>`: `<string>` ::
775 The name of the snapshot.
777 `-description` `<string>` ::
779 A textual description or comment.
784 *pct start* `<vmid>` `[OPTIONS]`
788 `<vmid>`: `<integer> (1 - N)` ::
790 The (unique) ID of the VM.
792 `-skiplock` `<boolean>` ::
794 Ignore locks - only root is allowed to use this option.
799 *pct status* `<vmid>` `[OPTIONS]`
803 `<vmid>`: `<integer> (1 - N)` ::
805 The (unique) ID of the VM.
807 `-verbose` `<boolean>` ::
809 Verbose output format
814 *pct stop* `<vmid>` `[OPTIONS]`
816 Stop the container. This will abruptly stop all processes running in the
819 `<vmid>`: `<integer> (1 - N)` ::
821 The (unique) ID of the VM.
823 `-skiplock` `<boolean>` ::
825 Ignore locks - only root is allowed to use this option.
829 *pct suspend* `<vmid>`
831 Suspend the container.
833 `<vmid>`: `<integer> (1 - N)` ::
835 The (unique) ID of the VM.
840 *pct template* `<vmid> -experimental <boolean>` `[OPTIONS]`
844 `<vmid>`: `<integer> (1 - N)` ::
846 The (unique) ID of the VM.
848 `-experimental` `<boolean>` ('default =' `0`)::
850 The template feature is experimental, set this flag if you know what you are doing.
855 *pct unlock* `<vmid>`
859 `<vmid>`: `<integer> (1 - N)` ::
861 The (unique) ID of the VM.
865 *pct unmount* `<vmid>`
867 Unmount the container's filesystem.
869 `<vmid>`: `<integer> (1 - N)` ::
871 The (unique) ID of the VM.