Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Google Cloud Platform icon
Labs

Instantiating Containers from Base Images with LXC/LXD

With containers being an important part of any dynamic IT organization, understanding how to work with them is a key component to your success as an engineer. In this activity, you will get a chance with work with images and instantiuate containers using the LXD/LXC container management engine. Once you complete this activity, you will have an understanding of how to pull, start and connect to LXC containers running on your host.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Intermediate
Last updated
Apr 06, 2025
Duration
30m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Reconfigure the LXC/LXD Host

    Using the requirements from your Activity Guide, you will need to reconfigure the host to be sure the settings are as intended. You can accomplish that with the following command:

    sudo lxd init
    
  2. Challenge

    Non-privileges User 'cloud_user' Needs to Be Able to Run LXC Commands

    Check /etc/groups, look for the 'lxd' group. If the 'cloud_user' user is not a member, then do:

    sudo usermod -aG lxd cloud_user
    

    To add them. You WILL Have to log completely off and back in for the membership to pick up in the shell (or start a new bash instance without logging out)

  3. Challenge

    Pull a CentOS 7 Image and Run a Container

    You can launch a container instance called 'myweb' based on the CentOS 7 image provided by the default repositories with the command:

    lxc launch images:centos/7 myweb
    

    You can verify with

    lxc list
    

    Which will show the running container. Connecting to it can be done via:

    lxc exec myweb -- /bin/bash
    

    You will be logged into the container. You can log out with 'exit' and then stop the container with

    lxc stop myweb
    

    Verify the image is still there with

    lxc image list
    
About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight