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

잔글 (봇: 자동으로 텍스트 교체 (-<source +<syntaxhighlight , -</source> +</syntaxhighlight>))
 
(다른 사용자 한 명의 중간 판 48개는 보이지 않습니다)
10번째 줄: 10번째 줄:
* [OK]
* [OK]


==kvm01 생성==
==[kvm01] 생성==
* Create a New Virtual Machine
* Create a New Virtual Machine
* "Welcome to the New Virtual Machine Wizard"--- (O) Custom --- [Next >]
* "Welcome to the New Virtual Machine Wizard"--- (O) Custom --- [Next >]
32번째 줄: 32번째 줄:
* [▶ Power on this virtual machine]
* [▶ Power on this virtual machine]


==kvm01에 CentOS 7 설치==
==[kvm01] CentOS 7 설치==
* Install CentOS 7  
* Install CentOS 7  
* "Press the <ENTER> key to begin the installation..." --- {{Enter}}
* "Press the <ENTER> key to begin the installation..." --- {{Enter}}
47번째 줄: 47번째 줄:
* [Reboot]
* [Reboot]


==kvm01에 VMware Tools 설치==
==[kvm01] VMware Tools 설치==
{{참고|VMware Tools 설치}}
* VM --- VMware Tools Installation
* VM --- VMware Tools Installation
* 리눅스 로그인
* 리눅스 로그인
<source lang='console'>
<syntaxhighlight lang='console'>
[root@kvm01 ~]# mkdir /mnt/cdrom
[root@kvm01 ~]# mkdir /mnt/cdrom
[root@kvm01 ~]# mount /dev/cdrom /mnt/cdrom/
[root@kvm01 ~]# mount /dev/cdrom /mnt/cdrom/
59번째 줄: 60번째 줄:
open-vm-tools. See http://kb.vmware.com/kb/2073803 for more information.
open-vm-tools. See http://kb.vmware.com/kb/2073803 for more information.
Do you still want to proceed with this legacy install? [no]
Do you still want to proceed with this legacy install? [no]
</source>
</syntaxhighlight>
:yes {{Enter}}, {{Enter}}, {{Enter}}, {{Enter}}, {{Enter}} ... .... 엔터 신공
:yes {{Enter}}, {{Enter}}, {{Enter}}, {{Enter}}, {{Enter}} ... .... 엔터 신공


==workstation 생성==
==[workstation] 생성==
* File --- New Virtual Machine
* File --- New Virtual Machine
* "Welcome to the New Virtual Machine Wizard"<ref>(O) Custom</ref> --- [Next >]
* "Welcome to the New Virtual Machine Wizard"<ref>(O) Custom</ref> --- [Next >]
84번째 줄: 85번째 줄:
* [▶ Power on this virtual machine]
* [▶ Power on this virtual machine]


==workstation 리눅스 설치==
==[workstation] 리눅스 설치==
* Install CentOS 7  
* Install CentOS 7  
* "Press the <ENTER> key to begin the installation..." --- {{Enter}}
* "Press the <ENTER> key to begin the installation..." --- {{Enter}}
106번째 줄: 107번째 줄:
* "클라우드에 있는 데이터로 연결" --- [다음(N)]
* "클라우드에 있는 데이터로 연결" --- [다음(N)]
* "감사합니다" --- [Start using CentOS Linux]
* "감사합니다" --- [Start using CentOS Linux]
* 프로그램 --- 유틸리티 --- 터미널
<syntaxhighlight lang='console'>
[testuser@workstation ~]$ su -
암호: P@ssw0rd
마지막 로그인: ... (생략)
[root@workstation ~]#
</syntaxhighlight>


==kvm02 폴더 생성==
==kvm02 폴더 생성==
114번째 줄: 122번째 줄:
* kvm01.vmdk를 kvm02.vmdk 로 이름변경
* kvm01.vmdk를 kvm02.vmdk 로 이름변경


==kvm02 생성==
==[kvm02] 생성==
* (VMware Workstation) File --- New Virtual Machine
* (VMware Workstation) File --- New Virtual Machine
* "Welcome to the New Virtual Machine Wizard"<ref>(O) Custom</ref> --- [Next >]
* "Welcome to the New Virtual Machine Wizard"<ref>(O) Custom</ref> --- [Next >]
135번째 줄: 143번째 줄:
* [▶ Power on this virtual machine]
* [▶ Power on this virtual machine]


