LinuxCommandLibrary

lxc-create

creates a new Linux container from a template

TLDR

Create container interactively

$ sudo lxc-create -n [container_name] -t download
copy
Create in custom directory
$ sudo lxc-create -P /path/to/dir/ -n [container_name] -t download
copy
Create with specific distro
$ sudo lxc-create -n [container_name] -t download -- -d [distro] -r [release] -a [arch]
copy
Display help
$ lxc-create --help
copy

SYNOPSIS

lxc-create -n name -t template [options]

DESCRIPTION

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.

PARAMETERS

-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

CAVEATS

Requires root privileges. Default storage at /var/lib/lxc/. Templates vary by distribution.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community