Reputation: 11
Installed juju using following command on Ubuntu 19.04
sudo snap install juju --classic
This installed lxd as well. When I try to invoke "sudo lxd -h" or "sudo lxc list" or "sudo juju bootstrap" I get following error message
sudo: juju: command not found
sudo: lxc: command not found
sudo: lxd: command not found
Where as if I run those commands without sudo, I get following
Error: Get http://unix.socket/1.0: dial unix /var/snap/lxd/common/lxd/unix.socket: connect: permission denied
Not sure what went wrong. Here is what happened. First I was able to install juju and it worked fine as expected. Later I installed OpenStack using devstack. I removed OpenStack using ./unstack.sh and ./clean.sh Seems like something went wrong in that which is causing me the above issue.
Any suggestions to fix this?
Thanks
Upvotes: 1
Views: 3373
Reputation: 560
You don't need to execute lxc/lxd as root (using sudo). You need to add your user to the LXD group in order to access the socket. The ownership of the socket is set to user root and group lxd.
Execute the following two lines (as your user, not root), then try an lxc list:
newgrp lxd
sudo usermod -aG aravind lxd
Upvotes: 2