Vishrant
Vishrant

Reputation: 16688

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

I am getting the following error while connecting to LXD:

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

Upvotes: 8

Views: 8724

Answers (2)

Vishrant
Vishrant

Reputation: 16688

You will have to execute the following command in order to provide access to the current (non-root) user:

sudo usermod -a -G lxd $(whoami)
newgrp lxd

Confirm it by executing

/snap/bin/lxc query --wait -X GET /1.0

You should get a JSON response.

Upvotes: 15

Hemant kumar
Hemant kumar

Reputation: 5889

Simply use the below commands:-

  1. Add an existing user to group lxd.

    sudo adduser {your-username} lxd

  2. Change the current group ID during a login session.

    newgrp lxd

  3. Check the attached group to the user.

    id

    lxc list

Upvotes: 0

Related Questions