가상화 · 4 min read · Jan 19, 2026

KVM을 위한 Virtual RedHat/CentOS/Scientific Linux/Fedora Appliance 생성하기 (Fedora 17)

KVM을 위한 Virtual RedHat/CentOS/Scientific Linux/Fedora Appliance 생성하기 (Fedora 17)

버전 1.0
저자: Falko Timme
Twitter에서 나를 팔로우하세요

BoxGrinder는 여러 가상화 기술을 위한 가상 머신(운영 체제로 RedHat, CentOS, Scientific Linux 또는 Fedora 사용)을 구축할 수 있는 도구입니다. 현재 KVM, VMware, Amazon EC2, VirtualBox 및 VirtualPC를 지원합니다. 이 튜토리얼에서는 BoxGrinder를 사용하여 Fedora 17에서 CentOS 6 KVM 게스트를 생성하고 이를 원격 KVM 호스트에 배포하는 방법을 보여줍니다.

이것이 여러분에게 작동할 것이라는 보장은 하지 않습니다!

1 사전 참고

현재 BoxGrinder는 Fedora 17용 패키지로 제공되지만 RedHat/CentOS/Scientific Linux 6용은 제공되지 않습니다. 따라서 Fedora 17 시스템을 사용하여 CentOS KVM 게스트를 생성하고 이를 로컬에서 실행하거나(만약 Fedora 17을 KVM 플랫폼으로 사용하는 경우) 원격 KVM 호스트로 전송할 수 있습니다(이미지 파일과 게스트의 XML 정의 파일을 원격 호스트로 수동으로 전송할 수 있지만, BoxGrinder에는 이를 자동으로 수행할 수 있는 내장 기능도 있습니다).

2 BoxGrinder 설치하기

Fedora 시스템에 root 사용자로 로그인하고 다음을 실행하세요:

yum install rubygem-boxgrinder-build

3 BoxGrinder 사용하기

BoxGrinder의 플러그인 및 지원되는 게스트 운영 체제에 대해 알아보려면 다음을 실행하세요:

boxgrinder-build --version
[root@localhost ~]# boxgrinder-build --version  
BoxGrinder Build 0.10.4  
  
사용 가능한 os 플러그인:  
 - rhel 플러그인 for Red Hat Enterprise Linux  
 - centos 플러그인 for CentOS  
 - fedora 플러그인 for Fedora  
 - sl 플러그인 for Scientific Linux  
  
사용 가능한 플랫폼 플러그인:  
 - vmware 플러그인 for VMware  
 - ec2 플러그인 for Amazon Elastic Compute Cloud (Amazon EC2)  
 - virtualbox 플러그인 for VirtualBox  
 - virtualpc 플러그인 for VirtualPC  
  
사용 가능한 배달 플러그인:  
 - s3 플러그인 for Amazon Simple Storage Service (Amazon S3)  
 - cloudfront 플러그인 for Amazon Simple Storage Service (Amazon S3)  
 - ami 플러그인 for Amazon Simple Storage Service (Amazon S3)  
 - sftp 플러그인 for SSH File Transfer Protocol  
 - ebs 플러그인 for Elastic Block Storage  
 - local 플러그인 for Local file system  
 - elastichosts 플러그인 for ElasticHosts  
 - openstack 플러그인 for OpenStack  
 - libvirt 플러그인 for libvirt Virtualisation API  
[root@localhost ~]#

KVM은 기본적으로 지원되므로 플러그인으로 나열되지 않습니다.

BoxGrinder를 사용하는 방법을 배우려면 다음을 입력할 수 있습니다:

boxgrinder-build -h
[root@localhost ~]# boxgrinder-build -h  
Usage: boxgrinder-build [appliance definition file] [options]  
  
간단한 정의 파일에서 VM 이미지를 구축하기 위한 도구입니다.  
  
홈페이지:  
    http://boxgrinder.org/  
  
문서:  
    http://boxgrinder.org/tutorials/  
  
예시:  
    $ boxgrinder-build jeos.appl  
    $ boxgrinder-build jeos.appl -f  
    $ boxgrinder-build jeos.appl --os-config format:qcow2  
    $ boxgrinder-build jeos.appl -p vmware --platform-config type:personal,thin_disk:true  
    $ boxgrinder-build jeos.appl -p ec2 -d ami  
    $ boxgrinder-build jeos.appl -p vmware -d local  
  
옵션:  
    -p, --platform [TYPE]            변환하려는 플랫폼의 이름입니다.  
    -d, --delivery [METHOD]          선택한 appliance의 배달 방법입니다.  
    -f, --force                      이미지 생성을 강제로 수행합니다 - 선택한 appliance에 대한 모든 이전 빌드를 제거합니다. 기본값: false.  
  
플러그인 구성 옵션:  
    -l, --plugins [PLUGINS]          추가 플러그인의 쉼표로 구분된 목록입니다. 기본값: 비어 있음.  
        --os-config [CONFIG]          운영 체제 플러그인 구성 형식: key1:value1,key2:value2.  
        --platform-config [CONFIG]    플랫폼 플러그인 구성 형식: key1:value1,key2:value2.  
        --delivery-config [CONFIG]     배달 플러그인 구성 형식: key1:value1,key2:value2.  
  
로깅 옵션:  
        --debug                      빌드 중 디버그 정보를 출력합니다. 기본값: false.  
        --trace                      빌드 중 추적 정보를 출력합니다. 기본값: false.  
    -b, --backtrace                  오류가 발생할 경우 전체 백트레이스를 출력합니다. 기본값: 콘솔 로그가 디버그 또는 추적으로 설정된 경우 true, 그렇지 않으면 false.  
  
