# lxc-create

## NAME



           lxc-create - creates a container
    


## SYNOPSIS



           **lxc-create**{-n _name_} [-f _config_file_] {-t _template_} [-B
                      _backingstore_] [-- _template-options_]
    


## DESCRIPTION



           **lxc-create** creates a system object where is stored the configura‐
           tion information and where can be  stored  user  information.  The
           identifier  _name_  is used to specify the container to be used with
           the different lxc commands.
    
           The object is a directory created in _/var/lib/lxc_  and  identified
           by its name.
    
           The  object is the definition of the different resources an appli‐
           cation can use or can see. The more the  configuration  file  con‐
           tains information, the more the container is isolated and the more
           the application is jailed.
    
           If  the  configuration file _config_file_ is not specified, the con‐
           tainer will be created with the default isolation: processes, sysv
           ipc and mount points.
    


## OPTIONS



           **-f, --config** _config_file_
                  Specify the configuration file to configure the virtualiza‐
                  tion and isolation functionalities for the container.
    
           **-t, --template** _template_
                  'template' is the short name of an existing 'lxc-template'
                  script that is called by lxc-create, eg. busybox, debian,
                  fedora, ubuntu or sshd.  Refer to the examples in
                  _/usr/share/lxc/templates_ for details of the expected script
                  structure.  Alternatively, the full path to an executable
                  template script can also be passed as a parameter.  "none"
                  can be used to force lxc-create to skip rootfs creation.
    
           **-B, --bdev** _backingstore_
                  'backingstore' is one of 'dir', 'lvm', 'loop', 'btrfs',
                  'zfs', 'rbd', or 'best'. The default is 'dir', meaning that
                  the container root filesystem will be a directory under
                  _/var/lib/lxc/container/rootfs_.  This backing store type al‐
                  lows the optional _--dir ROOTFS_ to be specified, meaning
                  that the container rootfs should be placed under the speci‐
                  fied path, rather than the default. (The 'none' backing‐
                  store type is an alias for 'dir'.) If 'btrfs' is specified,
                  then the target filesystem must be btrfs, and the container
                  rootfs will be created as a new subvolume. This allows
                  snapshotted clones to be created, but also causes rsync
                  --one-filesystem to treat it as a separate filesystem.  If
                  backingstore is 'lvm', then an lvm block device will be
                  used and the following further options are available: _--lv‐_
                  _name lvname1_ will create an LV named _lvname1_ rather than
                  the default, which is the container name. _--vgname vgname1_
                  will create the LV in volume group _vgname1_ rather than the
                  default, _lxc_.  _--thinpool thinpool1_ will create the LV as a
                  thin-provisioned volume in the pool named _thinpool1_ rather
                  than the default, _lxc_.  _--fstype FSTYPE_ will create an
                  FSTYPE filesystem on the LV, rather than the default, which
                  is ext4.  _--fssize SIZE_ will create a LV (and filesystem)
                  of size SIZE rather than the default, which is 1G.
    
                  If backingstore is 'loop', you can use _--fstype FSTYPE_ and
                  _--fssize SIZE_ as 'lvm'. The default values for these op‐
                  tions are the same as 'lvm'.
    
                  If backingstore is 'rbd', then you will need to have a
                  valid configuration in _ceph.conf_ and a _ceph.client.ad‐_
                  _min.keyring_ defined.  You can specify the following options
                  : _--rbdname RBDNAME_ will create a blockdevice named RBDNAME
                  rather than the default, which is the container name.
                  _--rbdpool POOL_ will create the blockdevice in the pool
                  named POOL, rather than the default, which is 'lxc'.
    
                  If backingstore is 'best', then lxc will try, in order,
                  btrfs, zfs, lvm, and finally a directory backing store.
    
           **--**_template-options_
                  This will pass _template-options_ to the template as argu‐
                  ments. To see the list of options supported by the tem‐
                  plate, you can run **lxc-create -t TEMPLATE -h**.
    


## COMMON OPTIONS



           These options are common to most of lxc commands.
    
           **-?, -h, --help**
                  Print a longer usage message than normal.
    
           **--usage**
                  Give the usage message
    
           **-q, --quiet**
                  mute on
    
           **-P, --lxcpath=**_PATH_
                  Use an alternate container path. The default is
                  /var/lib/lxc.
    
           **-o, --logfile=**_FILE_
                  Output to an alternate log _FILE_. The default is no log.
    
           **-l, --logpriority=**_LEVEL_
                  Set log priority to _LEVEL_. The default log priority is ER‐
                  ROR. Possible values are : FATAL, ALERT, CRIT, WARN, ERROR,
                  NOTICE, INFO, DEBUG, TRACE.
    
                  Note that this option is setting the priority of the events
                  log in the alternate log file. It do not have effect on the
                  ERROR events log on stderr.
    
           **-n, --name=**_NAME_
                  Use container identifier _NAME_.  The container identifier
                  format is an alphanumeric string.
    
           **--rcfile=**_FILE_
                  Specify the configuration file to configure the virtualiza‐
                  tion and isolation functionalities for the container.
    
                  This configuration file if present will be used even if
                  there is already a configuration file present in the previ‐
                  ously created container (via lxc-create).
    
           **--version**
                  Show the version number.
    


## DIAGNOSTIC



           The container already exists
                  As the message mention it, you try to create a container
                  but there is a container with the same name. You can use
                  the **lxc-ls** command to list the available containers on the
                  system.
    


* * *