国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > CentOS > 正文

CentOS 6.5下安裝KVM

2024-06-28 16:03:07
字體:
來源:轉載
供稿:網友
一、檢查CPU是否支持虛擬化。(在主板BIOS中開啟CPU的VirtualizationTechnology)# grep -E -o 'vmx|svm' /PRoc/cpuinfovmx二、基礎環境配置1.安裝KVM軟件包# yum -y groupinstall 'Virtualization' 'Virtualization Client' 'Virtualization Platform' 'Virtualization Tools'查看模塊# lsmod | grep kvmkvm_intel              53484  6kvm                   316506  1 kvm_intel2.網卡橋接配置2.1 如果啟用了NetworkManager,最好關閉該服務,因為該服務與network有沖突。chkconfig NetworkManager offservice NetworkManager stop2.2 關閉 selinux 并重啟系統# vi /etc/sysconfig/selinuxSELINUX=disabled2.3 編輯網卡# vi /etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=eth0TYPE=EthernetONBOOT=yesBOOTPROTO=noneBRIDGE=br0# vi /etc/sysconfig/network-scripts/ifcfg-br0DEVICE=br0TYPE=BridgeONBOOT=yesBOOTPROTO=noneIPADDR=192.168.200.15NETMASK=255.255.255.0GATEWAY=192.168.200.1DNS1=202.106.0.202.4 重啟服務器reboot2.5 查看網絡# brctl showbridge name bridge idSTP enabledinterfacesbr0 8000.ac4e914d0aa2noeth0virbr0 8000.5254004d5befyesvirbr0-nic2.6 檢查ip轉發是否開啟# cat /etc/sysctl.conf |grep ip_forwardnet.ipv4.ip_forward = 0 3.創建虛擬機3.1 創建磁盤鏡像文件,文件格式qcow2格式是kvm支持的標準格式,raw格式為虛擬磁盤文件通用格式。創建文件名win2008r2.qcow2的磁盤鏡像文件名,文件格式為qcow2,磁盤大小為100G# qemu-img create -f qcow2 /kvm/pjgl/win2008r2.qcow2 100G查看磁盤鏡像文件信息 # qemu-img info /kvm/pjgl/win2008r2.qcow23.2 創建虛擬機配置文件<!--WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:  virsh edit win2008r2or other application using the libvirt API.--><domain type='kvm'>  <name>win2008r2</name>  <uuid>7b6f172b-7a03-c629-f6cb-4127bdbdfb51</uuid>  <memory unit='KiB'>2097152</memory>  <currentMemory unit='KiB'>2097152</currentMemory>  <vcpu placement='static'>2</vcpu>  <os>    <type arch='x86_64' machine='rhel6.6.0'>hvm</type>    <boot dev='cdrom'/>    <boot dev='hd'/>  </os>  <features>    <acpi/>    <apic/>    <pae/>  </features>  <clock offset='localtime'>    <timer name='rtc' tickpolicy='catchup'/>  </clock>  <on_poweroff>destroy</on_poweroff>  <on_reboot>restart</on_reboot>  <on_crash>restart</on_crash>  <devices>    <emulator>/usr/libexec/qemu-kvm</emulator>    <disk type='file' device='disk'>      <driver name='qemu' type='qcow2' cache='writeback'/>      <source file='/kvm/win2008r2/win2008r2.qcow2'/>      <target dev='hda' bus='ide'/>      <address type='drive' controller='0' bus='0' target='0' unit='0'/>    </disk>    <disk type='file' device='cdrom'>      <driver name='qemu' type='raw'/>      <source file='/iso/Windows_2008R2_64-bit.ISO'/>      <target dev='hdc' bus='ide'/>      <readonly/>      <address type='drive' controller='0' bus='1' target='0' unit='0'/>    </disk>    <controller type='usb' index='0' model='ich9-ehci1'>      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x7'/>    </controller>    <controller type='usb' index='0' model='ich9-uhci1'>      <master startport='0'/>      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0' multifunction='on'/>    </controller>    <controller type='usb' index='0' model='ich9-uhci2'>      <master startport='2'/>      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x1'/>    </controller>    <controller type='usb' index='0' model='ich9-uhci3'>      <master startport='4'/>      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x2'/>    </controller>    <controller type='ide' index='0'>      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>    </controller>    <interface type='bridge'>      <mac address='52:54:00:b3:c6:d3'/>      <source bridge='br0'/>      <model type='e1000'/>      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>    </interface>    <serial type='pty'>      <target port='0'/>    </serial>    <console type='pty'>      <target type='serial' port='0'/>    </console>    <input type='tablet' bus='usb'/>    <input type='mouse' bus='ps2'/>    <graphics type='vnc' port='5903' autoport='no' listen='0.0.0.0'>      <listen type='address' address='0.0.0.0'/>    </graphics>    <video>      <model type='vga' vram='9216' heads='1'/>      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>    </video>    <memballoon model='virtio'>      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>    </memballoon>  </devices></domain>將上面的內容復制到win2008r2.xml文件后,根據情況修改系統名稱、UUID、MAC地址、光盤鏡像的路徑、磁盤鏡像的路徑等。3.3 啟動虛擬機# virsh# define /kvm/pjgl/win2008r2.xml# list --all# start win2008r23.4 配置防火墻策略防火墻缺省是不允許連接這些端口的,使用下列步驟配置防火墻,允許VNC客戶端連接VNC server。# vi /etc/sysconfig/iptables  1) 找到下面的語句:-A INPUT -j REJECT --reject-with icmp-host-prohibited在此行之前,加上下面的內容:-A INPUT -m state --state NEW -m tcp -p tcp --dport 5900:5920 -j ACCEPT   #允許其它機器訪問本機的5900到5903端口2) 然后使用root身份重新啟動防火墻:# service iptables restart3) 設置開機自動啟動# chkconfig iptables on3.5 使用TightVNC Viewer客戶端,進入系統UI界面安裝操作系統,并進行配置即可。 
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 临安市| 南靖县| 伽师县| 昆山市| 石渠县| 栾川县| 宜兰县| 上高县| 隆昌县| 石柱| 建昌县| 敦煌市| 辽源市| 德钦县| 株洲县| 邛崃市| 务川| 澳门| 吉木萨尔县| 买车| 秭归县| 旬阳县| 景泰县| 溧阳市| 诸暨市| 北流市| 鹤峰县| 平果县| 敖汉旗| 鲁甸县| 新安县| 改则县| 邵东县| 湾仔区| 宣武区| 溧水县| 长沙市| 东乌珠穆沁旗| 青冈县| 哈尔滨市| 呼玛县|