Lxd: command not found

Hi, I’m following the guide here: https://docs.snapcraft.io/build-snaps/get-started-snapcraft on a Rasperry Pi 3 with ubuntu core and the classic on top of it.

On the Setup LXD section I’m running into issues.

snap install lxd worked fine. If I run it again I see snap "lxd" is already installed, see 'snap help refresh'

But then when I run lxd init I get a lxd: command not found

Any help?
Thanks

You may need to logout and log back in again for your path to be setup correctly. Alternatively you could run /snap/bin/lxd init

Hey, thanks for your reply.

When I try to run that I get:

/snap/bin/lxd: No such file or directory

By the way, I tried logging out and back in already. Even rebooting the device. Still no luck!

A bit more information…

So like I mentioned, I’m trying this on a Rasperry Pi 3.

If I try to install lxd on the CORE it seems to work and I see it on /snap/bin/lxd. But when I go into the classic environment, it says it installs it correctly, but it doesn’t work and it doesn’t show on /snap/bin/lxd. /snap is actually almost empty, it only has the files manifest.yaml and snapcraft.yaml.

So that made me think that I needed to do everythin on the CORE directly. So I started the guide again, and when I tried install snapcraft --classic, I got an error that says snap "snapcraft" requires classic confinement which is only available on classic systems. So yeah… this is meant to work on classic, but I can’t get it to… :frowning:

Thank you

‘classic’ is a bit overloaded and the term is used to described different related situations.

  • ‘classic distro’ is meant to describe classic distributions like Ubuntu and Fedora where snaps are not the sole package delivery mechanism
  • ‘classic confinement’ and ‘confinement: classic’ describe the security policy for snaps that have full access to the system
  • ‘classic snaps’ describes snaps that use ‘classic confinement’ which are installed with snap install --classic .... ‘classic snaps’ may only be installed on ‘classic distro’
  • Ubuntu Core is an ‘all-snaps’ system and not ‘classic distro’ and ‘classic snaps’ may not be installed on them
  • a ‘classic snap’ exists which uses the ‘classic-support’ interface to provide a reduced ‘apt’ environment on ‘all-snaps’ systems to facilitate development on ‘all-snaps’ systems. This snap provides a ‘classic environment’ that is essentially a simple and minimal chroot of a ‘classic distro’ (in this case, Ubuntu 16.04). It intentionally does not support everything that might be provided via a normal ‘classic distro’, notably it doesn’t support starting services on boot or access to other snaps on the system

Based on your last post, it sounds like you are using Ubuntu Core with the ‘classic snap’ and in this scenario it is expected that the lxd snap (and all of its commands) is inaccessible to you while in the classic chroot.

Thank you for your explanation. Am I understanding correctly that I don’t need LXD on a rasperry pi then?
Or that I should use it outside of classic?

It is meant to be used outside of an envirnonment provided by the classic snap.

Either use one of the other if your objective is to have a more traditional environment to work on.