LXD Error: Get "http://unix.socket/1.0": dial unix /var/snap/lxd/common/lxd/unix.socket: connect: connection refused

root@lxd:~# sudo snap info lxd
name: lxd
summary: LXD - container and VM manager
publisher: Canonical✓
store-url: https://snapcraft.io/lxd
contact: Issues · lxc/incus · GitHub
license: unset
description: |
LXD is a system container and virtual machine manager.

It offers a simple CLI and REST API to manage local or remote instances,
uses an image based workflow and support for a variety of advanced features.

Images are available for all Ubuntu releases and architectures as well
as for a wide number of other Linux distributions. Existing
integrations with many deployment and operation tools, makes it work
just like a public cloud, except everything is under your control.

LXD containers are lightweight, secure by default and a great
alternative to virtual machines when running Linux on Linux.

LXD virtual machines are modern and secure, using UEFI and secure-boot
by default and a great choice when a different kernel or operating
system is needed.

With clustering, up to 50 LXD servers can be easily joined and managed
together with the same tools and APIs and without needing any external
dependencies.

Supported configuration options for the snap (snap set lxd [=…]):

- ceph.builtin: Use snap-specific Ceph configuration [default=false]
- ceph.external: Use the system's ceph tools (ignores ceph.builtin) [default=false]
- criu.enable: Enable experimental live-migration support [default=false]
- daemon.debug: Increase logging to debug level [default=false]
- daemon.group: Set group of users that can interact with LXD [default=lxd]
- daemon.preseed: Pass a YAML configuration to `lxd init` on initial start
- daemon.syslog: Send LXD log events to syslog [default=false]
- lvm.external: Use the system's LVM tools [default=false]
- lxcfs.pidfd: Start per-container process tracking [default=false]
- lxcfs.loadavg: Start tracking per-container load average [default=false]
- lxcfs.cfs: Consider CPU shares for CPU usage [default=false]
- openvswitch.builtin: Run a snap-specific OVS daemon [default=false]
- shiftfs.enable: Enable shiftfs support [default=auto]

For system-wide configuration of the CLI, place your configuration in
/var/snap/lxd/common/global-conf/ (config.yml and servercerts)
commands:

  • lxd.benchmark
  • lxd.buginfo
  • lxd.check-kernel
  • lxd.lxc
  • lxd.lxc-to-lxd
  • lxd
  • lxd.migrate
    services:
    lxd.activate: oneshot, enabled, inactive
    lxd.daemon: simple, enabled, inactive
    snap-id: J60k4JY0HppjwOjW8dZdYc8obXKxujRu
    tracking: latest/stable
    refresh-date: yesterday at 06:35 BST
    channels:
    latest/stable: 4.18 2021-09-13 (21497) 75MB -
    latest/candidate: 4.19 2021-10-05 (21654) 76MB -
    latest/beta: ↑
    latest/edge: git-737447f 2021-10-06 (21670) 76MB -
    4.19/stable: –
    4.19/candidate: 4.19 2021-10-05 (21654) 76MB -
    4.19/beta: ↑
    4.19/edge: ↑
    4.18/stable: 4.18 2021-09-13 (21497) 75MB -
    4.18/candidate: 4.18 2021-09-15 (21554) 75MB -
    4.18/beta: ↑
    4.18/edge: ↑
    4.0/stable: 4.0.7 2021-10-04 (21545) 70MB -
    4.0/candidate: 4.0.7 2021-10-04 (21545) 70MB -
    4.0/beta: ↑
    4.0/edge: git-2dccccd 2021-10-05 (21628) 70MB -
    3.0/stable: 3.0.4 2019-10-10 (11348) 55MB -
    3.0/candidate: 3.0.4 2019-10-10 (11348) 55MB -
    3.0/beta: ↑
    3.0/edge: git-81b81b9 2019-10-10 (11362) 55MB -
    2.0/stable: 2.0.12 2020-08-18 (16879) 38MB -
    2.0/candidate: 2.0.12 2021-03-22 (19859) 39MB -
    2.0/beta: ↑
    2.0/edge: git-82c7d62 2021-03-22 (19857) 39MB -
    installed: 4.19 (21624) 76MB -

