SlideShare ist ein Scribd-Unternehmen logo
1 von 12
Downloaden Sie, um offline zu lesen
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!

Weitere ähnliche Inhalte

Was ist angesagt?

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 KernelOpenVZ
 
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 - LinuxConJé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 containersGoogle
 
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 - copyBoden Russell
 
Linux Containers From Scratch: Makfile MicroVPS
Linux Containers From Scratch: Makfile MicroVPSLinux Containers From Scratch: Makfile MicroVPS
Linux Containers From Scratch: Makfile MicroVPSjoshuasoundcloud
 
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 PetazzoniDocker, 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 containersKernel TLV
 
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-nspawnGá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 SystemdRichard 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 AzureJérôme Petazzoni
 

Was ist angesagt? (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
 

Andere mochten auch

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 ChoirsDr 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 LanguageClifford Heath
 
Hacktivism in Virtual Worlds
Hacktivism in Virtual WorldsHacktivism in Virtual Worlds
Hacktivism in Virtual WorldsPaleFire
 
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
 
Χριστούγεννα χωρίς Χριστό
Χριστούγεννα χωρίς ΧριστόΧριστούγεννα χωρίς Χριστό
Χριστούγεννα χωρίς Χριστό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
 

Andere mochten auch (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
 

Ähnlich wie Virtualization which isn't: LXC (Linux Containers)

LXC on Ganeti
LXC on GanetiLXC on Ganeti
LXC on Ganetikawamuray
 
Talk 160920 @ Cat System Workshop
Talk 160920 @ Cat System WorkshopTalk 160920 @ Cat System Workshop
Talk 160920 @ Cat System WorkshopQuey-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 ContainersVenkat 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, 2013ru-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 & DockerJumping Bean
 
VLANs in the Linux Kernel
VLANs in the Linux KernelVLANs in the Linux Kernel
VLANs in the Linux KernelKernel 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 Praguetomasbart
 
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-scale12xrkr10
 
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 cloudDobrica Pavlinušić
 
Develop QNAP NAS App by Docker
Develop QNAP NAS App by DockerDevelop QNAP NAS App by Docker
Develop QNAP NAS App by DockerTerry Chen
 
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 RelateIQJérôme Petazzoni
 
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
 
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 2013dotCloud
 
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 DiveVMworld
 

Ähnlich wie 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, 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
 
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
 
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
 

Mehr von 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 kernelsDobrica 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ć
 
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 editionDobrica 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 needsDobrica 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 testerDobrica 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 JTAGDobrica Pavlinušić
 
Hardware hacking for software people
Hardware hacking for software peopleHardware hacking for software people
Hardware hacking for software peopleDobrica 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ć
 
KohaCon11: Integrating Koha with RFID system
KohaCon11: Integrating Koha with RFID systemKohaCon11: Integrating Koha with RFID system
KohaCon11: Integrating Koha with RFID systemDobrica 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 libraryDobrica 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? v3Dobrica 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ć
 

Mehr von 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?
 

Kürzlich hochgeladen

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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...Miguel Araújo
 
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.pdfUK Journal
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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 MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
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 BusinessPixlogix Infotech
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
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.pptxMalak Abu Hammad
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 

Kürzlich hochgeladen (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced 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...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
🐬 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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 

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!