일반 옵션:  
        --change-to-user            OS 플러그인이 완료된 후 root에서 로컬 사용자로 변경합니다.  
        --help                      이 메시지를 표시합니다.  
        --version                   버전을 출력합니다.  
[root@localhost ~]#

기본적으로 이렇게 작동합니다: appliance 정의 파일(예: centos.appl)을 디렉토리(예: /usr/local/appliances)에 생성합니다:

mkdir /usr/local/appliances  
cd /usr/local/appliances/  
vi centos.appl

이 appliance 정의 파일은 KVM appliance를 설명합니다(이름, 운영 체제(현재 RedHat, CentOS, Scientific Linux 및 Fedora가 지원됨), 루트 비밀번호, CPU 수, RAM, 파티션(숫자는 GB 단위의 크기를 의미), BoxGrinder가 가상 머신을 생성할 때 자동으로 설치할 패키지):

| name: centos-6-lamp summary: CentOS 6 LAMP version: 1 release: 0 os: name: centos version: 6 password: secret hardware: cpus: 2 memory: 1024 partitions: "/": size: 4 "/var": size: 10 "swap": size: 0.5 packages: - @core - @web-server - @mysql - acpid default_repos: true # 기본값은 true |

@로 시작하는 패키지는 단일 패키지가 아니라 패키지 그룹입니다. 사용 가능한 패키지 그룹에 대해 알아보려면 다음을 실행하세요:

yum grouplist -v

사용하려는 운영 체제를 실행하는 시스템에서.

패키지 그룹의 이름은 괄호 안에 있습니다.

@ 기호로 시작하지 않는 패키지는 패키지 그룹이 아니라 정확히 그 단일 패키지입니다.

BoxGrinder는 항상 운영 체제의 최신 버전을 설치합니다. 즉, CentOS 6을 지정하면 이는 6.3을 설치한다는 의미입니다(6.3은 이 글을 작성할 당시 최신 CentOS 버전입니다).

이제 BoxGrinder를 다음과 같이 호출할 수 있습니다(centos.appl이 위치한 동일한 디렉토리에 있는지 확인하세요):

boxgrinder-build centos.appl

기본적으로 BoxGrinder는 원시 이미지를 생성합니다. 빌드 후, 이미지를 찾을 수 있습니다. 그리고 XML 정의는 디렉토리 build/appliances/////1.0/-plugin/에 있습니다. - 제 경우에는 이것이 build/appliances/i686/centos/6/centos-6-lamp/1.0/centos-plugin/로 변환됩니다:

ls -l build/appliances/i686/centos/6/centos-6-lamp/1.0/centos-plugin/
[root@localhost appliances]# ls -l build/appliances/i686/centos/6/centos-6-lamp/1.0/centos-plugin/  
total 863308  
-rwxr-xr-x. 1 root root 15569256448 Oct  5 11:44 centos-6-lamp-sda.raw  
-rw-r--r--. 1 root root         475 Oct  5 11:42 centos-6-lamp.xml  
[root@localhost appliances]#

qcow2 형식으로 appliance를 생성하려면 다음을 사용하세요:

boxgrinder-build centos.appl --os-config format:qcow2

대신:

ls -l build/appliances/i686/centos/6/centos-6-lamp/1.0/centos-plugin/
[root@localhost appliances]# ls -l build/appliances/i686/centos/6/centos-6-lamp/1.0/centos-plugin/  
total 1628824  
-rw-r--r--. 1 root root   784007168 Oct  5 11:52 centos-6-lamp-sda.qcow2  
-rw-r--r--. 1 root root         481 Oct  5 11:51 centos-6-lamp.xml  
[root@localhost appliances]#

이제 이미지를 가져와 KVM 호스트의 /var/lib/libvirt/images로 복사하고 XML 파일을 KVM 호스트의 /etc/libvirt/qemu/로 복사한 다음 virsh를 열고 XML 파일에서 새 가상 머신을 정의할 수 있지만, 이를 수동으로 수행하는 대신 BoxGrinder가 이를 대신 수행하도록 할 수 있습니다(-d 스위치 사용):

예를 들어, appliance를 로컬 KVM 설치에 추가하려면 다음을 실행하세요:

boxgrinder-build centos.appl --os-config format:qcow2 -d libvirt

이렇게 하면 이미지를 /var/lib/libvirt/images 디렉토리에 직접 복사합니다…

ls -l /var/lib/libvirt/images
[root@localhost appliances]# ls -l /var/lib/libvirt/images  
total 765636  
-rw-r--r--. 1 root root 784007168 Oct  5 11:55 centos-6-lamp-sda.qcow2  
[root@localhost appliances]#

… 그리고 XML 파일을 /etc/libvirt/qemu/ 디렉토리에:

ls -l /etc/libvirt/qemu/
[root@localhost appliances]# ls -l /etc/libvirt/qemu/  
total 8  
-rw-------. 1 root root 2135 Oct  5 11:55 centos-6-lamp-1-0-centos-6-i686-raw.xml  
drwx------. 3 root root 4096 Jun 28 15:52 networks  
[root@localhost appliances]#
Share: X/Twitter LinkedIn

새 게시물을 받은 편지함에서 받기

스팸은 없습니다. 언제든지 구독 해지 가능합니다.