SlideShare a Scribd company logo
Virtualization which isn't
 LXC (Linux Containers)




       Dobrica Pavlinušić
        http://blog.rot13.org
   DORS/CLUC, Zagreb, 2011-05-16
Content
●   Virtualizations
    ●   Vserver, Xen, OpenVZ, sVirt, LXC
    ●   KVM, VirtualBox, VMWare
●   cgroup
●   Linux Containers
Virtualization overview
●   Xen
    ●   Separate host i guest kernel (dom0, domU)
    ●   Not upstream, massive duplication of kernel code
●   Linux Vserver, OpenVZ (Virtuozzo), sVirt (SELinux based)
    ●   Single kernel, out-of-tree patches
●   Linux Containers - LXC
    ●   chroot on steroids, based on cgroup Linux support
    ●   Part of standard kernel, based on things you already know!
●   Full-system virtualization: KVM, VirtualBox, VMWare
    ●   But you can run LXC inside them! (e.g. EC2)
cgroup
●   Process namespace in kernel
    ●   Devices (even X11 in LXC!)
    ●   CPU (sched, cpu account, cpuset) - NUMA
    ●   Memory (not in Debian's kernel)
    ●   Block I/O scheduling, limits
●   Linus' 2.6.38 magic patch
    ●   Setsid create new scheduler entry
●   Used by Google Chrome, systemd...
Linux containers - LXC
dpavlin@klin:~$ lxc-checkconfig                             dpavlin@klin:/usr/bin$ ls lxc-*
Kernel config /proc/config.gz not found, looking in other   lxc-checkconfig
places...
                                                            lxc-execute
Found kernel config file /boot/config-2.6.38-2-686
                                                            lxc-start
--- Namespaces ---
                                                            lxc-stop
Namespaces: enabled
                                                            lxc-info
Utsname namespace: enabled
Ipc namespace: enabled                                      lxc-console
Pid namespace: enabled                                      lxc-create
User namespace: enabled                                     lxc-destroy
Network namespace: enabled                                  lxc-ls
Multiple /dev/pts instances: enabled                        lxc-ps
                                                            lxc-netstat
--- Control groups ---                                      lxc-restart
Cgroup: enabled                                             lxc-cgroup
Cgroup namespace: enabled                                   lxc-freeze
Cgroup device: enabled
                                                            lxc-kill
Cgroup sched: enabled
                                                            lxc-monitor
Cgroup cpu account: enabled
                                                            lxc-setcap
Cgroup memory controller: missing
                                                            lxc-setuid
Cgroup cpuset: enabled
                                                            lxc-unfreeze
                                                            lxc-unshare
--- Misc ---
Veth pair device: enabled                                   lxc-version
Macvlan: enabled                                            Lxc-wait
Vlan: enabled                                               lxc-attach
File capabilities: missing                                  lxc-checkpoint
LXC: Network
●   veth
    ●   Bridge on host, (virtual) device inside container
●   vlan
    ●   Select packets by IP address
●   macvlan
    ●   Select packets by MAC address
●   phys
    ●   Move host interface inside container (routing fun!)
●   Empty
    ●   Only loopback
LXC: limit resources
●   Cores
    ●   lxc.cgroup.cpuset.cpus=1,2,3
●   CPU share
    ●   lxc.cgroup.cpu.shares=1024 # default
●   Memory usage (!Debian)
    ●   lxc.cgroup.memory.limit_in_bytes = 256M
    ●   lxc.cgroup.memory.memsw.limit_in_bytes = 1G
●   Disk (blkio)
    ●   Disk space – standard LVM, quota...
    ●   echo 100 > /cgroup/disk1/blkio.weight # XXX < 1000 !
    ●   echo "3:0 1048576" >
        /cgroup/disk1/blkio.throttle.read_bps_device
Start LXC container
●   Start single process in container
    ●   lxc-execute -n container -- /bin/bash
●   Whole operating system
    ●   Mounting filesystems, etc from config file
    ●   Application is /bin/init
    ●   lxc-start -n container
    ●   lxc-console -n container
    ●   lxc-stop -n container
Templates: lxc-create
# /usr/lib/lxc/templates/


export MIRROR=http://192.168.1.20:3142/ftp.debian.org
export SUITE=lenny


cat <<_EOF_ > /tmp/lenny.conf
lxc.network.type=veth
lxc.network.link=br0
lxc.network.flags=up
EOF


t61p:~# lxc-create -n lenny -t debian -f /tmp/lenny.conf
Container overview
●   /var/lib/lxc/container/config
●   Familiar commands
    ●   lxc-ls
    ●   lxc-info
    ●   lxc-ps
    ●   lxc-netstat
●   htop --enable-group > r192
●   /proc inside contauner isn't fully isolated!
    ●   Depends on namespace support in kernel
Under construction
●   Still not in: Linux 2.6.38.2
●   lxc-attach
    ●   Attach process (bash) inside running container
    ●   Needed to set default route outside container
●   lxc-checkpoint
    ●   Similar to lxc-(un)freeze with checkpoint to disk
    ●   https://ckpt.wiki.kernel.org/
LXC summary
●   Isolate
    ●   one application – lxc-execute
    ●   whole OS – lxc-start
●   use templates (lxc-create)
●   Familiar Linux networking (bridges)
●   Limiting features varies (kernel config/version)
●   Ready to use today!

More Related Content

What's hot

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
OpenVZ
 
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
Jérôme Petazzoni
 
Linux containers-namespaces(Dec 2014)
Linux containers-namespaces(Dec 2014)Linux containers-namespaces(Dec 2014)
Linux containers-namespaces(Dec 2014)
Ralf Dannert
 
Introduction to linux containers
Introduction to linux containersIntroduction to linux containers
Introduction to linux containers
Google
 
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...
Jérôme Petazzoni
 
Linux containers – next gen virtualization for cloud (atl summit) ar4 3 - copy
Linux containers – next gen virtualization for cloud (atl summit) ar4 3 - copyLinux containers – next gen virtualization for cloud (atl summit) ar4 3 - copy
Linux containers – next gen virtualization for cloud (atl summit) ar4 3 - copy
Boden Russell
 
Linux Containers From Scratch: Makfile MicroVPS
Linux Containers From Scratch: Makfile MicroVPSLinux Containers From Scratch: Makfile MicroVPS
Linux Containers From Scratch: Makfile MicroVPS
joshuasoundcloud
 
Linux container, namespaces & CGroup.
Linux container, namespaces & CGroup. Linux container, namespaces & CGroup.
Linux container, namespaces & CGroup.
Neeraj Shrimali
 
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
Docker, Inc.
 
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)
Boden Russell
 
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
Kernel TLV
 
