lxc 설치

페이지 정보

작성자 조희승 댓글 0건 조회 8,548회 작성일 15-09-09 14:46

본문

bridge 설정
http://askubuntu.com/questions/256304/public-ip-address-for-lxc-container




-P 생성할때 안 쓰는게 나음.
이후 모든 명령에서 -P를 붙여줘야 인식함


lxc-start: lxc_start.c: main: 296 Executing '/sbin/init' with no configuration file may crash the host
--> -P의 위치를 지정하고 생성했다면, default위치에서 인식하지 못하기 때문에 생기는 에러임


root fs의 위치 (특별히 지정하지 않으면)
template : /var/cache/lxc/trusty/rootfs-amd64
container : /var/lib/lxc/NAME/rootfs ...




자동실행
/var/lib/lxc/iter0/config 에 아래 추가
lxc.start.auto = 1
lxc.start.delay = 5





1. lxc란?
 - LXC (LinuX Containers) is an operating system-level virtualization
 - running multiple isolated Linux systems (containers)
 - linux kernel의 cgroups 와 namespace-isolation을 사용
 - chroot로 file system 제공
 - http://en.wikipedia.org/wiki/LXC


2. lxc 설치
 - Ubuntu 12.04 64bit에서 테스트 수행
 - # apt-get install lxc


3. 사용법

 - 편의를 위해 lxc.conf 파일 생성
  lxc.network.type=veth
  lxc.network.link=lxcbr0
  lxc.network.flags=up

 - linux container 생성
 - # lxc-create -n myubuntu -t ubuntu -f ./lxc.conf
 - # lxc-create -n myubuntu -t ubuntu -P /my/path

 - Ubuntu core package를 /var/cache/lxc/precise/rootfs-amd64 에 다운로드
 - 추후 같은 type을 생성할 경우 재사용됨
 - 다운로드 받은 후 /var/lib/lxc/myubuntu/rootfs 에 패키지 설치




 - container 실행
 - # lxc-start -n myubuntu
 - # lxc-start -n myubuntu -P /my/path
 - 초기 id/pw = ubuntu/ubuntu

lxc-start -n container-name -d
lxc-console -n container-name
  (console에서 나오려면 ctrl+a q)







Appendix
 - https://help.ubuntu.com/12.04/serverguide/lxc.html
 - http://theqvd.com/blog/creating-lxc-images-for-qvd

댓글목록

등록된 댓글이 없습니다.