Skip to main content

LXC/LXD Deep Dive


Intro Video

Photo of Terrence Cox

Terrence Cox

Senior Vice President of Content

A veteran of twenty years in Information Technology in a variety of roles. He has worked in development, security and infrastructure well before they merged into what we now call DevOps. He provides training in Linux, VMWare, DevOps (Ansible, Jenkins, etc) as well as containers and AWS topics. He now leads the Training Architects to produce the courses and content we all know and love!









Course Details

"Container" is the new buzzword, but it doesn’t just mean Docker! This course will dive into LXC (LinuX Containers) and its container manager, LXD.  Students will explore how containers work, how they compare with virtual machines and Docker containers, and how they handle application isolation.  Students will get hands-on by installing and configuring containers and thoughtfully selecting a persistent storage strategy.  The course also covers the intricacies of container networking including inter-container communication, managing container networks, and exposing container ports on the host.  For advanced students, several use cases are explored and implemented using this exciting technology.


Getting Started With LXC/LXD

Introduction to LXC/LXD

Course Introduction


Lesson Description:

In this course, we're going to explore everyone's new favorite topic: Containers! We're going to specifically look at LXC containers and how to control them with LXD, as well as networking, storage, and many use cases to get you started.

About the Author

About the Author


Lesson Description:

Chad Miller is a technophile with a love of teaching high tech. So much so, he's been doing it for over 20 years! From database design to Java to OpenStack, he's taught industry professionals just like you.

LXD vs. Docker

LXD vs. Docker


Lesson Description:

In this lesson, we'll explore what a container really is and how LXD containers differ from their Docker counterparts.

LXC/LXD: Installation and Configuration

Installing LXC/LXD

Installing LXD


Lesson Description:

This lesson will walk students through installing LXD and verifying that everything is functioning as designed.

Exercise: Install LXC/LXD


Troubleshooting LXD Installations

Troubleshooting LXD Installations


Lesson Description:

Learn to troubleshoot and repair common installation problems with LXD.

Launching Your First Container

Launching Your First Container, Part 1


Lesson Description:

In this part of the demo, we'll grab an image, alias it, and make a quick web server while we practice LXC commands.

Launching Your First Container, Part 2


Lesson Description:

In this section at the demo, we take a look at the running web server container, make a snapshot, and demonstrate how to restore a container from a snapshot.

Launching Your First Container, Part 3


Lesson Description:

In this continuation of the previous lesson, we'll go a little deeper into snapshots and how they can save you from typographical (and other) errors, as well as some container image basics.

Exercise: Launching Your First Container


LXC/LXD Check Up

LXC/LXD Images

LXC Images

LXC Images Part 1: Remotes


Lesson Description:

In this section, we'll explore remotes, and create our own.

LXC Images Part 2: Publishing, Exporting, and Examining


Lesson Description:

In this lesson, we'll learn to publish snapshots to images, export images to tarballs, and take a look at the anatomy of an LXC image.

LXC Images Part 3: Creating From Scratch


Lesson Description:

This lesson goes over how to create an image from scratch and import it in to LXD.

Exercise: Using and Creating LXC/LXD Images


LXC Images

LXC/LXD Basics

LXC/LXD Persistent Storage

Setting up ZFS with LXD

File Backing Stores


Lesson Description:

In this lesson, we'll look at where the files are stored in the default "dir" file backing store and also see how to integrate ZFS into LXD 2.0.

Exercise: Using ZFS with LXC


LXC Storage Check-up

LXD/LXD Networking

LXC Networking

LXC Networking Part 1: The Basics


Lesson Description:

In this section, you'll see how two containers can communicate successfully over the local bridge network with the host and with one another.

LXC Networking Part 2: Under the Hood!


Lesson Description:

In this lesson, we'll take a look at how LXC handles IP address management and hostname resolution and discuss packet flow from one container to the next.

Exercise: Experimenting with LXC Networking


Exercise: Exposing Container Ports


Multi-Host LXD Share a Discreet Layer-2 Network

Advanced Container Networking, Part 1


Lesson Description:

In this lesson, we'll discuss the problem, "How do we get containers on multiple physical hosts on the same L2 network?"  We'll also discuss one possible solution and get started implementing it!

Advanced Container Networking, Part 2


Lesson Description:

In this lesson, we'll build the GRE tunnel between the hosts and demonstrate the alternate initialization technique to use our own bridge instead of the built-in LXD bridge.  I'll also show you how easy it is to move containers among hosts once you've got everything configured!

Networking Check Up

Container Use Cases with LXC/LXD

LXC/LXD Challenge Exercises

Introduction to Challenge Exercises


Lesson Description:

Brief instructions for the challenge exercises.  Good luck!

Development Web Cluster

Challenge: Development Web Cluster


Lesson Description:

Deploy a bunch of web server containers, load balance them, and access the load balancer from an external network.

Challenge: Development Web Server – My Solution


Lesson Description:

No peeking until you've given it a shot!  In this video, I walk you through my solution to the challenge exercise.

Exercise: Challenge: Create Proxy to Multiple Web Server Containers



Challenge: Deploy a Microservice


Lesson Description:

Here we describe the challenge of deploying a microservice by creating a LEMP or LAMP stack.

Challenge: Deploy a Microservice -- My Solution!


Lesson Description:

You really shouldn't peek at this until you've given it a shot, but here I walk you through my solution to this challenge.

Exercise: Challenge: Deploy a Simple Microservice


Database Replication Testing

Challenge: Database Replication Cluster


Lesson Description:

In this video, we challenge you to create a MariaDB/Galera cluster using Linux Containers!

Challenge: Database Replication Cluster Solution


Lesson Description:

This lesson is a walkthrough of the provided solution.  There are lots of ways to solve this challenge, but here's what I did.

Exercise: Challenge: Set up a Test Galera Cluster


Automatic Backup Testing

Challenge: Automatic Backup Testing


Lesson Description:

The video version of the description of the next challenge exercise: Testing Automatic Backups!

Challenge: Automatic Backup Testing Solution


Lesson Description:

You can find the script we came up with on the exercise solution.  Here is a video walking through our logic and why we made some of the decisions we did.

Exercise: Challenge: Set up Automatic Backup Testing



Where Do I Go From Here?



Lesson Description:

Thanks for taking this course!  Here I talk about some ideas for where to go next!

Take this course and learn a new skill today.

Transform your learning with our all access plan.

Start 7-Day Free Trial