Namespaces in Linux
Namespaces in LinuxNamespaces in Linux
Namespaces in Linux
Lubomir Rintel
 
Inside Docker for Fedora20/RHEL7
Inside Docker for Fedora20/RHEL7Inside Docker for Fedora20/RHEL7
Inside Docker for Fedora20/RHEL7Etsuji Nakai
 
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!
Jérôme Petazzoni
 
Containers with systemd-nspawn
Containers with systemd-nspawnContainers with systemd-nspawn
Containers with systemd-nspawn
Gábor Nyers
 
CoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love SystemdCoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love Systemd
Richard Lister
 
Docker - container and lightweight virtualization
Docker - container and lightweight virtualization Docker - container and lightweight virtualization
Docker - container and lightweight virtualization
Sim Janghoon
 
LXC, Docker, security: is it safe to run applications in Linux Containers?
LXC, Docker, security: is it safe to run applications in Linux Containers?LXC, Docker, security: is it safe to run applications in Linux Containers?
LXC, Docker, security: is it safe to run applications in Linux Containers?
Jérôme Petazzoni
 
Introduction to Docker and deployment and Azure
Introduction to Docker and deployment and AzureIntroduction to Docker and deployment and Azure
Introduction to Docker and deployment and Azure
Jérôme Petazzoni
 
Docker internals
Docker internalsDocker internals
Docker internals
Rohit Jnagal
 

What's hot (20)

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
 
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
 
Linux containers-namespaces(Dec 2014)
Linux containers-namespaces(Dec 2014)Linux containers-namespaces(Dec 2014)
Linux containers-namespaces(Dec 2014)
 
Introduction to linux containers
Introduction to linux containersIntroduction to linux containers
Introduction to linux containers
 
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...
 
Linux containers – next gen virtualization for cloud (atl summit) ar4 3 - copy
Linux containers – next gen virtualization for cloud (atl summit) ar4 3 - copyLinux containers – next gen virtualization for cloud (atl summit) ar4 3 - copy
Linux containers – next gen virtualization for cloud (atl summit) ar4 3 - copy
 
Linux Containers From Scratch: Makfile MicroVPS
Linux Containers From Scratch: Makfile MicroVPSLinux Containers From Scratch: Makfile MicroVPS
Linux Containers From Scratch: Makfile MicroVPS
 
