lxc-stop -n $NAME
cd $HOME/.local/share/lxc/$NAME
sudo -s
tar --numeric-owner -czvf container_fs.tar.gz ./*
rsync -avh container_fs.tar.gz user@newserver:.local/share/lxc/
mkdir $HOME/.local/share/lxc/$NAME
chown 100000:$USER $HOME/.local/share/lxc/$NAME
cd $HOME/.local/share/lxc/$NAME
sudo -s
tar --numeric-owner -xzvf ../container_fs.tar.gz .
I noticed you have
sudo -s
, does this mean I need to add the user which runs my unprivileged containers to the sudo group?