Moving files and/or directories between containers


Containers on a btrfs backend running mostly various flavors of debian with the containers being on a debian stable system using snapd to install lxd (lxd 3.??). Containers are all on independent ip addresses.

In the past I have found that using scp worked fairly well moving files and directories between different systems all on my network. What is a good way to move files/directories from one container to another one? (Please - actual examples would be quite useful.)

A few different ways:

  • scp is fine but probably the slowest option
  • A shared custom volume could be a way (lxc storage volume create and lxc storage volume attach)
  • Directly copy/move files as root through /var/snap/lxd/common/mntns/var/snap/lxd/common/lxd/storage-pools/