Linux container, namespaces & CGroup.
Linux container, namespaces & CGroup. Linux container, namespaces & CGroup.
Linux container, namespaces & CGroup.
 
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
 
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)
 
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
 
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!
 
Containers with systemd-nspawn
Containers with systemd-nspawnContainers with systemd-nspawn
Containers with systemd-nspawn
 
CoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love SystemdCoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love Systemd
 
Docker - container and lightweight virtualization
Docker - container and lightweight virtualization Docker - container and lightweight virtualization
Docker - container and lightweight virtualization
 
LXC, Docker, security: is it safe to run applications in Linux Containers?
LXC, Docker, security: is it safe to run applications in Linux Containers?LXC, Docker, security: is it safe to run applications in Linux Containers?
LXC, Docker, security: is it safe to run applications in Linux Containers?
 
Introduction to Docker and deployment and Azure
Introduction to Docker and deployment and AzureIntroduction to Docker and deployment and Azure
Introduction to Docker and deployment and Azure
 
Docker internals
Docker internalsDocker internals
Docker internals
 

Viewers also liked

Virtual Server Virtual Server
Virtual Server Virtual ServerVirtual Server Virtual Server
Virtual Server Virtual Serverwebhostingguy
 
Towards an Instructional Design Motivational Framework to Address the Retenti...
Towards an Instructional Design Motivational Framework to Address the Retenti...Towards an Instructional Design Motivational Framework to Address the Retenti...
Towards an Instructional Design Motivational Framework to Address the Retenti...
Dr Stylianos Mystakidis
 
Playful Blended Digital Storytelling in 3D Immersive eLearning Environments f...
Playful Blended Digital Storytelling in 3D Immersive eLearning Environments f...Playful Blended Digital Storytelling in 3D Immersive eLearning Environments f...
Playful Blended Digital Storytelling in 3D Immersive eLearning Environments f...
Dr Stylianos Mystakidis
 
Social Media & Web 2.0 Services for Choirs
Social Media & Web 2.0 Services for ChoirsSocial Media & Web 2.0 Services for Choirs
Social Media & Web 2.0 Services for Choirs
Dr Stylianos Mystakidis
 
Operation Payback (...is a bitch): Hacktivism at the Dawn of Copyright Contro...
Operation Payback (...is a bitch): Hacktivism at the Dawn of Copyright Contro...Operation Payback (...is a bitch): Hacktivism at the Dawn of Copyright Contro...
Operation Payback (...is a bitch): Hacktivism at the Dawn of Copyright Contro...
PaleFire
 
The Constellation Query Language
The Constellation Query LanguageThe Constellation Query Language
The Constellation Query Language
Clifford Heath
 
Hacktivism in Virtual Worlds
Hacktivism in Virtual WorldsHacktivism in Virtual Worlds
Hacktivism in Virtual Worlds
PaleFire
 
The Attack of the Learning Clones
The Attack of the Learning ClonesThe Attack of the Learning Clones
The Attack of the Learning Clones
Dr Stylianos Mystakidis
 
Re-Negotiating Narrative: Emergent Storytelling
Re-Negotiating Narrative: Emergent StorytellingRe-Negotiating Narrative: Emergent Storytelling
Re-Negotiating Narrative: Emergent StorytellingPaleFire
 
Information Literacy and Smart Life-Long Learning: Knowledge Antidotes in the...
Information Literacy and Smart Life-Long Learning: Knowledge Antidotes in the...Information Literacy and Smart Life-Long Learning: Knowledge Antidotes in the...
Information Literacy and Smart Life-Long Learning: Knowledge Antidotes in the...
Dr Stylianos Mystakidis
 
Εκπαίδευση Web 2.0 στο Δημόσιο
Εκπαίδευση Web 2.0 στο ΔημόσιοΕκπαίδευση Web 2.0 στο Δημόσιο
Εκπαίδευση Web 2.0 στο Δημόσιο
Dr Stylianos Mystakidis
 
Oslobodimo Hardware
Oslobodimo HardwareOslobodimo Hardware
Oslobodimo Hardware
Dobrica Pavlinušić
 
Χριστούγεννα χωρίς Χριστό
Χριστούγεννα χωρίς ΧριστόΧριστούγεννα χωρίς Χριστό
Χριστούγεννα χωρίς Χριστό
Dr Stylianos Mystakidis
 
Spectacular Subcultures: From luz to hacktivism
Spectacular Subcultures: From luz to hacktivismSpectacular Subcultures: From luz to hacktivism
Spectacular Subcultures: From luz to hacktivismPaleFire
 
