Microsoft MVP성태의 닷넷 이야기
개발 환경 구성: 129. Hyper-V에 CentOS 설치하기 [링크 복사], [링크+제목 복사],
조회: 34161
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 
(연관된 글이 1개 있습니다.)
(시리즈 글이 4개 있습니다.)
개발 환경 구성: 17. VPC에 Linux 설치하는 방법
; https://www.sysnet.pe.kr/2/0/352

개발 환경 구성: 41. Hyper-V에 Linux 설치 - SUSE Linux Enterprise Server 11
; https://www.sysnet.pe.kr/2/0/707

개발 환경 구성: 129. Hyper-V에 CentOS 설치하기
; https://www.sysnet.pe.kr/2/0/1113

개발 환경 구성: 716. Hyper-V - Ubuntu 22.04 Generation 2 유형의 VM 설치
; https://www.sysnet.pe.kr/2/0/13668




Hyper-V에 CentOS 설치하기

이번에는 또 어떤 리눅스를 설치해볼까요? ^^

VPC에 Linux 설치하는 방법
; https://www.sysnet.pe.kr/2/0/352

Hyper-V에 Linux 설치 - SUSE Linux Enterprise Server 11
; https://www.sysnet.pe.kr/2/0/707

수학 정석은 집합만 푼다고 하더니 ^^; 이러다 설치만 하다 끝날지도 모르겠군요. 그래도 이번에는 조금 더 큰맘 먹고 Linux에 다가서기로 했습니다. 뭐랄까, Linux를 좀 더 이해하기로 작정했기 때문입니다. ^^

하는 김에 2개의 리눅스를 설치해 보았습니다. 회사에 놀고 있는 노트북에는 우분투를 설치하고 Hyper-V의 가상 머신에는 CentOS를 설치했습니다. 기왕이면 "Redhat Enterprise" 버전을 설치하려 했는데 유료라서 못하고 Fedora는 Hyper-V의 "Integration Services"가 지원하지 않아서 제외해야만 했는데요. 할 수 없이, 남은 것 중에서 조금 생소한 CentOS를 선택했습니다.

CentOS
; http://www.centos.org/download
; http://wiki.centos.org/Download

CentOS Stream
; https://www.centos.org/centos-stream/

위의 사이트에 가서, CentOS-6으로 32비트 버전인 i386을 선택했습니다. (VM 메모리 할당을 1GB로 했기 때문에 굳이 64비트 일 필요가 없겠다 싶었습니다.)

그럼, Mirroring 사이트가 쭉 뜨는데 제 경우에는 다음의 경로에 방문해서,

The Community Enterprise Operating System 
; http://data.nicehosting.co.kr/os/CentOS/6.0/isos/i386/

CentOS-Stream-9-latest-x86_64-dvd1.iso
; https://mirrors.centos.org/mirrorlist?path=/9-stream/BaseOS/x86_64/iso/CentOS-Stream-9-latest-x86_64-dvd1.iso&redirect=1&protocol=https

그중에서 CentOS-6.0-i386-bin-DVD.iso를 다운로드 받았습니다. 이어서 Hyper-V 가상 머신을 하나 생성했는데 다음과 같은 환경으로 구성했습니다.

centos_on_hyper-v_1.png

참고로, Network 어댑터에 "Legacy Network Adapter"와 "Network Adapter"를 선택해 두었는데요. (Legacy의 경우에는 Hyper-V의 "Integration Services"가 지원하지 않는 Linux를 설치하는 경우에 쓸 수 있는 유형이고, 일반적인 "Network Adapter"는 "Integration Services"가 정상적으로 설치된 이후에만 인식이 되는 차이가 있습니다.) 저처럼, 리눅스 운영체제에 익숙하지 않은 분은 위와 같이 2개를 선택해 주시면 IS가 설치되기 이전에도 웹 브라우저를 사용할 수 있으므로 편리합니다.

이제 VM을 시작시키고, 아래와 같이 첫 번째 옵션이 제공되면 "Install or upgrade an existing system" 메뉴를 선택합니다.

centos_on_hyper-v_2.png

이후, 다음과 같은 변경 사항만 반영했습니다.

