Snap lxd install

After a disc place problem, on ubuntu, i try to see a status of om lxd.
lxc ls command say lxd is not install try to install with snap … or apt-get …
it was snap i installed, then i remove purge liblxc-common, liblxc1, lxcfs
and try to install snap install lxd
message say: snap “lxd” is already installed, see ‘snap help refresh’
HELP

Hi!

If you already have the DEB package of LXD installed, and you wish to switch to the SNAP package of LXD, then

  1. Install the snap package of LXD with sudo snap install lxd
  2. Migrate from DEB to SNAP with sudo lxd.migrate. This program will also prompt you to remove the DEB package of LXD for you.

If you have manually removed some of the DEB packages, then also remove this one, sudo apt remove lxd-client.

Before using LXD, you need to initialize it. You need to initialize if you have not done so before.
You can do this with sudo lxd init.

i get my lxc command back. But when i say lxc ls it show nothing.
is all my lxd removed?
what i did wrong?

i can see all my lxd under
/var/snap/lxd/common/lxd/storage-pools/default/containers/
but lxc ls show nothing. what i missing here?

Try the following command and paste here the output.

which lxc

Then, try

/snap/bin/lxc ls

which lxc show /usr/bin/lxc
there is a lxc link to lxd.lxc under /snap/bin/
and /snap/bin/lxc ls
/snap/bin/lxc: No such file or directory

link is not correct, and all other link under /snap/bin is removed.

i created all missing link. lxc, lxd, lxd.benchmark. lxd.buginfo, lxd.check-kernel, lxd.lxc and lxd.migrate

then try /snap/bin/lxc ls
internal error, please report: running “lxd.lxc” failed: cannot find current revision for snap lxd: readlink /snap/lxd/current: no such file or directory
then created link current link to directory (last one) 141194
then /snap/bin/lxc ls
Error: Both native and snap packages are installed on this system
Run “lxd.migrate” to complete your migration to the snap package

Should i run.migrate to complete. i am not sure i don’t want convert lxd’s

When you install a snap package, the files for the snap package go under the directory tree /snap/.
You should not create/remove/change files under /snap/ because otherwise it will cause problems.

You probably have already a LXD installation from the DEB package.
And you have a snap installation of LXD that looks that it is not working for some reason.

Please run the following commands and paste the output here.

lsb_release -a
apt policy lxd
snap info lxd
/usr/bin/lxc profile show default

i take a snapshot of my citrix vm. i can revert to before i did all this ting. what should i else do?
here is a

$ lsb_release -a 
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.4 LTS
Release:	18.04
Codename:	bionic
$ apt policy lxd 
lxd:
  Installed: 3.0.3-0ubuntu1~18.04.1
  Candidate: 3.0.3-0ubuntu1~18.04.1
  Version table:
 *** 3.0.3-0ubuntu1~18.04.1 500
        500 http://dk.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     3.0.0-0ubuntu4 500
        500 http://dk.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
$ snap info lxd
name:      lxd
summary:   System container manager and API
publisher: Canonical✓
store-url: https://snapcraft.io/lxd
contact:   https://github.com/lxc/lxd/issues
license:   unset
description: |
  **LXD is a system container manager**
  
  With LXD you can run hundreds of containers of a variety of Linux
  distributions, apply resource limits, pass in directories, USB devices
  or GPUs and setup any network and storage you want.
  
  LXD containers are lightweight, secure by default and a great
  alternative to running Linux virtual machines.
  
  
  **Run any Linux distribution you want**
  
  Pre-made images are available for Ubuntu, Alpine Linux, ArchLinux,
  CentOS, Debian, Fedora, Gentoo, OpenSUSE and more.
  
  A full list of available images can be found here: https://images.linuxcontainers.org
  
  Can't find the distribution you want? It's easy to make your own images too, either using our
  `distrobuilder` tool or by assembling your own image tarball by hand.
  
  
  **Containers at scale**
  
  LXD is network aware and all interactions go through a simple REST API,
  making it possible to remotely interact with containers on remote
  systems, copying and moving them as you wish.
  
  Want to go big? LXD also has built-in clustering support,
  letting you turn dozens of servers into one big LXD server.
  
  
  **Configuration options**
  
  Supported options for the LXD snap (`snap set lxd KEY=VALUE`):
   - criu.enable: Enable experimental live-migration support [default=false]
   - daemon.debug: Increases logging to debug level [default=false]
   - daemon.group: Group of users that can interact with LXD [default=lxd]
   - ceph.builtin: Use snap-specific ceph configuration [default=false]
   - openvswitch.builtin: Run a snap-specific OVS daemon [default=false]
  
  Documentation: https://lxd.readthedocs.io
