![새 호스트에서 Linux 컨테이너를 이동하고 실행하는 방법은 무엇입니까?](https://linux55.com/image/98656/%EC%83%88%20%ED%98%B8%EC%8A%A4%ED%8A%B8%EC%97%90%EC%84%9C%20Linux%20%EC%BB%A8%ED%85%8C%EC%9D%B4%EB%84%88%EB%A5%BC%20%EC%9D%B4%EB%8F%99%ED%95%98%EA%B3%A0%20%EC%8B%A4%ED%96%89%ED%95%98%EB%8A%94%20%EB%B0%A9%EB%B2%95%EC%9D%80%20%EB%AC%B4%EC%97%87%EC%9E%85%EB%8B%88%EA%B9%8C%3F.png)
Linux 컨테이너를 새 호스트로 이동하는 올바른 단계는 무엇입니까? 내가 성공하지 못한 일은 다음과 같습니다.
- Linux 컨테이너가 포함된 디렉터리를 압축합니다.
sudo tar -cjf sample_container.tar.bz2 <path-to-container>/sample_container
- 압축된 tar 파일을 새 호스트에 복사합니다(scp, rsync 등을 통해).
- 새 호스트에서 tar 파일의 압축을 풉니다.
sudo -jxvf sample_container.tar.bz2
sample_container/config
rootfs
새 경로 (예: 새 호스트의 경로) 로 업데이트
위의 단계를 수행해도 작동하지 않는 것 같습니다. 내가 뭘 잘못했나요?
고쳐 쓰다: 다음은 컨테이너를 실행하려고 할 때 얻는 로그 출력입니다.
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.