Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

LXC is in between a VM and a pure application container. It will take up more resources than a pure container, but unlike a VM use as much memory as needed. It will provide a full kernel and OS (albeit it must be Linux). Unlike a VM, LXD container will have access to the resources and speed of the hardware without needing to emulate hardware.. If  If you are interested in Docker or Cloud, not yet ready to give up your ssh console, start here. Learning LXC, you'll also really understand how Docker and Cloud works under the hoods.

Panel

What about LXD? LXD is another higher level layer on top of LXC that is more orchestration friendly.

The key enablement for orchestration is remote API calls and higher level functions. LXD still uses LXC under the hoods. As of Oct 2016, LXD 2.0 is now available and hooking up with orchestration via Juju.

This tutorial was originally written before LXD was ready for production . I will write an LXD article too soon, however, LXC is still what powers LXD under the hoods, this is a worthwhile readand evolved to be the precursor to the LXD tutorial.

When an container is created (last updated with Ubuntu 16.04.1) it is tiny,

AttributeSizeComment
Disk Space337 MBThat's the entire operating system because it can mount shared core kernel files from the Host. Better yet as Read-Only
Memory (externally viewing Container)12.96 MiB ~ 1.7 MBUsing lxc-info which excludes the shared kernal memory
Memory (Inside Container)5.6 MBSmaller hence because the container leverages the host OS. Note, need to speak to LXC guys to understandy why external versus internal difference.
Processes (Inside Container)15Container leverages the host OS.

Limitations

Kernel There are some kernel functionality list that cannot be used inside of a container,

  • Firewall
  • Mounting External File Systems - Instead Mount in the host OS and then share to the container

Install

Install LXC,

Code Block
languagebash
sudo apt-get install lxc

...