← 返回命令列表

Linux command

pct-create 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Create

pct create 100 local:vztmpl/distro.tar.zst --rootfs local-lvm:4

Example

pct create 100 local:vztmpl/distro.tar.zst --rootfs local-lvm:4 --memory 8192

Example

pct create 100 local:vztmpl/distro.tar.zst --rootfs local-lvm:4 --hostname name --password pass

Example

pct create 100 local:vztmpl/distro.tar.zst --rootfs local-lvm:4 --net0 name=eth0,bridge=vmbr0,ip=dhcp

Example

pct create 100 local:vztmpl/distro.tar.zst --rootfs local-lvm:4 --unprivileged 1 --cores 2 --swap 512

Example

pct create 100 local:vztmpl/distro.tar.zst --rootfs local-lvm:4 --start

说明

pct create creates a new LXC container in Proxmox VE from a template image. It configures storage, networking, resources, and other container properties during creation.

参数

vmid
The numeric ID for the new container
template
Path to the container template (e.g., local:vztmpl/distro.tar.zst)
--rootfs _storage:size_
Root filesystem storage and size in GB
--memory _megabytes_
Memory limit in MB
--hostname _name_
Container hostname
--password _password_
Root password for the container
--net_N_ _config_
Network interface configuration
--cores _number_
Number of CPU cores assigned to the container
--swap _megabytes_
Swap memory limit in MB (default: 512)
--unprivileged _0|1_
Create as unprivileged container (1, recommended for security)
--ssh-public-keys _filepath_
SSH public keys for root user authentication
--features _list_
Enable features like nesting, keyctl, fuse, mknod
--start _0|1_
Start container after creation (default: 0).
--onboot _0|1_
Start container during system bootup (default: 0).
--storage _storage_
Default storage for the container (default: local).
--nameserver _ip_
DNS server IP address for the container.
--ostype _type_
OS type (e.g., debian, ubuntu, centos, alpine, archlinux, fedora, gentoo, opensuse, unmanaged).

FAQ

What is the pct-create command used for?

pct create creates a new LXC container in Proxmox VE from a template image. It configures storage, networking, resources, and other container properties during creation.

How do I run a basic pct-create example?

Run `pct create 100 local:vztmpl/distro.tar.zst --rootfs local-lvm:4` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does vmid do in pct-create?

The numeric ID for the new container