Error: Get http://unix.socket/1.0: dial unix /var/snap/lxd/common/lxd/unix.socket: connect: permission denied

Hi,

I am running the lxc commands on Ubuntu but getting errors:

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

Error: Get http://unix.socket/1.0: dial unix /var/snap/lxd/common/lxd/unix.socket: connect: permission denied

How to fix this error? How to give normal user access to run lxc?

Add user to lxd group:

sudo adduser {your-user-name-here} lxd
newgrp lxd
id
lxc list

See tutorial page


Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki