User Tools

Site Tools


lxc:install_lxc

This is an old revision of the document!


LXC - Install LXC

sudo snap install lxd

or

sudo apt install lxc

NOTE: The snap version will most likely be more up to date.


Install LXC Utils

sudo apt install lxc-utils

Get Info

lxc info

returns:

If this is your first time running LXD on this machine, you should also run: lxd init
To start your first instance, try: lxc launch ubuntu:18.04

Configure LXD

Before you can create an instance, you need to configure LXD.

lxd init

NOTE: This will prompt for how to configure it. Just take the defaults for now.

  • Would you like to use LXD clustering? (yes/no) [default=no]:
  • Do you want to configure a new storage pool? (yes/no) [default=yes]:
  • Name of the new storage pool [default=default]:
  • Name of the storage backend to use (dir, lvm, ceph, btrfs) [default=btrfs]:
  • Create a new BTRFS pool? (yes/no) [default=yes]:
  • Would you like to use an existing empty block device (e.g. a disk or partition)? (yes/no) [default=no]:
  • Size in GB of the new loop device (1GB minimum) [default=30GB]:
  • Would you like to connect to a MAAS server? (yes/no) [default=no]:
  • Would you like to create a new local network bridge? (yes/no) [default=yes]:
  • What should the new bridge be called? [default=lxdbr0]:
  • What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
  • What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
  • Would you like LXD to be available over the network? (yes/no) [default=no]:
  • Would you like stale cached images to be updated automatically? (yes/no) [default=yes]
  • Would you like a YAML “lxd init” preseed to be printed? (yes/no) [default=no]:

Create ~/.config/lxc

mkdir ~/.config/lxc

Create ~/.config/lxc/default.conf

~/.config/lxc/default.conf
lxc.include = /etc/lxc/default.conf
lxc.idmap = u 0 100000 65536
lxc.idmap = g 0 100000 65536

References

lxc/install_lxc.1609692760.txt.gz · Last modified: 2021/01/03 16:52 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki