I’m trying to set up LXD on Ubuntu 18.04 (clean install, no prior LXC/D) but am running into some issues.
I ran sudo lxd init with limited success:
bridge creation failed with Failed to automatically find an unused IPv6 subnet, manual configuration required, so I did that manually with ipv6.address=none.
Btrfs subvolume does NOT get created for the user, as the storage prompts (imo) suggest. I had to do it manually, i.e.
The permission issue for ~/.config/lxc is because lxd init was run through sudo. sudo chown -R your-user:your-user ~/.config/lxc should fix that.
The IPv6 error suggests that you had an odd IPv6 route at the time which was covering the entirety of the ULA range, making LXD fail to find an unused one for you. When that happens you either need to choose one by hand or indeed use none to just disable IPv6 on the bridge.
The storage issue is odd and is something we’ve not seen anyone report before. It’d be great if you could show the entire output of that lxd init run. If you are to run this again on a similar system, please record that output as well as the YAML that it offers to show you at the end.
To fix your storage for now, you can do:
lxc profile device add default root disk path=/ pool=lxc
Which will tie your manually created storage pool with the default profile.
I’ll chown back to my $USER. Generally speaking, should one run lxd init with sudo or better not? I presume if one wishes to use the init script to set up bridge, storage, routing, then that’s required.
Regarding storage, is path relative to the default storage backend, so that path=/ implies path=/path/to/btr-store (btrfs top-level) and pool refers the subvolume?
Here’s is how my default profile looks like now:
$ lxc profile show default
config: {}
description: Default LXD profile
devices:
eno1:
nictype: bridged
parent: lxcbr0
type: nic
eth0:
name: eth0
nictype: bridged
parent: lxcbr0
type: nic
root: # newly added now
path: /
pool: lxc
type: disk
name: default
used_by: []
Any idea about the eth0 entry? My only nic is eno1 and lxc network list shows:
+--------+----------+---------+-------------+---------+
| NAME | TYPE | MANAGED | DESCRIPTION | USED BY |
+--------+----------+---------+-------------+---------+
| eno1 | physical | NO | | 0 |
+--------+----------+---------+-------------+---------+
| lxcbr0 | bridge | YES | | 0 |
+--------+----------+---------+-------------+---------+
lxd init talks over the LXD API, it doesn’t perform any system change itself and so doesn’t require sudo privileges. At least that’s true for LXD 3.0 and higher, this was different with LXD 2.0.
path=/ means that the container’s root will be stored on that storage pool, so it has to be path=/ for this device.
As for network, you should be removing that eno1 device from your default profile, the eth0 one looks correct assuming you do want to use your existing lxcbr0 bridge.
eth0 here is the name that’ll be used inside the container and is generally what containers expect it to be called.
That doesn’t need to match the name of the device on the host.
You know what, I’ll reinstall LXD fresh and start over. I suspect the fact that lxd init didn’t run smoothly had some configuration side-effects that made things harder. I’ll start a new topic.