Poaching LG15: ARG-style
Poaching LG15: ARG-stylePoaching LG15: ARG-style
Poaching LG15: ARG-stylePaleFire
 
Open Education in Virtual Worlds
Open Education in Virtual WorldsOpen Education in Virtual Worlds
Open Education in Virtual Worlds
Dr Stylianos Mystakidis
 

Viewers also liked (20)

Virtual Server Virtual Server
Virtual Server Virtual ServerVirtual Server Virtual Server
Virtual Server Virtual Server
 
Towards an Instructional Design Motivational Framework to Address the Retenti...
Towards an Instructional Design Motivational Framework to Address the Retenti...Towards an Instructional Design Motivational Framework to Address the Retenti...
Towards an Instructional Design Motivational Framework to Address the Retenti...
 
Morocco
MoroccoMorocco
Morocco
 
Playful Blended Digital Storytelling in 3D Immersive eLearning Environments f...
Playful Blended Digital Storytelling in 3D Immersive eLearning Environments f...Playful Blended Digital Storytelling in 3D Immersive eLearning Environments f...
Playful Blended Digital Storytelling in 3D Immersive eLearning Environments f...
 
Social Media & Web 2.0 Services for Choirs
Social Media & Web 2.0 Services for ChoirsSocial Media & Web 2.0 Services for Choirs
Social Media & Web 2.0 Services for Choirs
 
Operation Payback (...is a bitch): Hacktivism at the Dawn of Copyright Contro...
Operation Payback (...is a bitch): Hacktivism at the Dawn of Copyright Contro...Operation Payback (...is a bitch): Hacktivism at the Dawn of Copyright Contro...
Operation Payback (...is a bitch): Hacktivism at the Dawn of Copyright Contro...
 
The Constellation Query Language
The Constellation Query LanguageThe Constellation Query Language
The Constellation Query Language
 
Web scale monitoring
Web scale monitoringWeb scale monitoring
Web scale monitoring
 
Hacktivism in Virtual Worlds
Hacktivism in Virtual WorldsHacktivism in Virtual Worlds
Hacktivism in Virtual Worlds
 
Ppt Demo Slideshare
Ppt Demo SlidesharePpt Demo Slideshare
Ppt Demo Slideshare
 
The Attack of the Learning Clones
The Attack of the Learning ClonesThe Attack of the Learning Clones
The Attack of the Learning Clones
 
Re-Negotiating Narrative: Emergent Storytelling
Re-Negotiating Narrative: Emergent StorytellingRe-Negotiating Narrative: Emergent Storytelling
Re-Negotiating Narrative: Emergent Storytelling
 
Information Literacy and Smart Life-Long Learning: Knowledge Antidotes in the...
Information Literacy and Smart Life-Long Learning: Knowledge Antidotes in the...Information Literacy and Smart Life-Long Learning: Knowledge Antidotes in the...
Information Literacy and Smart Life-Long Learning: Knowledge Antidotes in the...
 
Εκπαίδευση Web 2.0 στο Δημόσιο
Εκπαίδευση Web 2.0 στο ΔημόσιοΕκπαίδευση Web 2.0 στο Δημόσιο
Εκπαίδευση Web 2.0 στο Δημόσιο
 
Oslobodimo Hardware
Oslobodimo HardwareOslobodimo Hardware
Oslobodimo Hardware
 
Χριστούγεννα χωρίς Χριστό
Χριστούγεννα χωρίς ΧριστόΧριστούγεννα χωρίς Χριστό
Χριστούγεννα χωρίς Χριστό
 
Spectacular Subcultures: From luz to hacktivism
Spectacular Subcultures: From luz to hacktivismSpectacular Subcultures: From luz to hacktivism
Spectacular Subcultures: From luz to hacktivism
 
Poaching LG15: ARG-style
Poaching LG15: ARG-stylePoaching LG15: ARG-style
Poaching LG15: ARG-style
 
Test
TestTest
Test
 
Open Education in Virtual Worlds
Open Education in Virtual WorldsOpen Education in Virtual Worlds
Open Education in Virtual Worlds
 

Similar to Virtualization which isn't: LXC (Linux Containers)

LXC on Ganeti
LXC on GanetiLXC on Ganeti
LXC on Ganeti
kawamuray
 
Talk 160920 @ Cat System Workshop
Talk 160920 @ Cat System WorkshopTalk 160920 @ Cat System Workshop
Talk 160920 @ Cat System Workshop
Quey-Liang Kao
 
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
Venkat Raman
 
Docker 原理與實作
Docker 原理與實作Docker 原理與實作
Docker 原理與實作
kao kuo-tung
 
