"VMware에 KVM 설치 실습"의 두 판 사이의 차이

237번째 줄: 237번째 줄:
[root@kvm01 ~]# vi /etc/hosts
[root@kvm01 ~]# vi /etc/hosts
</source>
</source>
<source lang='aconf'>
<source lang='aconf' highlight='4-6'>
127.0.0.1  localhost localhost.localdomain localhost4 localhost4.localdomain4
127.0.0.1  localhost localhost.localdomain localhost4 localhost4.localdomain4
::1        localhost localhost.localdomain localhost6 localhost6.localdomain6
::1        localhost localhost.localdomain localhost6 localhost6.localdomain6
10.1.1.250 workstation.example.com
10.1.1.250 workstation.example.com
10.1.1.11 kvm01.example.com
10.1.1.11 kvm01.example.com

2016년 11월 14일 (월) 13:59 판

VMware에 KVM 설치 실습

1 사전작업

2 네트워크 설정

  • Edit --- Virtual Network Editor
  • VMnet8 선택 --- Subnet IP: 10.1.1.0[1] --- [Apply]
  • [OK]

3 kvm01 생성

  • Create a New Virtual Machine
  • "Welcome to the New Virtual Machine Wizard"--- (O) Custom --- [Next >]
  • "Choose the Virtual Machine Hardware Compatibility" --- [Next >]
  • "Guest Operating System Installation" --- (O) I will install the operating system later --- [Next >]
  • "Select a Guest Operation System" --- (O) Linux --- Version: CentOS 64-bit --- [Next >]
  • "Name the Virtual Machine" --- Virtual machine name: kvm01 --- Location: D:\vm\kvm01[2] --- [Next >]
  • Number of cores per procesors: 2[3] --- [Next >]
  • Memory for the Virtual Machine --- 4GB 클릭 -- [Next >]
  • "Network Type"[4] --- [Next >]
  • "Select I/O Controller Types"[5] --- [Next >]
  • "Select a Disk Type"[6] --- [Next >]
  • "Select Disk"[7] --- [Next >]
  • "Specify Disk Capacity" --- Maximum disk size (GB): 100 --- (O) Store virtual disk as a single file --- [Next >]
  • "Specify Disk File" --- D:\vm\kvm01\kvm01.vmdk --- [Next >]
  • "Ready to Create Virtual Machine" --- [Customize Hardware...]
  • "Hardware" --- Processors 선택 --- [v] Virtualize Intel VT-x/EPT or AMD-V/RVI
  • New CD/DVD (IDE) 선택 --- (O) Use ISO image files: --- [Browse...] --- CentOS.xxx.iso 파일 선택
  • [Close]
  • [Finish]
  • [▶ Power on this virtual machine]

4 kvm01에 CentOS 7 설치

  • Install CentOS 7
  • "Press the <ENTER> key to begin the installation..." --- Enter
  • "WELCOME TO CENTOS 7"[8] --- [Continue]
  • SOFTWARE SELECTION
  • Base Environment: (O) Virtualization Host
  • Add-Ons For Selected Environment: [v] Remote Management for Linux, [v] Virtualization Platform, [v] Development Tools
  • 좌상단 [Done]
  • INSTALLATION DESTINATION --- [Done]
  • NETWORK & HOST NAME --- "Ethernet (eno16777736)" ON --- Host name: kvm01.example.com --- [Done]
  • [Begin Installation]
  • ROOT PASSWORD --- Root Password: P@ssw0rd --- Confirm: P@ssw0rd --- [Done], [Done][9]

( 설치 진행 )

  • [Reboot]

5 kvm01에 VMware Tools 설치

  • VM --- VMware Tools Installation
  • 리눅스 로그인
[root@kvm01 ~]# mkdir /mnt/cdrom
[root@kvm01 ~]# mount /dev/cdrom /mnt/cdrom/
mount: /dev/sr0 is write-protected, mounting read-only
[root@kvm01 ~]# tar xvf /mnt/cdrom/VMware Tools-10.0.6-3595377.tar.gz -C /tmp/
[root@kvm01 ~]# /tmp/vmware-tools-distrib/vmware-install.pl
open-vm-tools are available from the OS vendor and VMware recommends using
open-vm-tools. See http://kb.vmware.com/kb/2073803 for more information.
Do you still want to proceed with this legacy install? [no]
yes Enter, Enter, Enter, Enter, Enter ... .... 엔터 신공