설치시 사용언어: English (주의: 한글로 설정하니, Hyper-V 콘솔 화면에서는 키 인식이 안되는 현상이 발생)
시스템에 사용할 키보드: Korean
Storage: Basic Storage Devices - Re-initialize all 
Hostname: ...[원하는 이름]...
Time Zone: Seoul, Asia
        System clock uses UTC - 설정
설치 유형: Use All Space

Install Target Devices에 한 개
Data Storage Devices에 한 개 할당             

설치 유형: Web Server
        Customize now 선택

        Base System - Networking Tools
                      iSCSI Storage Client
        Servers     - Directory Server
                        E-mail server
                        FTP server
                        System administration tools
        Desktops    - Legacy X Windows System compatibility 제외하고 모두 선택

        Applications - Internet Applications, Internet Browser

        Development - 전체 선택

        Language - Korean Support

설치 완료 후 재부팅 하면 약간의 설정이 추가되는데, 1GB 메모리를 VM에 할당한 것이 부족했는지, "Insufficient memory to configure kdump!" 메시지가 나오긴 했지만 테스트 용도의 VM이므로 큰 장애는 아니라고 판단해서 계속했습니다. 재부팅하고 나면 설치가 완료되는데 아래는 첫 화면입니다.

centos_on_hyper-v_3.png

아쉬운 것은, (RDP로 접속한 상태에서) 위와 같이 Hyper-V 콘솔 화면으로는 마우스 입력도 안되고, 단축키를 이용한 키보드로 동작을 해야만 해서 무척 불편한 상태입니다.

그래도 ^^ 제가 리눅스 설치를 전에도 해보았기 때문에 그나마 약간의 기억이 나더군요. ^^ Ctrl + Alt + F2을 눌러서 다음과 같이 명령어 쉘로 빠져나갔습니다.

centos_on_hyper-v_4.png

(처량하군요. 아는 명령어가 ls뿐이 없습니다.)




다행히 "Linux Integration Services"가 3.1 버전부터는 CentOS를 지원하기 때문에 IS(Integration Services)를 설치해줄 수 있는데요.

Linux Integration Services 3.1 for Hyper-V
; http://blogs.msdn.com/b/virtual_pc_guy/archive/2011/08/04/linux-integration-services-3-1-for-hyper-v.aspx
; https://www.microsoft.com/en-us/download/details.aspx?id=55106

IS를 설치했다고 해서 Guest OS가 윈도우인 경우처럼 마우스 입력까지 매끄럽게 지원되는 것은 아닙니다. 지원되는 서비스에 대한 공식적인 문서는 다음의 경로를 참조하시고,

About Virtual Machines and Guest Operating Systems
; https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc794868(v=ws.10)

CentOS의 경우에는 아래의 서비스들이 제공됩니다.

Drivers: IDE, SCSI, and networking
Services: Time synchronization, operating system shutdown, and heartbeat

그래도 저 정도만 해도 어디입니까! ^^ 이제 설치를 해보도록 할 텐데요. 우선 아래의 경로에서 "Hyper-V Integration Services"를 다운로드합니다.

Linux Integration Services Version 3.1 for Hyper-V
; http://www.microsoft.com/download/en/details.aspx?id=26837

Linux Integration Services Version 3.4 for Hyper-V
; https://www.microsoft.com/en-us/download/details.aspx?id=55106

저처럼, 리눅스 초보자라면 위의 경로에서 "Linux IC v3.0.iso" 파일과 함께 "Linux Integration Services v3 Read Me.pdf" 파일을 다운로드하시는 것이 좋습니다. 왜냐하면 IS를 설치하는 방법이 윈도우에서처럼 설치 파일 하나 실행하는 정도로 끝나는 것이 아니기 때문에 윈도우만 사용해본 경우라면 문서 없이는 할 수 없을 것입니다.

참고로, PDF 문서에는 "Red Hat Enterprise Linux 6" 기준으로 설명되어 있는데, CentOS도 동일하게 진행할 수 있습니다.

일단, Hyper-V 관리자에서 CentOS VM에 대해 "Linux IC v3.0.iso" 파일을 "DVD Drive"로 연결하고 CentOS의 터미널 콘솔에서 아래의 명령어들을 차례대로 실행합니다.