Fedora Virtualization Day: Linux Containers & CRIU
Fedora Virtualization Day: Linux Containers & CRIUFedora Virtualization Day: Linux Containers & CRIU
Fedora Virtualization Day: Linux Containers & CRIUAndrey Vagin
 
2. Vagin. Linux containers. June 01, 2013
2. Vagin. Linux containers. June 01, 20132. Vagin. Linux containers. June 01, 2013
2. Vagin. Linux containers. June 01, 2013
ru-fedora-moscow-2013
 
Lightweight Virtualization: LXC Best Practices
Lightweight Virtualization: LXC Best PracticesLightweight Virtualization: LXC Best Practices
Lightweight Virtualization: LXC Best PracticesWerner Fischer
 
Linux Containers & Docker
Linux Containers & DockerLinux Containers & Docker
Linux Containers & Docker
Jumping Bean
 
VLANs in the Linux Kernel
VLANs in the Linux KernelVLANs in the Linux Kernel
VLANs in the Linux Kernel
Kernel TLV
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Prague
tomasbart
 
Docker and-containers-for-development-and-deployment-scale12x
Docker and-containers-for-development-and-deployment-scale12xDocker and-containers-for-development-and-deployment-scale12x
Docker and-containers-for-development-and-deployment-scale12x
rkr10
 
Security of Linux containers in the cloud
Security of Linux containers in the cloudSecurity of Linux containers in the cloud
Security of Linux containers in the cloud
Dobrica Pavlinušić
 
Develop QNAP NAS App by Docker
Develop QNAP NAS App by DockerDevelop QNAP NAS App by Docker
Develop QNAP NAS App by Docker
Terry Chen
 
Docker Introduction + what is new in 0.9
Docker Introduction + what is new in 0.9 Docker Introduction + what is new in 0.9
Docker Introduction + what is new in 0.9 Jérôme Petazzoni
 
Docker Introduction, and what's new in 0.9 — Docker Palo Alto at RelateIQ
Docker Introduction, and what's new in 0.9 — Docker Palo Alto at RelateIQDocker Introduction, and what's new in 0.9 — Docker Palo Alto at RelateIQ
Docker Introduction, and what's new in 0.9 — Docker Palo Alto at RelateIQ
Jérôme Petazzoni
 
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
 
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
dotCloud
 
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Docker, Inc.
 
VMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep DiveVMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld
 

Similar to Virtualization which isn't: LXC (Linux Containers) (20)

LXC on Ganeti
LXC on GanetiLXC on Ganeti
LXC on Ganeti
 
Talk 160920 @ Cat System Workshop
Talk 160920 @ Cat System WorkshopTalk 160920 @ Cat System Workshop
Talk 160920 @ Cat System Workshop
 
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
 
Docker 原理與實作
Docker 原理與實作Docker 原理與實作
Docker 原理與實作
 
Fedora Virtualization Day: Linux Containers & CRIU
Fedora Virtualization Day: Linux Containers & CRIUFedora Virtualization Day: Linux Containers & CRIU
Fedora Virtualization Day: Linux Containers & CRIU
 
2. Vagin. Linux containers. June 01, 2013
2. Vagin. Linux containers. June 01, 20132. Vagin. Linux containers. June 01, 2013
2. Vagin. Linux containers. June 01, 2013
 
Lightweight Virtualization: LXC Best Practices
Lightweight Virtualization: LXC Best PracticesLightweight Virtualization: LXC Best Practices
Lightweight Virtualization: LXC Best Practices
 
Linux Containers & Docker
Linux Containers & DockerLinux Containers & Docker
Linux Containers & Docker
 
VLANs in the Linux Kernel
VLANs in the Linux KernelVLANs in the Linux Kernel
VLANs in the Linux Kernel
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Prague
 
Docker and-containers-for-development-and-deployment-scale12x
Docker and-containers-for-development-and-deployment-scale12xDocker and-containers-for-development-and-deployment-scale12x
Docker and-containers-for-development-and-deployment-scale12x
 
Security of Linux containers in the cloud
Security of Linux containers in the cloudSecurity of Linux containers in the cloud
Security of Linux containers in the cloud
 
Develop QNAP NAS App by Docker
Develop QNAP NAS App by DockerDevelop QNAP NAS App by Docker
Develop QNAP NAS App by Docker
 
Docker Introduction + what is new in 0.9
Docker Introduction + what is new in 0.9 Docker Introduction + what is new in 0.9
Docker Introduction + what is new in 0.9
 
