Error: Failed to connect to local LXD: Get "http://unix.socket/1.0": dial unix /var/lib/lxd/unix.socket: connect: no such file or directory

Hello to everyone.

I’m playing with the jetson nano. I’ve just installed ubuntu 22.04 on top of it. Nvidia says that nothing will work on 22.04 and it is totally unsupported. Well,I’m trying to make it supported :slight_smile: ; the first problem to overcome is to find a good alternative for the broken docker container,because it does not work.

I’ve installed lxd from source,following this tutorial :

https://linuxcontainers.org/lxd/docs/latest/installing/#installing-lxd-from-source

The problem is that “lxd init” does not work :

root@marietto-nano:/home/marietto/Scaricati/lxd# lxd init

Error: Failed to connect to local LXD: Get "http://unix.socket/1.0": dial unix
/var/lib/lxd/unix.socket: connect: no such file or directory

I tried to run lxd manually on the terminal A , the process didn’t exit and it worked partially :

marietto@marietto-nano:~/Scaricati/lxd$ lxd
Error: This must be run as root

root@marietto-nano:/home/marietto/Scaricati/lxd# lxd

WARNING[2023-04-22T00:00:20+02:00] AppArmor support has been disabled because of lack of kernel support 
WARNING[2023-04-22T00:00:20+02:00]  - AppArmor support has been disabled, Disabled because of lack of kernel support 
WARNING[2023-04-22T00:00:20+02:00]  - Couldn't find the CGroup blkio, disk I/O limits will be ignored 
WARNING[2023-04-22T00:00:20+02:00]  - Couldn't find the CGroup blkio.weight, disk priority will be ignored 
WARNING[2023-04-22T00:00:20+02:00]  - Couldn't find the CGroup CPU controller, CPU time limits will be ignored 
WARNING[2023-04-22T00:00:20+02:00]  - Couldn't find the CGroup CPUacct controller, CPU accounting will not be available 
WARNING[2023-04-22T00:00:20+02:00]  - Couldn't find the CGroup CPU controller, CPU pinning will be ignored 
WARNING[2023-04-22T00:00:20+02:00]  - Couldn't find the CGroup hugetlb controller, hugepage limits will be ignored 
WARNING[2023-04-22T00:00:20+02:00]  - Couldn't find the CGroup network priority controller, network priority will be ignored 
WARNING[2023-04-22T00:00:20+02:00] Instance type not operational                 driver=qemu err="Vsock support is missing (no /dev/vsock)" type=virtual-machine
WARNING[2023-04-22T00:00:21+02:00] Firewall failed to detect any compatible driver, falling back to "xtables" (but some features may not work as expected due to: Backend command "ebtables" is an nftables shim) 
WARNING[2023-04-22T00:00:21+02:00] Failed to initialize fanotify, falling back on inotify  err="Failed to initialize fanotify: invalid argument"

so,on the terminal B I did :

root@marietto-nano:/home/marietto# lxc launch ubuntu:20.04 ubuntu2004
Creating ubuntu2004
Error: Failed instance creation: Failed creating instance record: Failed initialising instance: Failed getting root disk: No root device could be found

root@marietto-nano:/home/marietto# lxc profile device add default root disk path=/ pool=default 
Device root added to default

root@marietto-nano:/home/marietto# lxc launch ubuntu:20.04 ubuntu2004
Creating ubuntu2004
Error: Failed instance creation: Failed creating instance record: Failed initialising instance: Failed loading storage pool: Storage pool not found

But since I could not run lxc through the command lxd init , the device that I’ve created to my default profile points to a pool that wasn’t created when it should have been.

It seems there is a bug that hasn’t been fixed ?

To experiment also means to try everything,including what you don’t like (snap). So,I’ve installed lxd using snap and it seems that it worked. So,the developers of lxd needs to improve their code,I suppose,since if it works it means that my current system has the requisites to run it correctly and there is some errors inside some part of the lxd code.

root@marietto-nano:/home/marietto/go_git/src# snap install lxd

2023-04-22T18:09:12+02:00 INFO Waiting for automatic snapd restart... lxd 5.13-cea5ee2 da Canonical✓ è stato installato

root@marietto-nano:/home/marietto/go_git/src# lxd init

Would you like to use LXD clustering? (yes/no) [default=no]:

Do you want to configure a new storage pool? (yes/no) [default=yes]:

Name of the new storage pool [default=default]:

Name of the storage backend to use (btrfs, ceph, dir, lvm) [default=btrfs]:

Create a new BTRFS pool? (yes/no) [default=yes]:

Would you like to use an existing empty block device (e.g. a disk or partition)? (yes/no) [default=no]:

Size in GiB of the new loop device (1GiB minimum) [default=30GiB]:

Would you like to connect to a MAAS server? (yes/no) [default=no]:

Would you like to create a new local network bridge? (yes/no) [default=yes]:

What should the new bridge be called? [default=lxdbr0]:

What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:

What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:

Would you like the LXD server to be available over the network? (yes/no) [default=no]: yes

Address to bind LXD to (not including port) [default=all]: Port to bind LXD to [default=8443]:

Would you like stale cached images to be updated automatically? (yes/no) [default=yes]:

Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]:

You need to start lxd service and then run sudo lxd init to create a network, storage pool and add the relevant devices to the default profile.

See https://linuxcontainers.org/lxd/docs/master/howto/initialize/