Copy lxc container

How to copy lxc container between to lxc hosts.

  1. Configure remote lxc - enable listening on all interfaces and setup password:
    lxc config set core.https_address [::]:8443
    lxc config set core.trust_password PASSWORD
    
  2. Enable listening on all interfaces on local lxc
    lxc config set core.https_address [::]:8443
    
  3. Add remote lxc
    lxc remote add LXC_REMOTE_NAME IP
    
  4. Make a container snapshot
    lxc snapshot CONTAINER current
    
  5. Copy lxc container from local lxc to remote
    lxc copy CONTAINER:current LXC_REMOTE_NAME:CONTAINER