Docker Introduction, and what's new in 0.9 — Docker Palo Alto at RelateIQ
Docker Introduction, and what's new in 0.9 — Docker Palo Alto at RelateIQDocker Introduction, and what's new in 0.9 — Docker Palo Alto at RelateIQ
Docker Introduction, and what's new in 0.9 — Docker Palo Alto at RelateIQ
 
Linux Containers
Linux ContainersLinux Containers
Linux Containers
 
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
 
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
 
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
 
VMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep DiveVMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep Dive
 

More from Dobrica Pavlinušić

Mainline kernel on ARM Tegra20 devices that are left behind on 2.6 kernels
Mainline kernel on ARM Tegra20 devices that are left behind on 2.6 kernelsMainline kernel on ARM Tegra20 devices that are left behind on 2.6 kernels
Mainline kernel on ARM Tegra20 devices that are left behind on 2.6 kernels
Dobrica Pavlinušić
 
Linux+sensor+device-tree+shell=IoT !
Linux+sensor+device-tree+shell=IoT !Linux+sensor+device-tree+shell=IoT !
Linux+sensor+device-tree+shell=IoT !
Dobrica Pavlinušić
 
bro - what is in my network?
bro - what is in my network?bro - what is in my network?
bro - what is in my network?
Dobrica Pavlinušić
 
Let's hack cheap hardware 2016 edition
Let's hack cheap hardware 2016 editionLet's hack cheap hardware 2016 edition
Let's hack cheap hardware 2016 edition
Dobrica Pavlinušić
 
Raspberry Pi - best friend for all your GPIO needs
Raspberry Pi - best friend for all your GPIO needsRaspberry Pi - best friend for all your GPIO needs
Raspberry Pi - best friend for all your GPIO needs
Dobrica Pavlinušić
 
Cheap, good, hackable tools from China: AVR component tester
Cheap, good, hackable tools from China: AVR component testerCheap, good, hackable tools from China: AVR component tester
Cheap, good, hackable tools from China: AVR component tester
Dobrica Pavlinušić
 
Ganeti - build your own cloud
Ganeti - build your own cloudGaneti - build your own cloud
Ganeti - build your own cloud
Dobrica Pavlinušić
 
FSEC 2014 - I can haz your board with JTAG
FSEC 2014 - I can haz your board with JTAGFSEC 2014 - I can haz your board with JTAG
FSEC 2014 - I can haz your board with JTAG
Dobrica Pavlinušić
 
Hardware hacking for software people
Hardware hacking for software peopleHardware hacking for software people
Hardware hacking for software people
Dobrica Pavlinušić
 
Gnu linux on arm for $50 - $100
Gnu linux on arm for $50 - $100Gnu linux on arm for $50 - $100
Gnu linux on arm for $50 - $100
Dobrica Pavlinušić
 
This is an interesting metadata source. Can I import it into Koha?
This is an interesting metadata source. Can I import it into Koha?This is an interesting metadata source. Can I import it into Koha?
This is an interesting metadata source. Can I import it into Koha?Dobrica Pavlinušić
 
SysAdmin cookbook
SysAdmin cookbookSysAdmin cookbook
SysAdmin cookbook
Dobrica Pavlinušić
 
KohaCon11: Integrating Koha with RFID system
KohaCon11: Integrating Koha with RFID systemKohaCon11: Integrating Koha with RFID system
KohaCon11: Integrating Koha with RFID system
Dobrica Pavlinušić
 
Deploy your own P2P network
Deploy your own P2P networkDeploy your own P2P network
Deploy your own P2P network
Dobrica Pavlinušić
 
Free Libre Open Source Software at FFZG library
Free Libre Open Source Software at FFZG libraryFree Libre Open Source Software at FFZG library
Free Libre Open Source Software at FFZG library
Dobrica Pavlinušić
 
Post-relational databases: What's wrong with web development? v3
Post-relational databases: What's wrong with web development? v3Post-relational databases: What's wrong with web development? v3
Post-relational databases: What's wrong with web development? v3
Dobrica Pavlinušić
 
Slobodni softver za digitalne arhive: EPrints u Knjižnici Filozofskog fakulte...
Slobodni softver za digitalne arhive: EPrints u Knjižnici Filozofskog fakulte...Slobodni softver za digitalne arhive: EPrints u Knjižnici Filozofskog fakulte...
Slobodni softver za digitalne arhive: EPrints u Knjižnici Filozofskog fakulte...Dobrica Pavlinušić
 
Post-relational databases: What's wrong with web development?
Post-relational databases: What's wrong with web development?Post-relational databases: What's wrong with web development?
Post-relational databases: What's wrong with web development?Dobrica Pavlinušić
 
