This page offers more in-depth information on LXD itself. To learn how to set up LXD with Juju see Using LXD with Juju.
The topics presented here are:
- Useful LXD client commands
- Using the LXD snap
- LXD logs
- Further LXD help and reading
Useful LXD client commands
There are many client commands available. Some common ones, including those covered above, are given below.
||creates an LXD container|
||lists all LXD containers|
||deletes an LXD container|
||displays status of localhost|
||displays status of container|
||displays configuration of container|
||displays status of image|
||runs program on container|
||spawns shell on container|
||copies file from container|
||copies file to container|
||lists cached images|
||deletes image alias|
||creates image alias|
||lists cluster nodes|
||displays configuration of a cluster node|
Using the LXD snap
The LXD project will soon be moving from the APT installation method (Debian package) to installing via a snap. Some users may want to opt in early, before building their infrastructure, as moving to the snap entails a migration of containers. The LXD snap is very well tested (as is the included migration tool).
First ensure that
snapd is installed:
sudo apt install snapd
On Ubuntu 14.04 LTS (Trusty), installing
snapd will bring in a new kernel (4.4.0 series) as a dependency. You will then need to reboot. Attempting to install a snap without doing so will result in failure.
Now install the LXD snap:
sudo snap install lxd
If LXD is already installed via APT and there are no existing containers under the current installation then simply remove the software:
sudo apt purge liblxc1 lxcfs lxd lxd-client
If containers do exist under the old system the
lxd.migrate utility should be used to migrate them so that they can be managed by the snap binaries. Once the migration is complete, you will be prompted to have the old software removed.
Start the migration tool by running:
LXD itself logs to
/var/log/lxd/lxd.log and Juju machines created via the LXD local provider log to
/var/log/lxd/juju-UUID-machine-ID. However, the standard way to view logs is with the
debug-log command (see the Juju logs page for details).
For LXD snap users, the log directory is located at
Further help and reading
lxc --help for more information on LXD client usage and
lxd --help for assistance with the daemon. See upstream documentation for LXD configuration.