On the one hand, I was asked to install lxd with snap. On the other hand, snap reported “lxd” is already installed. I had several containers created using lxd via “sudo lxc launch ubuntu:20.04 myContainer”.
$ sudo lxc list
Command '/usr/bin/lxc' requires the lxd snap to be installed.
Please install it with:
snap install lxd
$snap install lxd
snap "lxd" is already installed, see 'snap help refresh'
$snap refresh
All snaps up to date.
Below are the steps how I ended up being stuck.
1. LXD worked fine.
2. I ran the lxc-start command “sudo lxc-start -n ubuntu_2021_09_19 -f /home/lxc-left.conf -d”. Then I saw a lot of alerts of system errors.
3. I rebooted and tried to run lxd:
$ sudo lxc launch ubuntu:20.04 vas
cat: /proc/self/attr/current: Permission denied
/snap/lxd/21497/commands/lxc: 6: exec: aa-exec: Permission denied
4. ran lxc-start again
$sudo lxc-start -n ubuntu_2021_09_19 -f /home/lxc-left.conf -d
lxc-start: ubuntu_2021_09_19: lxccontainer.c: wait_on_daemonized_start: 859 Received container state “ABORTING” instead of “RUNNING”
lxc-start: ubuntu_2021_09_19: tools/lxc_start.c: main: 308 The container failed to start
lxc-start: ubuntu_2021_09_19: tools/lxc_start.c: main: 311 To get more details, run the container in foreground mode
lxc-start: ubuntu_2021_09_19: tools/lxc_start.c: main: 313 Additional information can be obtained by setting the --logfile and --logpriority options
5. reinstall lxd with apt
$ sudo apt install lxd