192
201
.SS "ROOT FILE SYSTEM"
194
The root file system is the location where the container will
203
The root file system of the container can be different than that
197
206
\fB lxc.rootfs \fR
198
specify a file location containing the new file tree for
207
specify a directory to become the root of the container.
208
If not specified, the container shares its root file
209
system with the host.
211
\fB lxc.rootfs.mount \fR
212
where to recursively bind \fBlxc.rootfs\fR
213
before pivoting. This is to ensure success of the
215
syscall. Any directory suffices, the default should
219
where to pivot the original root file system under
220
\fBlxc.rootfs\fR, specified relatively to
221
that. The default is \fImnt\fR\&.
222
It is created if necessary, and also removed after
223
unmounting everything from it during container setup.
200
224
.SS "CONTROL GROUP"
202
226
The control group section contains the configuration for the
235
262
configured before on the system by the administrator). The
236
263
virtual network device visible in the container is renamed to
239
\fBlxc.utsname = myhostname\fR
241
\fBlxc.network.type = veth\fR
243
\fBlxc.network.flags = up\fR
245
\fBlxc.network.link = br0\fR
247
\fBlxc.network.name = eth0\fR
249
\fBlxc.network.hwaddr = 4a:49:43:49:79:bf\fR
251
\fBlxc.network.ipv4 = 1.2.3.5/24\fR
253
\fBlxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3597\fR
267
lxc.utsname = myhostname
268
lxc.network.type = veth
269
lxc.network.flags = up
270
lxc.network.link = br0
271
lxc.network.name = eth0
272
lxc.network.hwaddr = 4a:49:43:49:79:bf
273
lxc.network.ipv4 = 1.2.3.5/24
274
lxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3597
254
277
.SS "CONTROL GROUP"
256
279
This configuration will setup several control groups for
257
280
the application, cpuset.cpus restricts usage of the defined cpu,
258
281
cpus.share prioritize the control group, devices.allow makes
259
282
usable the specified devices.
261
\fBlxc.cgroup.cpuset.cpus = 0,1\fR
263
\fBlxc.cgroup.cpu.shares = 1234\fR
265
\fBlxc.cgroup.devices.deny = a\fR
267
\fBlxc.cgroup.devices.allow = c 1:3 rw\fR
269
\fBlxc.cgroup.devices.allow = b 8:0 rw\fR
285
lxc.cgroup.cpuset.cpus = 0,1
286
lxc.cgroup.cpu.shares = 1234
287
lxc.cgroup.devices.deny = a
288
lxc.cgroup.devices.allow = c 1:3 rw
289
lxc.cgroup.devices.allow = b 8:0 rw
270
292
.SS "COMPLEX CONFIGURATION"
272
294
This example show a complex configuration making a complex
273
295
network stack, using the control groups, setting a new hostname,
274
mounting some locations and a changing the root file
277
\fBlxc.utsname = complex\fR
279
\fBlxc.network.type = veth\fR
281
\fBlxc.network.flags = up\fR
283
\fBlxc.network.link = br0\fR
285
\fBlxc.network.hwaddr = 4a:49:43:49:79:bf\fR
287
\fBlxc.network.ipv4 = 1.2.3.5/24\fR
289
\fBlxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3597\fR
291
\fBlxc.network.ipv6 = 2003:db8:1:0:214:5432:feab:3588\fR
293
\fBlxc.network.type = macvlan\fR
295
\fBlxc.network.flags = up\fR
297
\fBlxc.network.link = eth0\fR
299
\fBlxc.network.hwaddr = 4a:49:43:49:79:bd\fR
301
\fBlxc.network.ipv4 = 1.2.3.4/24\fR
303
\fBlxc.network.ipv4 = 192.168.10.125/24\fR
305
\fBlxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3596\fR
307
\fBlxc.network.type = phys\fR
309
\fBlxc.network.flags = up\fR
311
\fBlxc.network.link = dummy0\fR
313
\fBlxc.network.hwaddr = 4a:49:43:49:79:ff\fR
315
\fBlxc.network.ipv4 = 1.2.3.6/24\fR
317
\fBlxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3297\fR
319
\fBlxc.cgroup.cpuset.cpus = 0,1\fR
321
\fBlxc.cgroup.cpu.shares = 1234\fR
323
\fBlxc.cgroup.devices.deny = a\fR
325
\fBlxc.cgroup.devices.allow = c 1:3 rw\fR
327
\fBlxc.cgroup.devices.allow = b 8:0 rw\fR
329
\fBlxc.mount = /etc/fstab.complex\fR
331
\fBlxc.mount.entry = /lib /root/myrootfs/lib none ro,bind 0 0\fR
333
\fBlxc.rootfs = /mnt/rootfs.complex\fR
335
\fBlxc.cap.drop = sys_module mknod setuid net_raw\fR
337
\fBlxc.cap.drop = mac_override\fR
296
mounting some locations and a changing root file system.
299
lxc.utsname = complex
300
lxc.network.type = veth
301
lxc.network.flags = up
302
lxc.network.link = br0
303
lxc.network.hwaddr = 4a:49:43:49:79:bf
304
lxc.network.ipv4 = 1.2.3.5/24
305
lxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3597
306
lxc.network.ipv6 = 2003:db8:1:0:214:5432:feab:3588
307
lxc.network.type = macvlan
308
lxc.network.flags = up
309
lxc.network.link = eth0
310
lxc.network.hwaddr = 4a:49:43:49:79:bd
311
lxc.network.ipv4 = 1.2.3.4/24
312
lxc.network.ipv4 = 192.168.10.125/24
313
lxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3596
314
lxc.network.type = phys
315
lxc.network.flags = up
316
lxc.network.link = dummy0
317
lxc.network.hwaddr = 4a:49:43:49:79:ff
318
lxc.network.ipv4 = 1.2.3.6/24
319
lxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3297
320
lxc.cgroup.cpuset.cpus = 0,1
321
lxc.cgroup.cpu.shares = 1234
322
lxc.cgroup.devices.deny = a
323
lxc.cgroup.devices.allow = c 1:3 rw
324
lxc.cgroup.devices.allow = b 8:0 rw
325
lxc.mount = /etc/fstab.complex
326
lxc.mount.entry = /lib /root/myrootfs/lib none ro,bind 0 0
327
lxc.rootfs = /mnt/rootfs.complex
328
lxc.cap.drop = sys_module mknod setuid net_raw
329
lxc.cap.drop = mac_override