(* 이후의 작업을 하려면 root 권한으로 로그인해야 합니다.)

[root@localhost ~]# mount /dev/cdrom /media
mount: block device /dev/sr0 is write-protected, mounting read-only

[root@localhost ~]# rpm -ivh /media/x86/kmod-microsoft-hyper-v-rhel6-60.1.i686.rpm
warning: /media/x86/kmod-microsoft-hyper-v-rhel6-60.1.i686.rpm: Header V3 DSA/SHA1 Signature, key ID af81e0c6: NOKEY
Preparing...                ########################################### [100%]
   1:kmod-microsoft-hyper-v ########################################### [100%]

[root@localhost ~]# rpm -ivh /media/x86/microsoft-hyper-v-rhel6-60.1.i686.rpm
warning: /media/x86/microsoft-hyper-v-rhel6-60.1.i686.rpm: Header V3 DSA/SHA1 Signature, key ID af81e0c6: NOKEY
Preparing...                ########################################### [100%]
   1:microsoft-hyper-v      ########################################### [100%]
Saving old initramfs
Installing new initramfs
Linux Integration Services for Hyper-V has been installed. Please reboot your system.

재부팅 후,

[root@localhost ~]# reboot

설치가 정상적으로 되어 있는지 (root 권한이 아니어도 됨) 터미널 창에서 다음과 같이 확인할 수 있습니다.

# /sbin/lsmod | grep hv
hv_netvsc 19138 0
hv_utils 3943 0
hv_timesource 691 0 [permanent]
hv_storvsc 8650 0
hv_blkvsc 10106 3
hv_vmbus 26964 5 hv_netvsc,hv_utils,hv_timesource,hv_storvsc,hv_blkvsc,[permanent]

# /sbin/modinfo hv_vmbus
filename: /lib/modules/2.6.32-71.el6.i686/extra/microsoft-hyper-v/hv_vmbus.ko
version: 3.1
license: GPL
srcversion: 56F00728DAE99444BE1FD9B
alias: acpi*:VMBus:*
alias: acpi*:VMBUS:*
alias: pci:v00001414d00005353sv*sd*bc*sc*i*
depends:
vermagic: 2.6.32-71.el6.i686 SMP mod_unload modversions 686
parm: vmbus_loglevel:int

