SlideShare a Scribd company logo
1 of 19
Download to read offline
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

More Related Content

What's hot

Linux Container Technology 101
Linux Container Technology 101Linux Container Technology 101
Linux Container Technology 101
inside-BigData.com
 
Inside Docker for Fedora20/RHEL7
Inside Docker for Fedora20/RHEL7Inside Docker for Fedora20/RHEL7
Inside Docker for Fedora20/RHEL7
Etsuji Nakai
 

What's hot (20)

Linux Containers From Scratch
Linux Containers From ScratchLinux Containers From Scratch
Linux Containers From Scratch
 
Docker storage drivers by Jérôme Petazzoni
Docker storage drivers by Jérôme PetazzoniDocker storage drivers by Jérôme Petazzoni
Docker storage drivers by Jérôme Petazzoni
 
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
 
Union FileSystem - A Building Blocks Of a Container
Union FileSystem - A Building Blocks Of a ContainerUnion FileSystem - A Building Blocks Of a Container
Union FileSystem - A Building Blocks Of a Container
 
Docker: Aspects of Container Isolation
Docker: Aspects of Container IsolationDocker: Aspects of Container Isolation
Docker: Aspects of Container Isolation
 
Linux cgroups and namespaces
Linux cgroups and namespacesLinux cgroups and namespaces
Linux cgroups and namespaces
 
Linux Container Technology 101
Linux Container Technology 101Linux Container Technology 101
Linux Container Technology 101
 
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxConAnatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
 
Lxc – next gen virtualization for cloud intro (cloudexpo)
Lxc – next gen virtualization for cloud   intro (cloudexpo)Lxc – next gen virtualization for cloud   intro (cloudexpo)
Lxc – next gen virtualization for cloud intro (cloudexpo)
 
Linuxcon Barcelon 2012: LXC Best Practices
Linuxcon Barcelon 2012: LXC Best PracticesLinuxcon Barcelon 2012: LXC Best Practices
Linuxcon Barcelon 2012: LXC Best Practices
 
Docker internals
Docker internalsDocker internals
Docker internals
 
Understanding LXC & Docker
Understanding LXC & DockerUnderstanding LXC & Docker
Understanding LXC & Docker
 
Namespaces and cgroups - the basis of Linux containers
Namespaces and cgroups - the basis of Linux containersNamespaces and cgroups - the basis of Linux containers
Namespaces and cgroups - the basis of Linux containers
 
Namespaces in Linux
Namespaces in LinuxNamespaces in Linux
Namespaces in Linux
 
Inside Docker for Fedora20/RHEL7
Inside Docker for Fedora20/RHEL7Inside Docker for Fedora20/RHEL7
Inside Docker for Fedora20/RHEL7
 
Containers and Namespaces in the Linux Kernel
Containers and Namespaces in the Linux KernelContainers and Namespaces in the Linux Kernel
Containers and Namespaces in the Linux Kernel
 
Container Torture: Run any binary, in any container
Container Torture: Run any binary, in any containerContainer Torture: Run any binary, in any container
Container Torture: Run any binary, in any container
 
Docker Container: isolation and security
Docker Container: isolation and securityDocker Container: isolation and security
Docker Container: isolation and security
 
Let's Containerize New York with Docker!
Let's Containerize New York with Docker!Let's Containerize New York with Docker!
Let's Containerize New York with Docker!
 
Lightweight Virtualization: LXC containers & AUFS
Lightweight Virtualization: LXC containers & AUFSLightweight Virtualization: LXC containers & AUFS
Lightweight Virtualization: LXC containers & AUFS
 

Similar to Lxc- Introduction

Lightweight Virtualization: LXC Best Practices
Lightweight Virtualization: LXC Best PracticesLightweight Virtualization: LXC Best Practices
Lightweight Virtualization: LXC Best Practices
Werner Fischer
 
Evolution of Linux Containerization
Evolution of Linux Containerization Evolution of Linux Containerization
Evolution of Linux Containerization
WSO2
 
Automate drupal deployments with linux containers, docker and vagrant
Automate drupal deployments with linux containers, docker and vagrant Automate drupal deployments with linux containers, docker and vagrant
Automate drupal deployments with linux containers, docker and vagrant
Ricardo Amaro
 

Similar to Lxc- Introduction (20)

Lightweight Virtualization: LXC Best Practices
Lightweight Virtualization: LXC Best PracticesLightweight Virtualization: LXC Best Practices
Lightweight Virtualization: LXC Best Practices
 
Docker containers : introduction
Docker containers : introductionDocker containers : introduction
Docker containers : introduction
 
Linux Containers & Docker
Linux Containers & DockerLinux Containers & Docker
Linux Containers & Docker
 
Introduction to linux at Introductory Bioinformatics Workshop
Introduction to linux at Introductory Bioinformatics WorkshopIntroduction to linux at Introductory Bioinformatics Workshop
Introduction to linux at Introductory Bioinformatics Workshop
 
Introducing Docker
Introducing DockerIntroducing Docker
Introducing Docker
 
