본문 바로가기

Linux

KVM(가상화) install on rocky8.x

320x100

KVM 가상화 시스템을 rocky 8.x 에 설치 하는 방법이다.

우선 intel은 vmx AMD는 svm 이 활성화 되있어야 한다. cmos 에서 설정을 확인 해야 한다.

난 AMD 환경이라

# grep -e 'svm' /proc/cpuinfo #AMD systems
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba perfmon_v2 ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local avx512_bf16 clzero irperf xsaveerptr wbnoinvd cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid overflow_recov succor smca fsrm flush_l1d

명령어로 활성화 여부 확인이 가능하다.

# dnf install cockpit cockpit-machines
Last metadata expiration check: 2:41:36 ago on Mon 12 Jun 2023 05:58:52 PM KST.
Package cockpit-286.1-1.el8.x86_64 is already installed.
Dependencies resolved.
==============================================================================================================================
 Package                      Architecture       Version                                          Repository             Size
==============================================================================================================================
Installing:
 cockpit-machines             noarch             286.1-1.el8                                      appstream             1.0 M
Installing dependencies:
 libvirt-dbus                 x86_64             1.3.0-2.module+el8.8.0+1279+230c2115             appstream              89 k

Transaction Summary
==============================================================================================================================
Install  2 Packages

Total download size: 1.1 M
Installed size: 1.3 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): libvirt-dbus-1.3.0-2.module+el8.8.0+1279+230c2115.x86_64.rpm                           715 kB/s |  89 kB     00:00
(2/2): cockpit-machines-286.1-1.el8.noarch.rpm                                                3.5 MB/s | 1.0 MB     00:00
------------------------------------------------------------------------------------------------------------------------------
Total                                                                                         1.3 MB/s | 1.1 MB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                      1/1
  Running scriptlet: libvirt-dbus-1.3.0-2.module+el8.8.0+1279+230c2115.x86_64                                             1/2
  Installing       : libvirt-dbus-1.3.0-2.module+el8.8.0+1279+230c2115.x86_64                                             1/2
  Installing       : cockpit-machines-286.1-1.el8.noarch                                                                  2/2
  Running scriptlet: cockpit-machines-286.1-1.el8.noarch                                                                  2/2
  Verifying        : cockpit-machines-286.1-1.el8.noarch                                                                  1/2
  Verifying        : libvirt-dbus-1.3.0-2.module+el8.8.0+1279+230c2115.x86_64                                             2/2

Installed:
  cockpit-machines-286.1-1.el8.noarch                 libvirt-dbus-1.3.0-2.module+el8.8.0+1279+230c2115.x86_64

Complete!

패키지 설치 해주고

# systemctl start cockpit.socket

서비스 시작

# systemctl enable cockpit.socket

자동 실행 설정

# systemctl disable firewalld

방화벽 우선 끄고..

http://localhost:9090 접속

ID, Pass 리눅스 계정 입력하면 로그인이 된다.

로그인 화면이 뜬다. 이제 가상화를 구동을 하자. 왼쪽 옵션에 가상 머신 누르자.

가상 머신 만들기를 누르자 VM 이 있다면 불러오기 하면 된다.

iso 파일을 원하는 곳에 넣고 위와 같이 대충 만들어서 생성과 실행 눌러주면

이러면 test1 가상화 장비가 구동이 된다. test1 누르면

콘솔 화면이 뜨고 설치를 할수 있다.

네트워크나 디스크를 추가 할수 있다. 기존 가상화처럼 사용하면 된다.

네트워크를 Direct attachement 로 설정하고 원천(?) 을 KVM 올린 장비에 네트워크인 enp6s0 로 하면같은 대역의 IP로 설정 할 수 있다.

이제 사용하면 된다.

320x100