# /sbin/modinfo hv_netvsc
filename: /lib/modules/2.6.32-71.el6.i686/extra/microsoft-hyper-v/hv_netvsc.ko
description: Microsoft Hyper-V network driver
version: 3.1
license: GPL
srcversion: 1092C7A7219A53035F442BB
alias: dmi*:svn*MicrosoftCorporation*:pn*VirtualMachine:rn*VirtualMachine*:
depends: hv_vmbus
vermagic: 2.6.32-71.el6.i686 SMP mod_unload modversions 686
parm: ring_size:Ring buffer size (# of pages) (int)

# /sbin/modinfo hv_storvsc
filename: /lib/modules/2.6.32-71.el6.i686/extra/microsoft-hyper-v/hv_storvsc.ko
description: Microsoft Hyper-V virtual storage driver
version: 3.1
license: GPL
srcversion: B9B6B04500ED2B9E96A3337
alias: dmi*:svn*MicrosoftCorporation*:pn*VirtualMachine:rn*VirtualMachine*:
depends: hv_vmbus
vermagic: 2.6.32-71.el6.i686 SMP mod_unload modversions 686
parm: storvsc_ringbuffer_size:Ring buffer size (bytes) (int)

# /sbin/modinfo hv_blkvsc
filename: /lib/modules/2.6.32-71.el6.i686/extra/microsoft-hyper-v/hv_blkvsc.ko
description: Microsoft Hyper-V virtual block driver
version: 3.1
license: GPL
srcversion: 36CD2AD96D7DC1C494F8274
depends: hv_vmbus
vermagic: 2.6.32-71.el6.i686 SMP mod_unload modversions 686
param: blkvsc_ringbuffer_size:int
parm: ring_size:Ring buffer size (in bytes)

# /sbin/modinfo hv_utils
filename: /lib/modules/2.6.32-71.el6.i686/extra/microsoft-hyper-v/hv_utils.ko
license: GPL
version: 3.1
description: Hyper-V Utilities
srcversion: 09F2DEF23F34650574810F7
alias: pci:v00001414d00005353sv*sd*bc*sc*i*
alias: dmi*:svn*MicrosoftCorporation*:pn*VirtualMachine:rn*VirtualMachine*:
depends: hv_vmbus
vermagic: 2.6.32-71.el6.i686 SMP mod_unload modversions 686

자, 그럼 가장 중요한 네트워크 어댑터가 정상적으로 잡혀 있는지도 확인해 볼까요? ^^

# /sbin/ifconfig
eth0    Link encap:Ethernet HWaddr 00:15:5D:00:C2:3E
        inet6 addr: fe80::215:5dff:fe00:c23e/64 Scope:Link
        UP BROADCAST RUNNING MULTICAST  MTU:1500    Metric:1
        RX  packets:12  errors:0    dropped:0   overruns:0  frame:0
        TX  packets:6   errors:0    dropped:0   overruns:0  carrier:0
        collisions:0    txqueuelen:1000
        RX bytes:4104 (4.0 KiB) TX bytes:468 (468.0 b)
        Interrupt:9

eth1    Link encap:Ethernet HWaddr 00:15:5D:00:C2:3D
        inet addr:192.168.0.30 Bcast:192.168.90.255    Mask:255.255.255.0
        inet6 addr: fe80::215:5dff:fe00:c23d/64 Scope:Link
        UP BROADCAST RUNNING MULTICAST  MTU:1500    Metric:1
        RX  packets:5899  errors:0    dropped:0   overruns:0  frame:0
        TX  packets:3494  errors:0    dropped:0   overruns:0  carrier:0
        collisions:0    txqueuelen:1000
        RX bytes:8052017 (7.6 MiB) TX bytes:271265 (264.9 KiB)
        
lo      Link encap:Local Loopback
        inet addr:127.0.0.1     Mask:255.0.0.0
        inet6 addr: ::1/128 Scope:Host
        UP LOOPBACK RUNNING MTU:16436    Metric:1
        RX  packets:8   errors:0    dropped:0   overruns:0  frame:0
        TX  packets:8   errors:0    dropped:0   overruns:0  carrier:0
        collisions:0    txqueuelen:0
        RX bytes:480 (480.0 b) TX bytes:480 (480.0 b)
        Interrupt:9

보아하니, eth0은 "Legacy Network Adapter"이고, eth1이 "Integration Services" 설치로 인식된 "Network Adapter"로 보입니다.

마지막으로, 불편한 GUI 쉘에서 최소한의 작업이라도 할 수 있도록 몇 가지 단축키를 익혀야 할 필요가 있는데요. (FreeNX라도 설치가 된다면 좋을 텐데... ^^;)

아래는 제가 임의로 키 조합을 통해 발견한 것들인데, 이 중에서 가장 많이 쓰이는 것이 "Alt+F1"이더군요. ^^

Alt+F1: 상단의 풀다운 메뉴 (윈도우와 비교하면, Control + ESC 키조합)
Alt+F2: Run Application 대화창 (윈도우와 비교하면, Window + R 키조합)
Alt+F4: 실행 중인 프로그램 종료
Alt+F12: 상단의 풀다운 메뉴에 있는 노트 아이콘의 메뉴 펼침
Alt+Tab: 프로세스 전환
Shift+F2: Rename
Control + I: Properties
Control + O: Open
Control + F: Search
Ctrl + F10: 메뉴 - Open in Termianl 메뉴 포함 (윈도우와 비교하면, 마우스 우측 버튼 메뉴)

그 외에 KVP 서비스에 대해서는 나중에 심심하면 테스트 해봐야 겠습니다. ^^

Sending data from parent to virtual machine via KVP
; http://blogs.msdn.com/b/virtual_pc_guy/archive/2008/12/02/sending-data-from-parent-to-virtual-machine-via-kvp.aspx
; http://poleexpertise.canalblog.com/archives/2008/12/03/11617815.html




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]

[연관 글]






[최초 등록일: ]
[최종 수정일: 1/23/2023]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