6 workstation 생성

  • File --- New Virtual Machine
  • "Welcome to the New Virtual Machine Wizard"[10] --- [Next >]
  • "Choose the Virtual Machine Hardware Compatibility" --- [Next >]
  • "Guest Operating System Installation"[11] --- [Next >]
  • "Select a Guest Operation System"[12] --- [Next >]
  • "Name the Virtual Machine" --- Virtual machine name: workstation --- Location: D:\vm\workstation --- [Next >]
  • Number of cores per procesors: 2[13] --- [Next >]
  • Memory for the Virtual Machine --- 2 GB 클릭 -- [Next >]
  • "Network Type"[14] --- [Next >]
  • "Select I/O Controller Types"[15] --- [Next >]
  • "Select a Disk Type"[16] --- [Next >]
  • "Select Disk"[17] --- [Next >]
  • "Specify Disk Capacity" --- Maximum disk size (GB): 30 --- (O) Store virtual disk as a single file --- [Next >]
  • "Specify Disk File"[18] --- [Next >]
  • "Ready to Create Virtual Machine" --- [Customize Hardware...]
  • "Hardware" --- Processors 선택 --- [v] Virtualize Intel VT-x/EPT or AMD-V/RVI
  • New CD/DVD (IDE) 선택 --- (O) Use ISO image files: --- [Browse...] --- CentOS.xxx.iso 파일 선택
  • [Close]
  • [Finish]
  • [▶ Power on this virtual machine]

7 workstation 리눅스 설치

  • Install CentOS 7
  • "Press the <ENTER> key to begin the installation..." --- Enter
  • "WELCOME TO CENTOS 7"[19] --- [Continue]
  • SOFTWARE SELECTION
  • Base Environment: (O) GNOME Desktop
  • Add-Ons For Selected Environment: [v] GNOME Applications, [v] Compatibility Librarries, [v] Development Tools
  • 좌상단 [Done]
  • INSTALLATION DESTINATION --- [Done]
  • NETWORK & HOST NAME --- "Ethernet (eno16777736)" ON --- Host name: worksation.example.com --- [Done]
  • [Begin Installation]
  • ROOT PASSWORD --- Root Password: P@ssw0rd --- Confirm: P@ssw0rd --- [Done], [Done][20]

( 설치 진행 )

  • [Reboot]

( 재부팅 진행 ) GUI 화면

  • "Welcome" --- 한국어 v --- [다음(N)]
  • "입력기 선택" --- [다음(N)]
  • "로컬 계정 만들기" --- 전체 이름(F): testuser --- 사용자 이름(U): testuser --- 암호(P): P@ssw0rd --- 암호 확인(C): P@ssw0rd --- [다음(N)]
  • 위치를 선택하십시오: Seoul, South Korea --- [다음(N)]
  • "클라우드에 있는 데이터로 연결" --- [다음(N)]
  • "감사합니다" --- [Start using CentOS Linux]
  • 프로그램 --- 유틸리티 --- 터미널
[testuser@workstation ~]$ su -
암호: P@ssw0rd
마지막 로그인: ... (생략)
[root@workstation ~]#

8 kvm02 폴더 생성

kvm01을 복제하여 kvm02를 생성한다.

  • (탐색기) D:\vm 로 이동
  • kvm02 폴더 생성
  • kvm01 폴더의 kvm01.vmdk 파일을 kvm02 폴더에 복사
  • kvm01.vmdk를 kvm02.vmdk 로 이름변경

9 kvm02 생성

  • (VMware Workstation) File --- New Virtual Machine
  • "Welcome to the New Virtual Machine Wizard"[21] --- [Next >]
  • "Choose the Virtual Machine Hardware Compatibility" --- [Next >]
  • "Guest Operating System Installation"[22] --- [Next >]
  • "Select a Guest Operation System"[23] --- [Next >]
  • "Name the Virtual Machine" --- Virtual machine name: kvm02 --- Location: D:\vm\kvm02--- [Next >]
  • "The specified location appears to contain an existing virtual machine. ... Would you like to continue with this location?" --- [Continue]
  • Number of cores per procesors: 2[24] --- [Next >]
  • Memory for the Virtual Machine --- 2 GB 클릭 -- [Next >]
  • "Network Type"[25] --- [Next >]
  • "Select I/O Controller Types"[26] --- [Next >]
  • "Select a Disk Type"[27] --- [Next >]
  • "Select Disk" --- (O) Use an existing virtual disk --- [Next >]
  • "Select an Existing Disk" --- D:\vm\kvm02\kvm02.vmdk --- [Next >]
  • "Ready to Create Virtual Machine" --- [Customize Hardware...]
  • "Hardware" --- Processors 선택 --- [v] Virtualize Intel VT-x/EPT or AMD-V/RVI
  • [Close]
  • [Finish]
  • [▶ Power on this virtual machine]

