Lxc-copy is forcing unprivileged false

I’m copying an unprivileged container from default /var/lib/lxc/ location to another with:
sudo lxc-copy -n xxx -N yyy --newpath=/mnt/xxx/yyy
but upon finishing the copy and lxc-starting it with:
sudo lxc-start -n xxx -f /run/media/xxx/yyy/config
it gets marked as privileged in lxc-ls

My initial assumption was because my first copy-target was an NTFS partition (hence everything is owned by root), but even on regular ext4 (inside a loop mounted raw img) it still marks the container as privileged afterwards, what could be the cause? my user is the owner of the ext4 img mount and subfolders.

If I try to lxc-copy to my own users home-folder that’s not mounted in any irregular way, it can’t start the container with a permission denied error, stating it failed to open rootfs.


I wonder if it’s not the -f /path/to/config that’s causing lxc-ls to get a bit confused.

Normally what I’d do is: lxc start -n yyy -P /run/media/xxx/ which should then result in lxc-ls -P /run/media/xxx/ to work properly.

Otherwise what I suspect may be going on is that lxc-ls fails to properly locate the config and so can’t determine that the container is unprivileged.

1 Like

looking at my bash history I tried just that multiple times, and it was throwing that no config was specified, so I’d add the -f and or drop the -P entirely, sadly I switched right now to LXD already, but if this is a bug, should it be filed with LXC tracker?