Resolving the Permission Denied and Missing Binary Errors in LXD

Linux TLDR
Last Updated:
Reading time: 2 minutes

When you install the LXD using the following command in your Ubuntu or Debian-based distributions:

$ sudo apt install lxd-installer

And try to begin your LXD journey with the following commands:

$ sudo lxd

#OR

$ lxd

You might end up with the following “permission denied” and “missing binary” errors in LXD:

$ sudo lxd
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ConnectionResetError: [Errno 104] Connection reset by peer
/usr/sbin/lxd: 6: exec: /snap/bin/lxd: not found


$ lxd
Traceback (most recent call last):
  File "<string>", line 1, in <module>
PermissionError: [Errno 13] Permission denied
/usr/sbin/lxd: 6: exec: /snap/bin/lxd: not found

Output:

permission denied and missing binary error in LXD

Reason for Permission Denied and Missing Binary Errors in LXD

There are multiple factors contributing to this error, but one of the primary reasons that I’ve found is that after installing the LXD and running it for the first time with the following command:

$ sudo lxd

Output:

Running the LXD command for first time after installing

When the above command is initiated, LXD starts the process of configuring the settings and environment, yet this procedure remains invisible on the screen and then unknowingly gets interrupted by the user using the “Ctrl+C” shortcut key.

No need to fret if you interrupted the configuration midway; simply implement the solutions below.

Resolving the Permission Denied and Missing Binary Errors in LXD

To fix the “permission denied” and “missing binary” issues in LXD, you have two options: either reinstall and then reinitialize the configuration process or simply go straight to your terminal and create symbolic links for LXD and LXC in the “/snap/bin” directory.

$ sudo ln -s /usr/sbin/lxd /snap/bin/lxd
$ sudo ln -s /usr/sbin/lxc /snap/bin/lxc

Output:

Creating LXD and LXC symbolic links in the snap bin directory

(optional, but recommended) Add the current user to the group named LXD by running:

$ sudo usermod -aG lxd $USER 

#OR

$ sudo usermod -aG lxd <USERNAME>

Refresh and reload the group membership by running:

$ newgrp lxd

Output:

Adding current user to LXD group and then refreshing the group membership

That’s it! You can verify the error is removed by checking the LXD version.

$ sudo lxd --version
$ lxd --version

Output:

Verifying the LXD version to test problem is resolved

Final Word

I hope this solution has solved your “permission denied” and “missing binary” errors in the LXD.

If you have any questions or require help, do let us know in the comment section.

Till then, peace!

Join The Conversation

Users are always welcome to leave comments about the articles, whether they are questions, comments, constructive criticism, old information, or notices of typos. Please keep in mind that all comments are moderated according to our comment policy.