Mojo Facets – so, you have data and browser?
Mojo Facets – so, you have data and browser?Mojo Facets – so, you have data and browser?
Mojo Facets – so, you have data and browser?
Dobrica Pavlinušić
 

More from Dobrica Pavlinušić (20)

Mainline kernel on ARM Tegra20 devices that are left behind on 2.6 kernels
Mainline kernel on ARM Tegra20 devices that are left behind on 2.6 kernelsMainline kernel on ARM Tegra20 devices that are left behind on 2.6 kernels
Mainline kernel on ARM Tegra20 devices that are left behind on 2.6 kernels
 
Linux+sensor+device-tree+shell=IoT !
Linux+sensor+device-tree+shell=IoT !Linux+sensor+device-tree+shell=IoT !
Linux+sensor+device-tree+shell=IoT !
 
bro - what is in my network?
bro - what is in my network?bro - what is in my network?
bro - what is in my network?
 
Let's hack cheap hardware 2016 edition
Let's hack cheap hardware 2016 editionLet's hack cheap hardware 2016 edition
Let's hack cheap hardware 2016 edition
 
Raspberry Pi - best friend for all your GPIO needs
Raspberry Pi - best friend for all your GPIO needsRaspberry Pi - best friend for all your GPIO needs
Raspberry Pi - best friend for all your GPIO needs
 
Cheap, good, hackable tools from China: AVR component tester
Cheap, good, hackable tools from China: AVR component testerCheap, good, hackable tools from China: AVR component tester
Cheap, good, hackable tools from China: AVR component tester
 
Ganeti - build your own cloud
Ganeti - build your own cloudGaneti - build your own cloud
Ganeti - build your own cloud
 
FSEC 2014 - I can haz your board with JTAG
FSEC 2014 - I can haz your board with JTAGFSEC 2014 - I can haz your board with JTAG
FSEC 2014 - I can haz your board with JTAG
 
Hardware hacking for software people
Hardware hacking for software peopleHardware hacking for software people
Hardware hacking for software people
 
Gnu linux on arm for $50 - $100
Gnu linux on arm for $50 - $100Gnu linux on arm for $50 - $100
Gnu linux on arm for $50 - $100
 
This is an interesting metadata source. Can I import it into Koha?
This is an interesting metadata source. Can I import it into Koha?This is an interesting metadata source. Can I import it into Koha?
This is an interesting metadata source. Can I import it into Koha?
 
SysAdmin cookbook
SysAdmin cookbookSysAdmin cookbook
SysAdmin cookbook
 
Printing on Linux, simple right?
Printing on Linux, simple right?Printing on Linux, simple right?
Printing on Linux, simple right?
 
KohaCon11: Integrating Koha with RFID system
KohaCon11: Integrating Koha with RFID systemKohaCon11: Integrating Koha with RFID system
KohaCon11: Integrating Koha with RFID system
 
Deploy your own P2P network
Deploy your own P2P networkDeploy your own P2P network
Deploy your own P2P network
 
Free Libre Open Source Software at FFZG library
Free Libre Open Source Software at FFZG libraryFree Libre Open Source Software at FFZG library
Free Libre Open Source Software at FFZG library
 
Post-relational databases: What's wrong with web development? v3
Post-relational databases: What's wrong with web development? v3Post-relational databases: What's wrong with web development? v3
Post-relational databases: What's wrong with web development? v3
 
Slobodni softver za digitalne arhive: EPrints u Knjižnici Filozofskog fakulte...
Slobodni softver za digitalne arhive: EPrints u Knjižnici Filozofskog fakulte...Slobodni softver za digitalne arhive: EPrints u Knjižnici Filozofskog fakulte...
Slobodni softver za digitalne arhive: EPrints u Knjižnici Filozofskog fakulte...
 
Post-relational databases: What's wrong with web development?
Post-relational databases: What's wrong with web development?Post-relational databases: What's wrong with web development?
Post-relational databases: What's wrong with web development?
 
Mojo Facets – so, you have data and browser?
Mojo Facets – so, you have data and browser?Mojo Facets – so, you have data and browser?
Mojo Facets – so, you have data and browser?
 

Recently uploaded

PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 

Recently uploaded (20)

PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 