1  [2]  3  4  5  6  7  8  9  10  11  12  13  14  15  ...
NoWriterDateCnt.TitleFile(s)
13893정성태2/27/20252225Linux: 115. eBPF (bpf2go) - ARRAY / HASH map 기본 사용법
13892정성태2/24/20252983닷넷: 2325. C# - PowerShell과 연동하는 방법파일 다운로드1
13891정성태2/23/20252500닷넷: 2324. C# - 프로세스의 성능 카운터용 인스턴스 이름을 구하는 방법파일 다운로드1
13890정성태2/21/20252329닷넷: 2323. C# - 프로세스 메모리 중 Private Working Set 크기를 구하는 방법(Win32 API)파일 다운로드1
13889정성태2/20/20253054닷넷: 2322. C# - 프로세스 메모리 중 Private Working Set 크기를 구하는 방법(성능 카운터, WMI) [1]파일 다운로드1
13888정성태2/17/20252498닷넷: 2321. Blazor에서 발생할 수 있는 async void 메서드의 부작용
13887정성태2/17/20253074닷넷: 2320. Blazor의 razor 페이지에서 code-behind 파일로 코드를 분리 및 DI 사용법
13886정성태2/15/20252574VS.NET IDE: 196. Visual Studio - Code-behind처럼 cs 파일을 그룹핑하는 방법
13885정성태2/14/20253236닷넷: 2319. ASP.NET Core Web API / Razor 페이지에서 발생할 수 있는 async void 메서드의 부작용
13884정성태2/13/20253522닷넷: 2318. C# - (async Task가 아닌) async void 사용 시의 부작용파일 다운로드1
13883정성태2/12/20253266닷넷: 2317. C# - Memory Mapped I/O를 이용한 PCI Configuration Space 정보 열람파일 다운로드1
13882정성태2/10/20252581스크립트: 70. 파이썬 - oracledb 패키지 연동 시 Thin / Thick 모드
13881정성태2/7/20252832닷넷: 2316. C# - Port I/O를 이용한 PCI Configuration Space 정보 열람파일 다운로드1
13880정성태2/5/20253172오류 유형: 947. sshd - Failed to start OpenSSH server daemon.
13879정성태2/5/20253407오류 유형: 946. Ubuntu - N: Updating from such a repository can't be done securely, and is therefore disabled by default.
13878정성태2/3/20253198오류 유형: 945. Windows - 최대 절전 모드 시 DRIVER_POWER_STATE_FAILURE 발생 (pacer.sys)
13877정성태1/25/20253249닷넷: 2315. C# - PCI 장치 열거 (레지스트리, SetupAPI)파일 다운로드1
13876정성태1/25/20253708닷넷: 2314. C# - ProcessStartInfo 타입의 Arguments와 ArgumentList파일 다운로드1
13875정성태1/24/20253137스크립트: 69. 파이썬 - multiprocessing 패키지의 spawn 모드로 동작하는 uvicorn의 workers
13874정성태1/24/20253558스크립트: 68. 파이썬 - multiprocessing Pool의 기본 프로세스 시작 모드(spawn, fork)
13873정성태1/23/20252983디버깅 기술: 217. WinDbg - PCI 장치 열거파일 다운로드1
13872정성태1/23/20252885오류 유형: 944. WinDbg - 원격 커널 디버깅이 연결은 되지만 Break (Ctrl + Break) 키를 눌러도 멈추지 않는 현상
13871정성태1/22/20253292Windows: 278. Windows - 윈도우를 다른 모니터 화면으로 이동시키는 단축키 (Window + Shift + 화살표)
13870정성태1/18/20253731개발 환경 구성: 741. WinDbg - 네트워크 커널 디버깅이 가능한 NIC 카드 지원 확대
13869정성태1/18/20253456개발 환경 구성: 740. WinDbg - _NT_SYMBOL_PATH 환경 변수에 설정한 경로로 심벌 파일을 다운로드하지 않는 경우
13868정성태1/17/20253112Windows: 277. Hyper-V - Windows 11 VM의 Enhanced Session 모드로 로그인을 할 수 없는 문제
1  [2]  3  4  5  6  7  8  9  10  11  12  13  14  15  ...