ganto / copr-lxc4

RPM spec files for building the latest stable lxc/lxd/incus releases on Fedora COPR
MIT License
34 stars 7 forks source link

Error: Get "http://unix.socket/1.0": if launch lxc list #15

Closed diashtrih closed 3 years ago

diashtrih commented 3 years ago
Error: Get "http://unix.socket/1.0": dial unix /var/lib/lxd/unix.socket: connect: no such file or directory

error if run "sudo lxс list"not from root account

diashtrih commented 3 years ago

sudo lxd init, is same

ganto commented 3 years ago

The LXD_SOCKET environment variable must be set to /run/lxd.socket. By default this is achieved by sourcing /etc/profile.d/lxd.sh. If this file is missing or your shell or application is not loading it, you must manually set the variable.

$ lxc list
Error: Get "http://unix.socket/1.0": dial unix /var/lib/lxd/unix.socket: connect: no such file or directory
$ cat /etc/profile.d/lxd.sh 
# /etc/profile.d/lxd.sh - Set LXD socket path

LXD_SOCKET=/run/lxd.socket
export LXD_SOCKET
$ . /etc/profile.d/lxd.sh 
$ lxc list
+------+-------+------+------+------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------+-------+------+------+------+-----------+
ganto commented 3 years ago

Btw, this is also described in the wiki: Getting started with LXD on Fedora page.