10 kvm02 리눅스 설정

  • root 로그인
  • 호스트명을 kvm02.example.com 으로 변경
[root@kvm01 ~]# hostnamectl set-hostname kvm02.example.com
[root@kvm01 ~]# hostname
kvm02.example.com
[root@kvm01 ~]# cat /etc/hostname
kvm02.example.com
  • 로그아웃하고 다시 로그인
[root@kvm02 ~]#

11 네트워크 설정

  • 본문단은 kvm01 기준으로 작성되어 있음
  • kvm02, workstation도 동일한 방식으로 설정 (IP만 다르게)
호스트명 IP주소 게이트웨이 DNS
kvm01 10.1.1.11 10.1.1.2 10.1.1.2
kvm02 10.1.1.12 10.1.1.2 10.1.1.2
workstation 10.1.1.250 10.1.1.2 10.1.1.2

11.1 IP 설정

  • (VMware) My Computer의 kvm01 선택
[root@kvm01 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eno16777736
TYPE="Ethernet"
#BOOTPROTO="dhcp"
BOOTPROTO="none"
DEFROUTE="yes"
PEERDNS="yes"
PEERROUTES="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_FAILURE_FATAL="no"
NAME="eno16777736"
UUID="0d2ad468-e1c3579b-b2d4-5b6e8f035791"
DEVICE="eno16777736"
ONBOOT="yes"
IPADDR="10.1.1.11"
NETMASK="255.255.255.0"
[root@kvm01 ~]# vi /etc/sysconfig/network
# Created by anaconda
NETWORKING="yes"
GATEWAY="10.1.1.2"
[root@kvm01 ~]# systemctl restart network
[root@kvm01 ~]# ping 8.8.8.8 -c1
64 bytes from 8.8.8.8: icmp_seq=1 ttl=128 time=31.6 ms
... (생략)

11.2 DNS 설정

[root@kvm01 ~]# vi /etc/resolv.conf
# Generated by NetworkManager
search example.com

# No nameservers found: try putting DNS servers into youre
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
namserver 10.1.1.2
[root@kvm01 ~]# ping google.com -c1
64 bytes from cache.google.com (59.18.35.94): icmp_seq=1 ttl=128 time=2.19 ms
... (생략)


11.3 hosts 파일 수정

[root@kvm01 ~]# vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

10.1.1.250 workstation.example.com
10.1.1.11 kvm01.example.com
10.1.1.12 kvm02.example.com

11.4 방화벽, SELinux 비활성화

[root@kvm01 ~]# systemctl stop firewalld.service
[root@kvm01 ~]# systemctl disable firewalld.service
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service`
rm '/etc/systemd/system/basic.target.wants/firewalld.service`
[root@kvm01 ~]# setenforce 0
[root@kvm01 ~]# vi /etc/selinux/config
#SELINUX=enforcing
SELINUX=permissive

11.5 yum update

[root@kvm01 ~]# yum update -y
... (생략)

12 같이 보기

13 주석

  1. Subnet mask: 255.255.255.0
  2. 폴더를 만들어서 하자.
  3. Number of processors: 1
  4. (O) Use network address translation (NAT)
  5. (O) LSI Logic (Recommended)
  6. SCSI (Recommended)
  7. (O) Create a new virtual disk
  8. English
  9. 취약한 패스워드라서...;;
  10. (O) Custom
  11. (O) I will install the operating system later
  12. (O) Linux --- Version: CentOS 64-bit
  13. Number of processors: 1
  14. (O) Use network address translation (NAT)
  15. (O) LSI Logic (Recommended)
  16. SCSI (Recommended)
  17. (O) Create a new virtual disk
  18. workstation.vmdk
  19. English
  20. 취약한 패스워드라서...;;
  21. (O) Custom
  22. (O) I will install the operating system later
  23. (O) Linux --- Version: CentOS 64-bit
  24. Number of processors: 1
  25. (O) Use network address translation (NAT)
  26. (O) LSI Logic (Recommended)
  27. SCSI (Recommended)
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}