CentOS 6.7 使用libvirt工具安装 CentOS7.2
2016-12-03 15:09
447 查看
安装依赖
yum -y install @virt* dejavu-lgc-* xorg-x11-xauth tigervnc \ libguestfs-tools policycoreutils-python bridge-utils chkconfig libvirtd on
调整参数
chkconfig network on service network restart yum -y erase NetworkManager cp -p /etc/sysconfig/network-scripts/ifcfg-{eth0,br0} sed -i -e'/HWADDR/d' -e'/UUID/d' -e's/eth0/br0/' -e's/Ethernet/Bridge/' \ /etc/sysconfig/network-scripts/ifcfg-br0 echo DELAY=0 >> /etc/sysconfig/network-scripts/ifcfg-br0 echo 'BOOTPROTO="none"' >> /etc/sysconfig/network-scripts/ifcfg-eth0 echo BRIDGE=br0 >> /etc/sysconfig/network-scripts/ifcfg-eth0 service network restart brctl show
创建storage pool,别忘了激活
virsh pool-define-as mystorage --type dir --target /data3 virsh pool-autostart rhpol_virsh # Start on boot virsh pool-start rhpol_virsh # Start now
创建虚拟机磁盘并启动
qemu-img create -f qcow2 t21.img 100G virsh undefine t21 virt-install --name=t21 \ --os-variant=RHEL6 \ --ram 4096 \ --vcpus=2 \ --disk path=/data3/t21.img,size=100,format=qcow2,bus=virtio \ --accelerate --cdrom /data/soft/soft/ISO/CentOS-7-x86_64-DVD-1511.iso \ --vnc --vncport=5910 --vnclisten=0.0.0.0 \ --network bridge=br0,model=virtio --noautoconsole \ ,format=qcow2,bus=virtio
创建好的文件如下。 在上面的基础上又进行了一点点修改,添加了启动顺序,内存也调整成了2GB,发现4GB在我这里不可以。
<!-- 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 t21 or other application using the libvirt API. --> <domain type='qemu'> <name>t21</name> <uuid>2eeadfe7-59e3-1a31-969d-ca8c2e14ce9f</uuid> <memory unit='KiB'>2194304</memory> <currentMemory unit='KiB'>2194304</currentMemory> <vcpu placement='static'>2</vcpu> <os> <type arch='x86_64' machine='rhel6.6.0'>hvm</type> <boot dev='cdrom'/> <boot dev='hd'/> <bootmenu enable='yes'/> </os> <features> <acpi/> <apic/> <pae/> </features> <clock offset='utc'/> <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='none'/> <source file='/data3/t21.img'/> <target dev='vda' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </disk> <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/data/soft/soft/ISO/CentOS-7-x86_64-DVD-1511.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:45:4e:04'/> <source bridge='br0'/> <model type='virtio'/> <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='5910' autoport='no' listen='0.0.0.0'> <listen type='address' address='0.0.0.0'/> </graphics> <video> <model type='cirrus' 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='0x06' function='0x0'/> </memballoon> </devices> </domain>
相关文章推荐
- centos7.2+python2.7 gdal安装教程(校园网开启防火墙,无法使用yum,pip等工具)
- 自动化运维工具Fabric安装配置使用(CentOS6.3)
- CentOS压力测试工具Tsung安装、使用和图形报表生成
- 在CentOS7上安装使用Ansibel(自动化工具)Install and use Ansible (Automation Tool) in CentOS 7
- CENTOS 7.2 使用 RDO 安装 OPENSTACK
- centos6.7环境之kvm虚拟化quem工具配置及使用详解
- centos/linux下网卡流量监测工具 iftop 安装及使用教程
- centos DNS服务搭建 DNS原理 使用bind搭建DNS服务器 配置DNS转发 配置主从 安装dig工具 DHCP dhclient 各种域名解析记录 mydns 第三十节课
- centos6.7环境半虚拟化软件xen及xm配置工具使用详解
- centos 6.7 perl 5.22 安装DBD 需要使用老的perl版本
- 使用Kickstart文件安装CentOS 7.2的一种方法
- Centos7虚拟机上安装使用siege性能测试工具
- CentOS中Python pip包管理工具的安装和使用
- centos6.7环境半虚拟化软件xen及xm配置工具使用详解
- CentOS下安装使用流量监控工具-iftop
- centos/linux下网卡流量监测工具 iftop 安装及使用教程
- 在 CentOS 7 中安装并使用自动化工具 Ansible
- 在 CentOS 7 中安装并使用自动化工具 Ansible
- Centos6.7_KVM安装配置使用
- centos6.7环境之kvm虚拟化quem工具配置及使用详解