차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 다음 판 | 이전 판 | ||
| rhel_cloud_qcow_이미지_설정 [2021/04/01 02:04] – 만듦 zzung | rhel_cloud_qcow_이미지_설정 [2023/11/07 08:23] (현재) – koov | ||
|---|---|---|---|
| 줄 1: | 줄 1: | ||
| - | ====== | + | <WRAP center round info 100%> |
| - | * rhel7 kvm image download | + | 해당 문서는 KVM 에 배포할 redhat qcow guest image 생성하는 방법을 작성한 문서 입니다. |
| + | |||
| + | ### 2021.08.02 RHEL8 관련 내용 추가 | ||
| + | 참고 : RHEL 8 guest image 생성시 호스트 서버가 RHEL8 이여야 한다. url : https:// | ||
| + | </ | ||
| + | |||
| + | ====== | ||
| <WRAP prewrap> | <WRAP prewrap> | ||
| <code bash> | <code bash> | ||
| - | qcow 이미지 다운로드 | + | # RHEL6 ~ RHEL7.5 url : https:// |
| + | # RHEL8.4 url : https:// | ||
| </ | </ | ||
| </ | </ | ||
| - | * qcow 이미지 | + | ====== KVM Guest Images |
| + | ===== 패키지 설치 | ||
| <WRAP prewrap> | <WRAP prewrap> | ||
| <code bash> | <code bash> | ||
| # yum -y install libguestfs-tools | # yum -y install libguestfs-tools | ||
| - | |||
| - | ## 이미 실행중인 kvm 이미지를 편집하기 위해서는 아래 패키지도 설치 해야 한다. | ||
| # yum -y install guestfish | # yum -y install guestfish | ||
| + | # systemctl start libvirtd | ||
| </ | </ | ||
| </ | </ | ||
| - | * qcow 이미지 설정 하기 | + | * RHEL 8의 경우 |
| + | <WRAP prewrap> | ||
| <code bash> | <code bash> | ||
| - | | + | [root@localhost ~]# yum -y install libguestfs-tools-c libguestfs-bash-completion |
| + | </ | ||
| + | </ | ||
| + | |||
| + | ===== guest image 편집 ===== | ||
| + | ==== root 패스워드 변경 | ||
| + | <WRAP prewrap> | ||
| + | <code bash> | ||
| + | ## rhel-server-7.9-x86_64-kvm.qcow2 이미지 있는 경로로 이동 후 작업 | ||
| # virt-customize -a rhel-server-7.9-x86_64-kvm.qcow2 --root-password password:< | # virt-customize -a rhel-server-7.9-x86_64-kvm.qcow2 --root-password password:< | ||
| [ 0.0] Examining the guest ... | [ 0.0] Examining the guest ... | ||
| 줄 26: | 줄 42: | ||
| [ 5.4] Setting passwords | [ 5.4] Setting passwords | ||
| [ 7.0] Finishing off | [ 7.0] Finishing off | ||
| + | </ | ||
| + | </ | ||
| - | 2. 설정 파일 변경하기 | + | ==== 필요한 패키지 |
| < | < | ||
| <code bash> | <code bash> | ||
| - | # guestfish | + | # virt-customize |
| + | </ | ||
| + | </ | ||
| - | Welcome to guestfish, the guest filesystem shell for | + | ==== 기타 리눅스 설정 파일 수정 방법 ==== |
| - | editing virtual machine filesystems and disk images. | + | < |
| + | <code bash> | ||
| + | ## timezone 변경 방법 | ||
| + | # virt-customize -a rhel-server-7.9-x86_64-kvm.qcow2 --run-command "rm -rf / | ||
| + | # virt-customize -a rhel-server-7.9-x86_64-kvm.qcow2 --run-command "ln -s / | ||
| - | Type: ‘help’ for help on commands | + | ## RHEL8 timezone 변경 방법 |
| - | | + | # virt-customize -a rhel-8.4-x86_64-kvm.qcow2 --timezone " |
| - | | + | |
| + | ## repository 추가 방법 | ||
| + | # virt-customize -a rhel-server-7.9-x86_64-kvm.qcow2 --copy-in [로컬파일]: | ||
| - | >< | ||
| - | >< | ||
| - | /dev/sda1: xfs | ||
| - | >< | ||
| - | >< | ||
| - | >< | ||
| - | >< | ||
| - | >< | ||
| - | >< | ||
| </ | </ | ||
| </ | </ | ||
| + | |||
| + | |||
| + | ==== RHEL8 Guest Image 생성 안되는 현상 | ||
| + | < | ||
| + | <code bash> | ||
| + | ## RHEL7 기반에서 RHEL8 Guest Image 편집 시 아래와 같은 문구가 발생 하면서 편집이 안됨 | ||
| + | # virt-customize -a rhel-8.4.qcow2 --root-password password: | ||
| + | virt-customize: | ||
| + | fs type, bad option, bad superblock on /dev/sda1, | ||
| + | | ||
| + | |||
| + | In some cases useful info is found in syslog - try | ||
| + | dmesg | tail or so. (ignored) | ||
| + | virt-customize: | ||
| + | ' | ||
| + | |||
| + | If reporting bugs, run virt-customize with debugging enabled and include | ||
| + | the complete output: | ||
| + | |||
| + | virt-customize -v -x [...] | ||
| + | | ||
| + | | ||
| + | ## 해결 | ||
| + | RHEL7 기반 호스트 에서 RHEL8 GuestImage 생성 할 수 없다. | ||
| + | RHEL8 기반 호스트 에서 이미지 편집을 해야 한다. | ||
| + | 또한 virt-customize 로만 편집이 가능하며, | ||
| + | |||
| + | </ | ||
| + | </ | ||
| + | |||
| + | ===== 오류 ===== | ||
| + | |||
| + | <WRAP prewrap> | ||
| + | <code bash> | ||
| + | [ 0.0] Examining the guest ... | ||
| + | virt-customize: | ||
| + | libvirt. | ||
| + | |||
| + | Try running qemu directly without libvirt using this environment variable: | ||
| + | export LIBGUESTFS_BACKEND=direct | ||
| + | |||
| + | Original error from libvirt: Cannot access storage file | ||
| + | '/ | ||
| + | gid:107): Permission denied [code=38 int1=13] | ||
| + | |||
| + | If reporting bugs, run virt-customize with debugging enabled and include | ||
| + | the complete output: | ||
| + | |||
| + | virt-customize -v -x [...] | ||
| + | </ | ||
| + | </ | ||
| + | 위의 경우 환경변수에 '' | ||
| + | 에러메시지에 나온대로 '' | ||
| + | |||