This lab will allow you to practice installing LXC/LXD in a cloud server environment. You will pull down the latest Alpine image and create a container from it to test your configuration.
**Note: Use Alpine 3.14 for the lab.**
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Install the LXD Package
Verify which Linux distribution your server is running.
cat /etc/issue
Install
lxd
andlxd-client
.sudo apt-get install lxd lxd-client
- Initialize LXD
Initialize LXD.
sudo lxd init
- Create Your First Container
Create a container using Alpine 3.8 named
my-alpine
.sudo lxc launch images:alpine/3.14 my-alpine
- List the Containers
List your containers.
sudo lxc list
- Connect to a Container
Execute an ash shell in your
my-alpine
container.sudo lxc exec my-alpine -- /bin/ash
Create a file named
hello.txt
.echo hello world > hello.txt