1. What is LXD & Use Cases
LXD is a modern, secure, and powerful system-level container and lightweight VM manager, with core technologies being LXC (for containers) and QEMU (for virtual machines).
Core Difference from Docker
LXD is more like a "lightweight VM manager". The instances it creates have complete operating system environments (independent init
, systemd
, SSH
services, etc.), making you feel like managing a real physical machine or cloud host. Docker focuses more on "packaging and running single processes or applications", with container lifecycle tied to application processes, pursuing ultimate lightness and portability.
2. Installation & Initialization
2.1 Installation
First, confirm your system has snap
installed and enabled.
Install LXD via snap (officially recommended method, auto-updates and includes all dependencies).
2.2 Initialization
After installation, run the interactive initialization wizard to configure LXD.
The wizard will guide you through configuring storage pools, networks, image servers, etc. For beginners, accepting defaults is usually fine.
3. Basic Concepts Quick Reference
ubuntu/22.04
.4. Quick Start (Containers & VMs)
4.1 Create and Enter Container
4.2 Create and Use VM
4.3 Basic Lifecycle Management
5. Essential Commands Summary
Command | Description |
---|---|
lxc launch [image] [name] | Create and start a new instance |
lxc list | List all instances |
lxc exec [instance] -- [command] | Execute command in instance |
lxc stop/start/restart [instance] | Stop/start/restart instance |
lxc snapshot [instance] [name] | Create snapshot for instance |
lxc file push/pull | Transfer files between host and instance |
6. Next Steps
đ ī¸ Practice
Set up development environments and experiment with different configurations.
View Commands â