LXD leverages the Linux Container (LXC) system to create light, effective system containers. However, before we begin to use LXC/LXD, we need to ensure we have it properly installed, initialized, and otherwise configured. In this lab, we will install LXD 3.0 Stable on Ubuntu 18.04 and ensure it’s up and running.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Install LXD
Install LXD via
snap
:sudo snap install lxd --channel=3.0/stable
- Add cloud_user to lxd Group
Ensure the
cloud_user
can executelxc
/lxd
commands by adding it to thelxd
group:sudo usermod cloud_user -aG lxd
Log out then log back in.
- Initialize LXD
Initialize LXD and answer the prompts presented:
lxd init
Respond to the prompts as follows:
Would you like to use LXD clustering? (yes/no) [default=no]:
noDo you want to configure a new storage pool? (yes/no) [default=yes]:
yesName of the new storage pool [default=default]:
defaultName of the storage backend to use (btrfs, ceph, dir, lvm, zfs) [default=zfs]:
zfsCreate a new ZFS pool? (yes/no) [default=yes]:
yesWould you like to use an existing block device? (yes/no) [default=no]:
yesPath to the existing block device:
/dev/nvme1n1Would you like to connect to a MAAS server? (yes/no) [default=no]:
noWould you like to create a new local network bridge? (yes/no) [default=yes]:
yesWhat should the new bridge be called? [default=lxdbr0]:
lxdbr0What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
autoWhat IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
autoWould you like LXD to be available over the network? (yes/no) [default=no]:
yesAddress to bind LXD to (not including port) [default=all]:
allPort to bind LXD to [default=8443]:
8443Trust password for new clients:
anypasswordAgain:
anypasswordWould you like stale cached images to be updated automatically? (yes/no) [default=yes]
yesWould you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]:
no