Linux command
lxc-create 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Example
sudo lxc-create -n [container_name] -t download
Example
sudo lxc-create -P /path/to/dir/ -n [container_name] -t download
Example
sudo lxc-create -n [container_name] -t download -- -d [distro] -r [release] -a [arch]
Example
lxc-create --help
说明
lxc-create creates a new Linux container from a template. It sets up the container's root filesystem and configuration based on the specified template.
参数
- -n, --name NAME
- Container name
- -t, --template TEMPLATE
- Template to use (download, ubuntu, debian, etc.)
- -P, --lxcpath PATH
- Container storage directory
- -B, --bdev TYPE
- Backing store type (dir, lvm, btrfs, zfs)
- -- TEMPLATE_OPTIONS
- Options passed to template (-d distro, -r release, -a arch)
- -?, --help
- Display help information
FAQ
What is the lxc-create command used for?
lxc-create creates a new Linux container from a template. It sets up the container's root filesystem and configuration based on the specified template.
How do I run a basic lxc-create example?
Run `sudo lxc-create -n [container_name] -t download` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -n, --name NAME do in lxc-create?
Container name