LXC 
Introduction 
Lus Eduardo 
lets@cin.ufpe.br 
Federal University of Pernambuco 
November 2014 
Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 1 / 19
Summary 
1 De
nition 
2 General 
3 Implementations 
Main implementations 
4 Using LXC 
Installation 
Basic Usage 
Advanced Use 
Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 2 / 19
De
nition 
Linux Containers (LXC for LinuX Containers) are lightweight virtual 
machines (VMs) which are realized using features provided by a 
modern Linux kernel { VMs without the hypervisor. 
Operational system-level virtualization method for running multiples 
and isolated systems (containers) on a single host. 
Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 3 / 19
General 
Lightweight process virtualization is not new 
Chroot 
Solaris Zones 
BSD jails 
AIX WPARs (Workload Partitions) 
Linux-based containers projects 
Why now? 
Kernel Support +3.8(Febuary 2013) 
Namespaces 
Cgroups 
Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 4 / 19
Implementations 
Figure: Several ways to use container. Source:Wikipedia 
Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 5 / 19
Summary 
1 De
nition 
2 General 
3 Implementations 
Main implementations 
4 Using LXC 
Installation 
Basic Usage 
Advanced Use 
Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 6 / 19
Main implementations 
LXC 
Mostly written in C 
Stable and mature codebase 
Docker 
Mostly written in Go 
Stable and mature codebase 
Similar architecture with con
guration management 
OpenVZ 
Mostly written in C 
Stable and mature codebase 
Project that gave rise to several other 
Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 7 / 19
Summary 
1 De
nition 
2 General 
3 Implementations 
Main implementations 
4 Using LXC 
Installation 
Basic Usage 
Advanced Use 
Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 8 / 19
Installation 
Debian distributions 
$ sudo apt-get install lxc 
Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 9 / 19
Summary 
1 De
nition 
2 General 
3 Implementations 
Main implementations 
4 Using LXC 
Installation 
Basic Usage 
Advanced Use 
Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 10 / 19
Usage 
Test installation: 
Check con
gurations 
$ sudo lxc-checkcon
g 
Figure: lxc-checkcon

Lxc- Introduction

  • 1.
    LXC Introduction LusEduardo lets@cin.ufpe.br Federal University of Pernambuco November 2014 Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 1 / 19
  • 2.
  • 3.
    nition 2 General 3 Implementations Main implementations 4 Using LXC Installation Basic Usage Advanced Use Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 2 / 19
  • 4.
  • 5.
    nition Linux Containers(LXC for LinuX Containers) are lightweight virtual machines (VMs) which are realized using features provided by a modern Linux kernel { VMs without the hypervisor. Operational system-level virtualization method for running multiples and isolated systems (containers) on a single host. Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 3 / 19
  • 6.
    General Lightweight processvirtualization is not new Chroot Solaris Zones BSD jails AIX WPARs (Workload Partitions) Linux-based containers projects Why now? Kernel Support +3.8(Febuary 2013) Namespaces Cgroups Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 4 / 19
  • 7.
    Implementations Figure: Severalways to use container. Source:Wikipedia Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 5 / 19
  • 8.
  • 9.
    nition 2 General 3 Implementations Main implementations 4 Using LXC Installation Basic Usage Advanced Use Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 6 / 19
  • 10.
    Main implementations LXC Mostly written in C Stable and mature codebase Docker Mostly written in Go Stable and mature codebase Similar architecture with con
  • 11.
    guration management OpenVZ Mostly written in C Stable and mature codebase Project that gave rise to several other Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 7 / 19
  • 12.
  • 13.
    nition 2 General 3 Implementations Main implementations 4 Using LXC Installation Basic Usage Advanced Use Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 8 / 19
  • 14.
    Installation Debian distributions $ sudo apt-get install lxc Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 9 / 19
  • 15.
  • 16.
    nition 2 General 3 Implementations Main implementations 4 Using LXC Installation Basic Usage Advanced Use Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 10 / 19
  • 17.
  • 18.
    gurations $ sudolxc-checkcon
  • 19.