==kvm02 리눅스 설정==
==[kvm02] 리눅스 설정==
* root 로그인
* root 로그인
* 호스트명을 kvm02.example.com 으로 변경
* 호스트명을 kvm02.example.com 으로 변경
<source lang='console'>
<syntaxhighlight lang='console'>
[root@kvm01 ~]# hostnamectl set-hostname kvm02.example.com
[root@kvm01 ~]# hostnamectl set-hostname kvm02.example.com
[root@kvm01 ~]# hostname
[root@kvm01 ~]# hostname
144번째 줄: 152번째 줄:
[root@kvm01 ~]# cat /etc/hostname
[root@kvm01 ~]# cat /etc/hostname
kvm02.example.com
kvm02.example.com
</source>
</syntaxhighlight>
* 로그아웃하고 다시 로그인
* 로그아웃하고 다시 로그인
<source lang='console'>
<syntaxhighlight lang='console'>
[root@kvm02 ~]#
[root@kvm02 ~]#
</source>
</syntaxhighlight>
 
==[kvm01, kvm02, workstation] 네트워크 설정==
* 다음과 같은 구성으로 네트워크를 설정할 것이다.
* 본 문단은 kvm01 기준으로 작성되어 있는데, kvm02, workstation도 동일한 방식으로 설정하면 된다. (IP만 다르게)


==네트워크 설정==
{| class='wikitable'
{| class='wikitable'
! 호스트명 !! IP주소 !! 게이트웨이 !! DNS
! 호스트명 !! IP주소 !! 게이트웨이 !! DNS
161번째 줄: 172번째 줄:
|}
|}


