1lxc-create(1) lxc-create(1)
2
3
4
6 lxc-create - creates a container
7
9 lxc-create {-n name} [-f config_file] {-t template} [-B backingstore]
10 [-- template-options]
11
13 lxc-create creates a system object where is stored the configuration
14 information and where can be stored user information. The identifier
15 name is used to specify the container to be used with the different lxc
16 commands.
17
18 The object is a directory created in /var/lib/lxc and identified by its
19 name.
20
21 The object is the definition of the different resources an application
22 can use or can see. The more the configuration file contains informa‐
23 tion, the more the container is isolated and the more the application
24 is jailed.
25
26 If the configuration file config_file is not specified, the container
27 will be created with the default isolation: processes, sysv ipc and
28 mount points.
29
31 -f, --config config_file
32 Specify the configuration file to configure the virtualization
33 and isolation functionalities for the container.
34
35 -t, --template template
36 'template' is the short name of an existing 'lxc-template'
37 script that is called by lxc-create, eg. busybox, debian, fedo‐
38 ra, ubuntu or sshd. Refer to the examples in
39 /usr/share/lxc/templates for details of the expected script
40 structure. Alternatively, the full path to an executable tem‐
41 plate script can also be passed as a parameter. "none" can be
42 used to force lxc-create to skip rootfs creation.
43
44 -B, --bdev backingstore
45 'backingstore' is one of 'dir', 'lvm', 'loop', 'btrfs', 'zfs',
46 'rbd', or 'best'. The default is 'dir', meaning that the con‐
47 tainer root filesystem will be a directory under
48 /var/lib/lxc/container/rootfs. This backing store type allows
49 the optional --dir ROOTFS to be specified, meaning that the con‐
50 tainer rootfs should be placed under the specified path, rather
51 than the default. (The 'none' backingstore type is an alias for
52 'dir'.) If 'btrfs' is specified, then the target filesystem must
53 be btrfs, and the container rootfs will be created as a new sub‐
54 volume. This allows snapshotted clones to be created, but also
55 causes rsync --one-filesystem to treat it as a separate filesys‐
56 tem. If backingstore is 'lvm', then an lvm block device will be
57 used and the following further options are available: --lvname
58 lvname1 will create an LV named lvname1 rather than the default,
59 which is the container name. --vgname vgname1 will create the LV
60 in volume group vgname1 rather than the default, lxc. --thin‐
61 pool thinpool1 will create the LV as a thin-provisioned volume
62 in the pool named thinpool1 rather than the default, lxc.
63 --fstype FSTYPE will create an FSTYPE filesystem on the LV,
64 rather than the default, which is ext4. --fssize SIZE will cre‐
65 ate a LV (and filesystem) of size SIZE rather than the default,
66 which is 1G.
67
68 If backingstore is 'loop', you can use --fstype FSTYPE and --fs‐
69 size SIZE as 'lvm'. The default values for these options are the
70 same as 'lvm'.
71
72 If backingstore is 'rbd', then you will need to have a valid
73 configuration in ceph.conf and a ceph.client.admin.keyring de‐
74 fined. You can specify the following options : --rbdname RBD‐
75 NAME will create a blockdevice named RBDNAME rather than the de‐
76 fault, which is the container name. --rbdpool POOL will create
77 the blockdevice in the pool named POOL, rather than the default,
78 which is 'lxc'.
79
80 If backingstore is 'best', then lxc will try, in order, btrfs,
81 zfs, lvm, and finally a directory backing store.
82
83 -- template-options
84 This will pass template-options to the template as arguments. To
85 see the list of options supported by the template, you can run
86 lxc-create -t TEMPLATE -h.
87
89 These options are common to most of lxc commands.
90
91 -?, -h, --help
92 Print a longer usage message than normal.
93
94 --usage
95 Give the usage message
96
97 -q, --quiet
98 mute on
99
100 -P, --lxcpath=PATH
101 Use an alternate container path. The default is /var/lib/lxc.
102
103 -o, --logfile=FILE
104 Output to an alternate log FILE. The default is no log.
105
106 -l, --logpriority=LEVEL
107 Set log priority to LEVEL. The default log priority is ERROR.
108 Possible values are : FATAL, ALERT, CRIT, WARN, ERROR, NOTICE,
109 INFO, DEBUG, TRACE.
110
111 Note that this option is setting the priority of the events log
112 in the alternate log file. It do not have effect on the ERROR
113 events log on stderr.
114
115 -n, --name=NAME
116 Use container identifier NAME. The container identifier format
117 is an alphanumeric string.
118
119 --rcfile=FILE
120 Specify the configuration file to configure the virtualization
121 and isolation functionalities for the container.
122
123 This configuration file if present will be used even if there is
124 already a configuration file present in the previously created
125 container (via lxc-create).
126
127 --version
128 Show the version number.
129
131 The container already exists
132 As the message mention it, you try to create a container but
133 there is a container with the same name. You can use the lxc-ls
134 command to list the available containers on the system.
135
137 lxc(7), lxc-create(1), lxc-copy(1), lxc-destroy(1), lxc-start(1), lxc-
138 stop(1), lxc-execute(1), lxc-console(1), lxc-monitor(1), lxc-wait(1),
139 lxc-cgroup(1), lxc-ls(1), lxc-info(1), lxc-freeze(1), lxc-unfreeze(1),
140 lxc-attach(1), lxc.conf(5)
141
143 Daniel Lezcano <daniel.lezcano@free.fr>
144
145
146
147 2022-07-21 lxc-create(1)