Virtualization which isn't: LXC (Linux Containers)

  • 1. Virtualization which isn't LXC (Linux Containers) Dobrica Pavlinušić http://blog.rot13.org DORS/CLUC, Zagreb, 2011-05-16
  • 2. Content ● Virtualizations ● Vserver, Xen, OpenVZ, sVirt, LXC ● KVM, VirtualBox, VMWare ● cgroup ● Linux Containers
  • 3. Virtualization overview ● Xen ● Separate host i guest kernel (dom0, domU) ● Not upstream, massive duplication of kernel code ● Linux Vserver, OpenVZ (Virtuozzo), sVirt (SELinux based) ● Single kernel, out-of-tree patches ● Linux Containers - LXC ● chroot on steroids, based on cgroup Linux support ● Part of standard kernel, based on things you already know! ● Full-system virtualization: KVM, VirtualBox, VMWare ● But you can run LXC inside them! (e.g. EC2)
  • 4. cgroup ● Process namespace in kernel ● Devices (even X11 in LXC!) ● CPU (sched, cpu account, cpuset) - NUMA ● Memory (not in Debian's kernel) ● Block I/O scheduling, limits ● Linus' 2.6.38 magic patch ● Setsid create new scheduler entry ● Used by Google Chrome, systemd...
  • 5. Linux containers - LXC dpavlin@klin:~$ lxc-checkconfig dpavlin@klin:/usr/bin$ ls lxc-* Kernel config /proc/config.gz not found, looking in other lxc-checkconfig places... lxc-execute Found kernel config file /boot/config-2.6.38-2-686 lxc-start --- Namespaces --- lxc-stop Namespaces: enabled lxc-info Utsname namespace: enabled Ipc namespace: enabled lxc-console Pid namespace: enabled lxc-create User namespace: enabled lxc-destroy Network namespace: enabled lxc-ls Multiple /dev/pts instances: enabled lxc-ps lxc-netstat --- Control groups --- lxc-restart Cgroup: enabled lxc-cgroup Cgroup namespace: enabled lxc-freeze Cgroup device: enabled lxc-kill Cgroup sched: enabled lxc-monitor Cgroup cpu account: enabled lxc-setcap Cgroup memory controller: missing lxc-setuid Cgroup cpuset: enabled lxc-unfreeze lxc-unshare --- Misc --- Veth pair device: enabled lxc-version Macvlan: enabled Lxc-wait Vlan: enabled lxc-attach File capabilities: missing lxc-checkpoint
  • 6. LXC: Network ● veth ● Bridge on host, (virtual) device inside container ● vlan ● Select packets by IP address ● macvlan ● Select packets by MAC address ● phys ● Move host interface inside container (routing fun!) ● Empty ● Only loopback
  • 7. LXC: limit resources ● Cores ● lxc.cgroup.cpuset.cpus=1,2,3 ● CPU share ● lxc.cgroup.cpu.shares=1024 # default ● Memory usage (!Debian) ● lxc.cgroup.memory.limit_in_bytes = 256M ● lxc.cgroup.memory.memsw.limit_in_bytes = 1G ● Disk (blkio) ● Disk space – standard LVM, quota... ● echo 100 > /cgroup/disk1/blkio.weight # XXX < 1000 ! ● echo "3:0 1048576" > /cgroup/disk1/blkio.throttle.read_bps_device
  • 8. Start LXC container ● Start single process in container ● lxc-execute -n container -- /bin/bash ● Whole operating system ● Mounting filesystems, etc from config file ● Application is /bin/init ● lxc-start -n container ● lxc-console -n container ● lxc-stop -n container
  • 9. Templates: lxc-create # /usr/lib/lxc/templates/ export MIRROR=http://192.168.1.20:3142/ftp.debian.org export SUITE=lenny cat <<_EOF_ > /tmp/lenny.conf lxc.network.type=veth lxc.network.link=br0 lxc.network.flags=up EOF t61p:~# lxc-create -n lenny -t debian -f /tmp/lenny.conf
  • 10. Container overview ● /var/lib/lxc/container/config ● Familiar commands ● lxc-ls ● lxc-info ● lxc-ps ● lxc-netstat ● htop --enable-group > r192 ● /proc inside contauner isn't fully isolated! ● Depends on namespace support in kernel
  • 11. Under construction ● Still not in: Linux 2.6.38.2 ● lxc-attach ● Attach process (bash) inside running container ● Needed to set default route outside container ● lxc-checkpoint ● Similar to lxc-(un)freeze with checkpoint to disk ● https://ckpt.wiki.kernel.org/
  • 12. LXC summary ● Isolate ● one application – lxc-execute ● whole OS – lxc-start ● use templates (lxc-create) ● Familiar Linux networking (bridges) ● Limiting features varies (kernel config/version) ● Ready to use today!