새 호스트에서 Linux 컨테이너를 이동하고 실행하는 방법은 무엇입니까?

새 호스트에서 Linux 컨테이너를 이동하고 실행하는 방법은 무엇입니까?

Linux 컨테이너를 새 호스트로 이동하는 올바른 단계는 무엇입니까? 내가 성공하지 못한 일은 다음과 같습니다.

  1. Linux 컨테이너가 포함된 디렉터리를 압축합니다. sudo tar -cjf sample_container.tar.bz2 <path-to-container>/sample_container
  2. 압축된 tar 파일을 새 호스트에 복사합니다(scp, rsync 등을 통해).
  3. 새 호스트에서 tar 파일의 압축을 풉니다. sudo -jxvf sample_container.tar.bz2
  4. sample_container/configrootfs새 경로 (예: 새 호스트의 경로) 로 업데이트

위의 단계를 수행해도 작동하지 않는 것 같습니다. 내가 뭘 잘못했나요?

고쳐 쓰다: 다음은 컨테이너를 실행하려고 할 때 얻는 로그 출력입니다.

lxc-start 20161111164704.185 ERROR    lxc_conf - conf.c:mount_rootfs:807 - Permission denied - failed to get real path for '/home/newhost/dir1/dir2/lxc/mycontainer_trusty_lxc/rootfs'
lxc-start 20161111164704.185 ERROR    lxc_conf - conf.c:setup_rootfs:1221 - failed to mount rootfs
lxc-start 20161111164704.185 ERROR    lxc_conf - conf.c:do_rootfs_setup:3631 - failed to setup rootfs for 'mycontainer_trusty_lxc'
lxc-start 20161111164704.185 ERROR    lxc_conf - conf.c:lxc_setup:3713 - Error setting up rootfs mount after spawn
lxc-start 20161111164704.185 ERROR    lxc_start - start.c:do_start:834 - failed to setup the container
lxc-start 20161111164704.185 ERROR    lxc_sync - sync.c:__sync_wait:57 - An error occurred in another process (expected sequence number 3)
lxc-start 20161111164704.185 ERROR    lxc_start - start.c:__lxc_start:1354 - failed to spawn 'mycontainer_trusty_lxc'
lxc-start 20161111164709.723 ERROR    lxc_start_ui - tools/lxc_start.c:main:344 - The container failed to start.
lxc-start 20161111164709.723 ERROR    lxc_start_ui - tools/lxc_start.c:main:346 - To get more details, run the container in foreground mode.
lxc-start 20161111164709.723 ERROR    lxc_start_ui - tools/lxc_start.c:main:348 - Additional information can be obtained by setting the --logfile and --logpriority options.

관련 정보