Linux Containers are self-contained execution environment with their own isolated hardware resources ( CPU/RAM/HD). They share the kernel of the host operation system.
LXD is an ultra-fast Linux only Hypervisor doesn’t stimulate or emulate the hardware itself.
Virtual machines can be emulated by the hypervisor or Para virtualized by the processor. In addition to each physical host running its own operating system, each virtual machine runs a copy of its own operating system on top of the virtualized hardware. Separate copies of libraries are maintained n each VMs
Containers rely on isolation techniques like control groups and namespaces to separate applications. They do not have additional overhead of a hypervisor and can share libraries if needed. Containers share the physical host kernel so do not require an OS.
Docker provides application containers, LXC contains the machine containers VMs, Docker provides application containers (self-contained applications) Machine containers are designed to bundle up the full OS on the file system and Docker contains only have exactly have process and dependencies that they required in order to run single application.
LXC is the user space interface for the Linux kernel containment features and manages kernel namespaces. LXC relies more on OS features for networking and storage than Docker does. LXD is the containers hypervisor consisting of the daemon, lxd, the client lxc and nova-lxd (Openstack plugin)
The Docker Engine wraps Applications within a self-contained file system instead of a base userspace image like LXD does. Docker contains the app and usually base image, so we can treat the whole container as a single process in the Docker Engine. Docker container designed to be stateless.
Btrfs (butter/better FS) file system based on the copy-on-write (COW) principle designed by Oracle.
LXD Installation (Ubuntu 16.04) and Launching Container
- Installing LXD: apt install lxd lxd-client
- Initializing LXD: lxd init
- Listing Images: lxc image list
- Listing Containers : lxc list
- Launching Container : lxc launch ubuntu:16.04 ubuntu
- Connect to the Container: lxc exec ubuntu — /bin/bash