LXD is frequently confused with LXC, and the fact that LXD provides both a
lxd command and a
lxc command doesn’t make things easier.
LXD vs. LXC¶
LXD and LXC are two distinct implementations of Linux containers.
LXC is a low-level user space interface for the Linux kernel containment features.
It consists of tools (
lxc-* commands), templates, and library and language bindings.
LXD is a more intuitive and user-friendly tool aimed at making it easy to work with Linux containers. It is an alternative to LXC’s tools and distribution template system, with the added features that come from being controllable over the network. Under the hood, LXD uses LXC to create and manage the containers.
LXD provides a superset of the features that LXC supports, and it is easier to use. Therefore, if you are unsure which of the tools to use, you should go for LXD. LXC should be seen as an alternative for experienced users that want to run Linux containers on distributions that don’t support LXD.
The central part of LXD is its daemon. It runs persistently in the background, manages the instances, and handles all requests. The daemon provides a REST API that you can access directly or through a client (for example, the default command-line client that comes with LXD).
See Daemon behavior for more information about the LXD daemon.
To control LXD, you typically use two different commands:
- LXD daemon
lxdcommand controls the LXD daemon. Since the daemon is typically started automatically, you hardly ever need to use the
lxdcommand. An exception is the
lxd initsubcommand that you run to initialize LXD.
There are also some subcommands for debugging and administrating the daemon, but they are intended for advanced users only. See
lxd --helpfor an overview of all available subcommands.
- LXD client
lxccommand is a command-line client for LXD, which you can use to interact with the LXD daemon. You use the
lxccommand to manage your instances, the server settings, and overall the entities you create in LXD. See
lxc --helpfor an overview of all available subcommands.
lxctool is not the only client you can use to interact with the LXD daemon. You can also use the API, the UI, or a custom LXD client.