snap-id:      J60k4JY0HppjwOjW8dZdYc8obXKxujRu
tracking:     latest/stable
refresh-date: today at 14:10 CEST
channels:
  latest/stable:    4.0.0       2020-04-10 (14503) 70MB -
  latest/candidate: 4.0.0       2020-04-15 (14594) 62MB -
  latest/beta:      ↑                                   
  latest/edge:      git-c4c1cda 2020-04-15 (14604) 62MB -
  4.0/stable:       4.0.0       2020-04-11 (14503) 70MB -
  4.0/candidate:    4.0.0       2020-04-15 (14594) 62MB -
  4.0/beta:         ↑                                   
  4.0/edge:         ↑                                   
  3.23/stable:      3.23        2020-03-30 (14133) 70MB -
  3.23/candidate:   3.23        2020-03-30 (14133) 70MB -
  3.23/beta:        ↑                                   
  3.23/edge:        ↑                                   
  3.22/stable:      3.22        2020-03-18 (13901) 70MB -
  3.22/candidate:   3.22        2020-03-19 (13911) 70MB -
  3.22/beta:        ↑                                   
  3.22/edge:        ↑                                   
  3.21/stable:      3.21        2020-02-24 (13522) 69MB -
  3.21/candidate:   3.21        2020-03-04 (13588) 69MB -
  3.21/beta:        ↑                                   
  3.21/edge:        ↑                                   
  3.20/stable:      3.20        2020-02-06 (13300) 69MB -
  3.20/candidate:   3.20        2020-02-06 (13300) 69MB -
  3.20/beta:        ↑                                   
  3.20/edge:        ↑                                   
  3.19/stable:      3.19        2020-01-27 (13162) 67MB -
  3.19/candidate:   3.19        2020-01-27 (13162) 67MB -
  3.19/beta:        ↑                                   
  3.19/edge:        ↑                                   
  3.18/stable:      3.18        2019-12-02 (12631) 57MB -
  3.18/candidate:   3.18        2019-12-02 (12631) 57MB -
  3.18/beta:        ↑                                   
  3.18/edge:        ↑                                   
  3.0/stable:       3.0.4       2019-10-10 (11348) 55MB -
  3.0/candidate:    3.0.4       2019-10-10 (11348) 55MB -
  3.0/beta:         ↑                                   
  3.0/edge:         git-81b81b9 2019-10-10 (11362) 55MB -
  2.0/stable:       2.0.11      2019-10-10  (8023) 28MB -
  2.0/candidate:    2.0.11      2019-10-10  (8023) 28MB -
  2.0/beta:         ↑                                   
  2.0/edge:         git-160221d 2020-01-13 (12854) 27MB -
installed:          4.0.0                  (14194) 70MB disabled
$ /usr/bin/lxc profile show default
config: {}
description: Default LXD profile
devices:
  eth0:
    name: eth0
    nictype: bridged
    parent: lxdbr0
    type: nic
name: default
used_by: []

I edited your post so that the output is easier to read. See here for instructions on how I did it.

I can see that you have partially configured LXD (Deb package). The last command, lxc profile show default, shows that the network has been configured, but there is no storage disk/pool. That is, you cannot create containers if there is no storage.

It is not clear why there is no storage. Was there storage before? Did you have containers before? Did you try to lxd.migrate at any point?

If you can revert from a backup, it would be easier to figure out what is going on.
What is needed, is a working system.

Decide whether you want to keep the LXD DEB installation, or whether you want to migrate to the LXD snap package.

i have 4 conatiners. I do not run lxd.migrate.
i have install snap at the first time, i don’t no how deb package be installed. for a 2 days ago i update ubuntu and upgrade (AUTOMATICALLY) and since that i have a problem first panic kernel and i need to start with other kernel, then lxc command gave error but i could login to containers(all was in samba ad).
i do not have backup for my lxd’s. but before i try to remove files (lib1,…) and reinstall snap lxd client
i take a snapshut.
what should i do now? i can see my pool is gun.

can’t remember (it was a long time ). maybe i do not start with snap installation and at the first time just used apt-get install. then i do not need to install snap lxd and just using apt-get.
and not to remove purge liblxc-common liblxc1 lxcfs lxd lxd-client.

i revert snapshot and every thing is ok. i update and upgrade, get the same problem. So problem was or is upgrade on ubuntu 18.04. What i can see is upgrade of python to version 3.x (latest).
i can’t see what python has impact to lxc?

We need to figure out whether the containers are in the SNAP version of LXD, or the DEB version of LXD.

Run the following and post the output.

sudo ls -l /var/snap/lxd/common/lxd/containers/
sudo ls -l /var/lib/lxd/containers/

/var/snap/…/containers contain all my containers
and in /var/lib no lxd
then it’s snap version i install.

i remove all apt version
apt-get -y purge liblxc-common liblxc1 lxcfs lxd lxd-client
then snap install lxd say lxd is is already installed, see ‘snap help refresh’
then try to run
lxc ls
Error: Get “http://unix.socket/1.0”: dial unix /var/snap/lxd/common/lxd/unix.socket: connect: connection refused

Run the following. It should include lxd in the output.

$ groups
user adm cdrom sudo dip plugdev lpadmin lxd sambashare

yes, it is
groups
root lxd

ok how to manually remove all lxd i can’t see any lxd in my lxc ls.
but it’s take a place in my vm.
what i want is to remove all old lxd and restore from old backup. i can’t do it before removing (no disk plads).