Docker-v3.pdf
Docker-v3.pdfDocker-v3.pdf
Docker-v3.pdf
 
Isolating an applications using LXC – Linux Containers
Isolating an applications using LXC – Linux ContainersIsolating an applications using LXC – Linux Containers
Isolating an applications using LXC – Linux Containers
 
Evolution of Linux Containerization
Evolution of Linux Containerization Evolution of Linux Containerization
Evolution of Linux Containerization
 
Evoluation of Linux Container Virtualization
Evoluation of Linux Container VirtualizationEvoluation of Linux Container Virtualization
Evoluation of Linux Container Virtualization
 
Introduce to linux
Introduce to linuxIntroduce to linux
Introduce to linux
 
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
 
codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014
 
Introdution to Docker (theory and hands on) dbCafé - dbTrento
Introdution to Docker (theory and hands on) dbCafé - dbTrentoIntrodution to Docker (theory and hands on) dbCafé - dbTrento
Introdution to Docker (theory and hands on) dbCafé - dbTrento
 
Linux Container Brief for IEEE WG P2302
Linux Container Brief for IEEE WG P2302Linux Container Brief for IEEE WG P2302
Linux Container Brief for IEEE WG P2302
 
20240201 [HPC Containers] Rootless Containers.pdf
20240201 [HPC Containers] Rootless Containers.pdf20240201 [HPC Containers] Rootless Containers.pdf
20240201 [HPC Containers] Rootless Containers.pdf
 
Navigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas SaariNavigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas Saari
 
Dev opsec dockerimage_patch_n_lifecyclemanagement_2019
Dev opsec dockerimage_patch_n_lifecyclemanagement_2019Dev opsec dockerimage_patch_n_lifecyclemanagement_2019
Dev opsec dockerimage_patch_n_lifecyclemanagement_2019
 
Automate drupal deployments with linux containers, docker and vagrant
Automate drupal deployments with linux containers, docker and vagrant Automate drupal deployments with linux containers, docker and vagrant
Automate drupal deployments with linux containers, docker and vagrant
 
Develop QNAP NAS App by Docker
Develop QNAP NAS App by DockerDevelop QNAP NAS App by Docker
Develop QNAP NAS App by Docker
 
linux-lecture1.ppt
linux-lecture1.pptlinux-lecture1.ppt
linux-lecture1.ppt
 

Recently uploaded

Recently uploaded (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Lxc- Introduction

  • 1. 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
  • 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. De
  • 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 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
  • 7. Implementations Figure: Several ways to use container. Source:Wikipedia Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 5 / 19
  • 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
  • 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
  • 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
  • 18. gurations $ sudo lxc-checkcon
  • 20. g output Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 11 / 19
  • 23. rst container $ sudo lxc-create -t ubuntu -n ubuntulxc Where: -t : template -n : name of container Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 12 / 19
  • 24. Usage See information about new container: Container information $ sudo lxc-ls -f Start new container: Start new container $ sudo lxc-start -n ubuntulxc Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 13 / 19
  • 25. Usage Stop a container $ sudo lxc-stop -n ubuntulxc Destroy a container $ sudo lxc-destroy -n ubuntulxc Clone a container $ sudo lxc-clone -o ubuntulxc -n ubuntulxc2 Execute a temporary container $ sudo lxc-execute -n guest { sleep 100 Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 14 / 19
  • 27. 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 15 / 19
  • 28. Advanced Use Containers storage: /var/lib/lxc/ Main con
  • 32. les: /sys/fs/cgroup/.../lxc/YOUR CONTAINER/ Scripts to install some templates: /usr/share/lxc/templates Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 16 / 19
  • 33. Advanced Use Controlling Container Resources CPU information $ sudo lxc-cgroup -n ubuntulxc cpuset.cpus CPU time and block I/O access $ sudo lxc-cgroup -n ubuntulxc cpu.shares 256 $ sudo lxc-cgroup -n ubuntulxc blkio.weight 500 Dynamic Memory Allocation $ sudo lxc-cgroup -n ubuntulxc memory.soft limit in bytes 268435456 $ sudo lxc-cgroup -n ubuntulxc memory.limit in bytes 53687091 More cgroups here. Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 17 / 19
  • 34. References LXC Ubuntu. Available at: https://help.ubuntu.com/lts/serverguide/lxc.html. Oracle Documentation. Available at: https://docs.oracle.com/cd/E37670 01/E37355/html/ol cgroups.html. Arch Linux Containers. Available at: https://wiki.archlinux.org/index.php/Linux Containers. Wikipedia LXC. Available at: http://en.wikipedia.org/wiki/LXC. Rathore, Muhammad Siraj, Markus Hidell, and Peter Sjodin. KVM vs. LXC: comparing performance and isolation of hardware-assisted virtual routers. American Journal of Networks and Communications 2.4 (2013): 88-96. Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 18 / 19
  • 35. LXC Introduction Lus Eduardo lets@cin.ufpe.br Federal University of Pernambuco November 2014 Lus Eduardo lets@cin.ufpe.br (UFPE) LXC November 2014 19 / 19