Lxc copy container β†’ OK, lxc copy VM fails with "Failed to mount ... permission denied"


I am able to use LXC COPY to copy containers from one server to another with no problems but I am unable to do it with a VM.

Storage is LVM. LXD version 4.0.3, Ubuntu20. Remote server is LXDv4.0.3, Ubuntu18.

test example:

lxc launch ubuntu:18.04 example-vm --vm
lxc stop example-vm
lxc snapshot example-vm snap1999
lxc copy example-vm/snap1999 remotehost.com:example-vm2 --mode=relay

Using the monitor in a different terminal window of the original host server:

 lxc monitor --type=logging --pretty

Results (edited):

Connected websocket Operation: 123
Handled websocket Operation: 123
MountInstance started   driver=lvm instance=example-vm/snap1999 pool=default project=default
MountInstance finished  instance=example-vm/snap1999 pool=default project=default driver=lvm
Failure for websocket operation: 123: Failed getting source disk size: Failed to mount LVM logical volume: Failed to mount '/dev/default/virtual-machines_example--vm-snap1999' on '/var/snap/lxd/common/lxd/storage-pools/default/virtual-machines-snapshots/example-vm/snap1999': permission denied 

I have also tried to pull it on the remote server and same error. It looks like it is trying to mount the snapshot and probably determine disk size but the mount fails due to permission error.

I have also created a new VM on the remote server and try to copy to host1 and same error.

snap get lxd lvm.external is false on host1 and unset on host2.
Each server has only one storage pool, β€œdefault”

Appreciate any ideas or help on this.
Thank you

Yep I know what is causing that issue and am working on a fix. Thanks

1 Like

This should have been fixed by:

And is in LXD 4.8. This should also make it into the next 4.0 LTS release.