===IP 설정===
* (VMware) My Computer의 kvm01 선택
* (VMware) My Computer의 kvm01 선택
<source lang='console'>
<syntaxhighlight lang='console'>
[root@kvm01 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eno16777736
[root@kvm01 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eno16777736
</source>
</syntaxhighlight>
<source lang='aconf' highlight='2,3,18,19'>
<syntaxhighlight lang='aconf' highlight='2,3,18,19'>
TYPE="Ethernet"
TYPE="Ethernet"
#BOOTPROTO="dhcp"
#BOOTPROTO="dhcp"
185번째 줄: 197번째 줄:
IPADDR="10.1.1.11"
IPADDR="10.1.1.11"
NETMASK="255.255.255.0"
NETMASK="255.255.255.0"
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
[root@kvm01 ~]# vi /etc/sysconfig/network
[root@kvm01 ~]# vi /etc/sysconfig/network
</source>
</syntaxhighlight>
<source lang='aconf' highlight='2,3'>
<syntaxhighlight lang='aconf' highlight='2,3'>
# Created by anaconda
# Created by anaconda
NETWORKING="yes"
NETWORKING="yes"
GATEWAY="10.1.1.2"
GATEWAY="10.1.1.2"
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
[root@kvm01 ~]# systemctl restart network
[root@kvm01 ~]# systemctl restart network
[root@kvm01 ~]# ping 8.8.8.8 -c1
[root@kvm01 ~]# ping 8.8.8.8 -c1
64 bytes from 8.8.8.8: icmp_seq=1 ttl=128 time=31.6 ms
64 bytes from 8.8.8.8: icmp_seq=1 ttl=128 time=31.6 ms
... (생략)
... (생략)
</source>
</syntaxhighlight>
<source lang='console'>
===DNS 설정===
<syntaxhighlight lang='console'>
[root@kvm01 ~]# vi /etc/resolv.conf
[root@kvm01 ~]# vi /etc/resolv.conf
</source>
</syntaxhighlight>
<source lang='aconf'>
<syntaxhighlight lang='aconf' highlight='10'>
# Generated by NetworkManager
# Generated by NetworkManager
search example.com
search example.com
214번째 줄: 227번째 줄:
# DOMAIN=lab.foo.com bar.foo.com
# DOMAIN=lab.foo.com bar.foo.com
namserver 10.1.1.2
namserver 10.1.1.2
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
[root@kvm01 ~]# ping google.com -c1
[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
64 bytes from cache.google.com (59.18.35.94): icmp_seq=1 ttl=128 time=2.19 ms
... (생략)
... (생략)
</source>
</syntaxhighlight>
:kvm02, workstation 동일한 방식으로 설정 (IP만 다르게. 본 문단의 첫부분 참고)
 
 
===hosts 파일 수정===
<syntaxhighlight lang='console'>
[root@kvm01 ~]# vi /etc/hosts
</syntaxhighlight>
<syntaxhighlight lang='aconf' highlight='4-6'>
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
</syntaxhighlight>


==방화벽, SELinux 비활성화==
===방화벽, SELinux 비활성화===
<source lang='console'>
<syntaxhighlight lang='console'>
[root@kvm01 ~]# systemctl stop firewalld
[root@kvm01 ~]# systemctl stop firewalld.service
[root@kvm01 ~]# systemctl disable firewalld
[root@kvm01 ~]# systemctl disable firewalld.service
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service`
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service`
rm '/etc/systemd/system/basic.target.wants/firewalld.service`
rm '/etc/systemd/system/basic.target.wants/firewalld.service`
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
[root@kvm01 ~]# setenforce 0
[root@kvm01 ~]# setenforce 0
[root@kvm01 ~]# vi /etc/selinux/config
[root@kvm01 ~]# vi /etc/selinux/config
</source>
</syntaxhighlight>
<source lang='aconf'>
<syntaxhighlight lang='aconf'>
#SELINUX=enforcing
#SELINUX=enforcing
SELINUX=permissive
SELINUX=permissive
</source>
</syntaxhighlight>


==yum update==
===yum update===
<source lang='console'>
<syntaxhighlight lang='console'>
[root@kvm01 ~]# yum update -y
[root@kvm01 ~]# yum update -y
... (생략)
... (생략)
</source>
</syntaxhighlight>
 
==[workstation] 공유폴더 설정==
* workstation 우클릭 --- Power --- Shut Down --- [Shut Down]
* workstation 우클릭 --- Settings...
* "Virtual Machine Settings" --- Options 탭 --- Shared Folders --- (O) Always enabled --- [Add...]
* "Add Shared Folder Wizard" --- [Next >]
* Host Path: D:\vm\shared --- [Next >]
* "The specified directory ... Would your like to create the dirctory or ignore this?" --- [Create]
* [Finish]
* [OK]
* 공유폴더 D:\vm\shared 에 CentOS....iso 파일 복사해 넣기
 
==[workstation] open-vm-tools 제거==
* workstation 우클릭 --- Power --- Start Up Guest
* GUI 로그인
* 터미널 시작
<syntaxhighlight lang='console'>
[testuser@workstation ~]$ su -
암호: P@ssw0rd
[root@workstation ~]#
</syntaxhighlight>
<syntaxhighlight lang='console'>
[root@workstation ~]# yum remove open-vm-tools
... (생략)
================================================================================
Package                    Arch        Version            Repository    Size
================================================================================
Removing:
open-vm-tools              x86_64      9.10.2-5.el7_2      @updates      1.4 M
Removing for dependencies:
open-vm-tools-desktop      x86_64      9.10.2-5.el7_2      @updates      435 k
 
Transaction Summary
================================================================================
Remove  1 Package (+1 Dependent package)
 
Installed size: 1.8 M
Is this ok [y/N]: y
</syntaxhighlight>
<syntaxhighlight lang='console'>
... (생략)
Removed:
  open-vm-tools.x86_64 0:9.10.2-5.el7_2                                       
 
Dependency Removed:
  open-vm-tools-desktop.x86_64 0:9.10.2-5.el7_2                               
 
Complete!
</syntaxhighlight>
 
==[workstation] VMware Tools 설치==
{{참고|리눅스 VMware Tools 설치}}
* (VMware) VM --- Reinstall VMware Tools... --- "The guest operating system has locked the CD-ROM door ... Disconnect anyway and override the lock?" --- [Yes]
<syntaxhighlight lang='console'>
[root@workstation ~]# mkdir /mnt/cdrom
[root@workstation ~]# mount /dev/cdrom /mnt/cdrom/
mount: /dev/sr0 is write-protected, mounting read-only
[root@workstation ~]# tar xvf /mnt/cdrom/VMware Tools-10.0.6-3595377.tar.gz -C /tmp/
[root@workstation ~]# /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
</syntaxhighlight>
:→ yes {{Enter}}, {{Enter}}, {{Enter}}, {{Enter}}, ...
 
==workstation → kvm01 iso파일 복제==
<syntaxhighlight lang='console'>
[root@workstation ~]# ll /mnt/hgfs/shared/
CentOS-7-x86_64-DVD-1503-01.iso
[root@workstation ~]# scp /mnt/hgfs/shared/CentOS-7-x86_64-DVD-1503-01.iso kvm01:/var/lib/libvirt/images/
ECDSA key fingerprint is ...
Are you sure you want to continue conecting (yes/no)? yes
Warning:  Permanently added 'kvm01, 10.1.1.11' (ECDSA) to the list of know hosts.
root@kvm01's password: P@ssw0rd
CentOS-7-x86_64-DVD-1503-01.iso                                            100% 4111MB 23.6MB/s
</syntaxhighlight>
 
==[kvm01, kvm02, workstation] 가상화 클라이언트 설치==
<syntaxhighlight lang='console'>
[root@kvm01 ~]# yum groupinstall "Virtualization client" -y
</syntaxhighlight>
 
==[kvm01, kvm02] X 윈도우 설치==
<syntaxhighlight lang='console'>
[root@kvm01 ~]# yum groupinstall "X Window System" -y
</syntaxhighlight>
 
==virt-manager==
<syntaxhighlight lang='console'>
[root@workstation ~]# virt-manager
</syntaxhighlight>
* "가상 머신 관리자"
* 파일(F) --- 연결 추가...(A)
* "연결 추가" --- [v] 원격 호스트에 연결(R) --- 호스트명(O): kvm01.example.com --- 연결(n)
* "systemd 프로그램에서 패키지를 설치하려 합니다." --- [설치]
* "OpenSSH" --- "Are you sure you want to continue connectiong (yes/no)?: yes {{Enter}} --- "root@kvm01.example.com's password: P@ssw0rd {{Enter}}
* 파일(F) --- 연결 추가...(A)
* "연결 추가" --- [v] 원격 호스트에 연결(R) --- 호스트명(O): kvm02.example.com --- 연결(n)
* "systemd 프로그램에서 패키지를 설치하려 합니다." --- [설치]
* "OpenSSH" --- "Are you sure you want to continue connectiong (yes/no)?: yes {{Enter}} --- "root@kvm01.example.com's password: P@ssw0rd {{Enter}}
* 파일(F) --- 새 가상 머신 (N)
* "새 가상 머신" --- 연결(O): QEMU/KVM: kvm01.example.com --- [앞으로(F)]
* (O) ISO 이미지 사용: [검색(W)...] --- CentOS-7-...iso 선택 --- [볼륨 선택]
* OS 종류(T): Linux --- 버전(V): CentOS 7.0 --- [앞으로(F)]
* "CPU와 메모리 설정 선택"<ref>메모리(RAM)(M): 1024 MiB --- CPU들 1</ref> --- [앞으로(F)]
* "5 중 4 단계" --- [앞으로(F)]
* "5 중 5 단계" --- 이름(N): vm01 --- [완료(F)]
* "OpenSSH" --- P@ssw0rd {{Enter}}


==같이 보기==
==같이 보기==

2021년 9월 24일 (금) 23:29 기준 최신판

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] 네트워크 설정[ | ]

  • 다음과 같은 구성으로 네트워크를 설정할 것이다.
  • 본 문단은 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 [workstation] 공유폴더 설정[ | ]

  • workstation 우클릭 --- Power --- Shut Down --- [Shut Down]
  • workstation 우클릭 --- Settings...
  • "Virtual Machine Settings" --- Options 탭 --- Shared Folders --- (O) Always enabled --- [Add...]
  • "Add Shared Folder Wizard" --- [Next >]
  • Host Path: D:\vm\shared --- [Next >]
  • "The specified directory ... Would your like to create the dirctory or ignore this?" --- [Create]
  • [Finish]
  • [OK]
  • 공유폴더 D:\vm\shared 에 CentOS....iso 파일 복사해 넣기

13 [workstation] open-vm-tools 제거[ | ]

  • workstation 우클릭 --- Power --- Start Up Guest
  • GUI 로그인
  • 터미널 시작
[testuser@workstation ~]$ su -
암호: P@ssw0rd
[root@workstation ~]#
[root@workstation ~]# yum remove open-vm-tools
... (생략)
================================================================================
 Package                    Arch        Version             Repository     Size
================================================================================
Removing:
 open-vm-tools              x86_64      9.10.2-5.el7_2      @updates      1.4 M
Removing for dependencies:
 open-vm-tools-desktop      x86_64      9.10.2-5.el7_2      @updates      435 k

Transaction Summary
================================================================================
Remove  1 Package (+1 Dependent package)

Installed size: 1.8 M
Is this ok [y/N]: y
... (생략)
Removed:
  open-vm-tools.x86_64 0:9.10.2-5.el7_2                                         

Dependency Removed:
  open-vm-tools-desktop.x86_64 0:9.10.2-5.el7_2                                 

Complete!

14 [workstation] VMware Tools 설치[ | ]

  • (VMware) VM --- Reinstall VMware Tools... --- "The guest operating system has locked the CD-ROM door ... Disconnect anyway and override the lock?" --- [Yes]
[root@workstation ~]# mkdir /mnt/cdrom
[root@workstation ~]# mount /dev/cdrom /mnt/cdrom/
mount: /dev/sr0 is write-protected, mounting read-only
[root@workstation ~]# tar xvf /mnt/cdrom/VMware Tools-10.0.6-3595377.tar.gz -C /tmp/
[root@workstation ~]# /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
→ yes Enter, Enter, Enter, Enter, ...

15 workstation → kvm01 iso파일 복제[ | ]

[root@workstation ~]# ll /mnt/hgfs/shared/
CentOS-7-x86_64-DVD-1503-01.iso
[root@workstation ~]# scp /mnt/hgfs/shared/CentOS-7-x86_64-DVD-1503-01.iso kvm01:/var/lib/libvirt/images/
ECDSA key fingerprint is ...
Are you sure you want to continue conecting (yes/no)? yes
Warning:  Permanently added 'kvm01, 10.1.1.11' (ECDSA) to the list of know hosts.
root@kvm01's password: P@ssw0rd
CentOS-7-x86_64-DVD-1503-01.iso                                            100% 4111MB 23.6MB/s

16 [kvm01, kvm02, workstation] 가상화 클라이언트 설치[ | ]

[root@kvm01 ~]# yum groupinstall "Virtualization client" -y

17 [kvm01, kvm02] X 윈도우 설치[ | ]

[root@kvm01 ~]# yum groupinstall "X Window System" -y

18 virt-manager[ | ]

[root@workstation ~]# virt-manager
  • "가상 머신 관리자"
  • 파일(F) --- 연결 추가...(A)
  • "연결 추가" --- [v] 원격 호스트에 연결(R) --- 호스트명(O): kvm01.example.com --- 연결(n)
  • "systemd 프로그램에서 패키지를 설치하려 합니다." --- [설치]
  • "OpenSSH" --- "Are you sure you want to continue connectiong (yes/no)?: yes Enter --- "root@kvm01.example.com's password: P@ssw0rd Enter
  • 파일(F) --- 연결 추가...(A)
  • "연결 추가" --- [v] 원격 호스트에 연결(R) --- 호스트명(O): kvm02.example.com --- 연결(n)
  • "systemd 프로그램에서 패키지를 설치하려 합니다." --- [설치]
  • "OpenSSH" --- "Are you sure you want to continue connectiong (yes/no)?: yes Enter --- "root@kvm01.example.com's password: P@ssw0rd Enter
  • 파일(F) --- 새 가상 머신 (N)
  • "새 가상 머신" --- 연결(O): QEMU/KVM: kvm01.example.com --- [앞으로(F)]
  • (O) ISO 이미지 사용: [검색(W)...] --- CentOS-7-...iso 선택 --- [볼륨 선택]
  • OS 종류(T): Linux --- 버전(V): CentOS 7.0 --- [앞으로(F)]
  • "CPU와 메모리 설정 선택"[28] --- [앞으로(F)]
  • "5 중 4 단계" --- [앞으로(F)]
  • "5 중 5 단계" --- 이름(N): vm01 --- [완료(F)]
  • "OpenSSH" --- P@ssw0rd Enter

19 같이 보기[ | ]

20 주석[ | ]

  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)
  28. 메모리(RAM)(M): 1024 MiB --- CPU들 1
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}