标签:
systemctl disable firewalld
systemctl stop firewalld
setenforce 0
hostnamectl set-hostname libvirt-Manage
rpm -qa|grep kvm
yum groupinstall Virtual*
yum install virt-manager libvirt libvirt-python python-virtinst
systemctl status libvirtd
mkdir /home/vm/centos
qemu-img create -f qcow2 /home/vm/centos/centos.qcow2 10G
vi lib.xml
|
<domain type=‘kvm‘>
<name>CentOS</name> //虚拟机名称
<memory>1048576</memory> //最大内存,单位k
<currentMemory>1048576</currentMemory> //可用内存,单位k
<vcpu>1</vcpu> //虚拟cpu个数
<os>
<type>hvm</type>
<boot dev=‘cdrom‘/> //光盘启动
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset=‘localtime‘/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type=‘file‘ device=‘disk‘>
<driver name=‘qemu‘ type=‘qcow2‘/>
<source file=‘/home/vm/centos/centos.qcow2‘/> //目的镜像路径
<target dev=‘hda‘ bus=‘ide‘/>
</disk>
<disk type=‘file‘ device=‘cdrom‘>
<source file=‘/home/CentOS-7-x86_64-Minimal-1511.iso‘/> //提前放好
<target dev=‘hdb‘ bus=‘ide‘/>
</disk>
<interface type=‘bridge‘> //虚拟机网络连接方式
<source bridge=‘virbr0‘/> //当前主机网桥的名称
<mac address="00:16:3e:5d:aa:a8"/>
</interface>
<input type=‘mouse‘ bus=‘ps2‘/>
<graphics type=‘vnc‘ port=‘-1‘ autoport=‘yes‘ listen = ‘0.0.0.0‘ keymap=‘en-us‘/>
</devices>
</domain>
|
virsh start CentOS
virsh vncdisplay CentOS
|
Options… > Advanced… > Expert
Change
– FullColour to True
– PreferredEncoding to Hextile
标签:
原文地址:http://www.cnblogs.com/xieheng1216/p/5495438.html