Managing LXD containers
We have installed LXD and deployed our first container with it. In this recipe, we will learn various LXD commands that manage the container lifecycle.
Getting ready…
Make sure that you have followed the previous recipes and created your first container.
How to do it…
Follow these steps to manage LXD containers:
Before we start with container management, we will need a running container. If you have been following the previous recipes, you should already have a brand new container running on your system. If your container is not already running, you can start it with the
lxc start
command:$ lxc start c1
To check the current state of a container, use
lxc list
, as follows:$ lxc list c1
This command should list only containers that have
c1
in their name.You can also set the container to start automatically. Set the
boot.autostart
configuration option totrue
and your container will start automatically on system boot. Additionally, you can specify a delay before autostart...