root@lxd:~# ps aux | grep lx
root 3812 1.1 0.0 3068436 12016 ? Sl Oct03 51:17 lxcfs /var/snap/lxd/common/var/lib/lxcfs -p /var/snap/lxd/common/lxcfs.pid
lxd 3984 0.0 0.0 7204 3584 ? Ss Oct03 0:01 dnsmasq --keep-in-foreground --strict-order --bind-interfaces --except-interface=lo --pid-file= --no-ping --interface=lxdbr0 --dhcp-rapid-commit --quiet-dhcp --quiet-dhcp6 --quiet-ra --listen-address=10.84.149.1 --dhcp-no-override --dhcp-authoritative --dhcp-leasefile=/var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.leases --dhcp-hostsfile=/var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.hosts --dhcp-range 10.84.149.2,10.84.149.254,1h --listen-address=fd42:18b9:a901:b901::1 --enable-ra --dhcp-range ::,constructor:lxdbr0,ra-stateless,ra-names -s lxd --interface-name _gateway.lxd,lxdbr0 -S /lxd/ --conf-file=/var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.raw -u lxd -g lxd
root 4738 0.0 0.0 2163956 19148 ? Ss Oct03 0:00 [lxc monitor] /var/snap/lxd/common/lxd/containers cNTLDNLSAPPP001
root 9643 0.0 0.0 2163444 19228 ? Ss Oct03 0:00 [lxc monitor] /var/snap/lxd/common/lxd/containers cNTLDNLSAPPU001
root 11640 0.0 0.0 2237688 18276 ? Ss Oct03 0:00 [lxc monitor] /var/snap/lxd/common/lxd/containers cNTLDNLSSQLP001
root 15754 0.0 0.0 2311420 19428 ? Ss Oct03 0:00 [lxc monitor] /var/snap/lxd/common/lxd/containers cNTLDNLSSQLU001
root 16172 0.0 0.0 3640 1152 ? Ss Oct03 0:00 snapfuse /var/lib/snapd/snaps/lxd_21029.snap /snap/lxd/21029 -o ro,nodev,allow_other,suid
root 16177 0.0 0.0 3508 164 ? Ss Oct03 0:00 snapfuse /var/lib/snapd/snaps/lxd_20326.snap /snap/lxd/20326 -o ro,nodev,allow_other,suid
1000000 21831 0.0 0.0 3508 164 ? Ss Oct03 0:00 snapfuse /var/lib/snapd/snaps/lxd_21029.snap /snap/lxd/21029 -o ro,nodev,allow_other,suid
1000000 21833 0.0 0.0 3708 1224 ? Ss Oct03 0:00 snapfuse /var/lib/snapd/snaps/lxd_21545.snap /snap/lxd/21545 -o ro,nodev,allow_other,suid
root 22354 0.0 0.0 2163956 18932 ? Ss Oct03 0:00 [lxc monitor] /var/snap/lxd/common/lxd/containers p-promt-cNTLDNSMSP02
1000000 23404 0.0 0.0 3508 164 ? Ss Oct03 0:00 snapfuse /var/lib/snapd/snaps/lxd_21029.snap /snap/lxd/21029 -o ro,nodev,allow_other,suid
1000000 23407 0.0 0.0 3956 1404 ? Ss Oct03 0:01 snapfuse /var/lib/snapd/snaps/lxd_21545.snap /snap/lxd/21545 -o ro,nodev,allow_other,suid
root 719003 0.0 0.0 2237432 18972 ? Ss Oct03 0:00 [lxc monitor] /var/snap/lxd/common/lxd/containers TA-cNTLDNSMSP03
1000000 719511 0.0 0.0 3508 1100 ? Ss Oct03 0:15 snapfuse /var/lib/snapd/snaps/lxd_21029.snap /snap/lxd/21029 -o ro,nodev,allow_other,suid
1000000 719526 0.0 0.0 3956 1532 ? Ss Oct03 0:15 snapfuse /var/lib/snapd/snaps/lxd_21545.snap /snap/lxd/21545 -o ro,nodev,allow_other,suid
root 1862671 0.0 0.0 6432 2540 pts/0 R+ 09:43 0:00 grep --color=auto lx