#yum-y install QEMU-KVM libvirt virt-install bridge-utils#lsmod | grep KVM # Make sure modules is Loaded#systemctl start Libvirtd#systemctl enable LIBVIRTD
Forget, Http://libvirt.org/formatdomain.html#elementsNICS here mentioned can direct mode, this is not quite cool, O (∩_∩) o haha ~
Kvm-linux official win7 Installation tutorial Http://www.linux-kvm.org/page/Windows7Install inside mentioned the direct installation need a hours scare, hurriedly download Virtio driver, Side dishes first abide by the QEMU-KVM, SELinux rules, put these ISO into the/var/lib/libvirt/images/directory , must be placed here!!
To see the Win7 installation process in VNC view, add the VNC port to the firewall:
Firewall-cmd--permanent--zone=public--add-port=5910/tcpfirewall-cmd-reload configured to reload
Then create a file to act as the virtual machine's hard disk:
#qemu-img create-f qcow2/d/virtual-machine/win7.img 40G virt-install--connect qemu:///system--name=win7--os-variant =win7--ram=1024--vcpus=2--disk path=/d/virtual-machine/win7.img,format=qcow2,size=40,bus=virtio--accelerate-- VNC--vncport=5910--vnclisten=0.0.0.0--network bridge=br0,model=virtio--noautoconsole--cdrom=/dev/sr0
This installation has been failed, error: Could not open disk Image/dev/sr0:driver ' Host_cdrom ' are not whitelisted do not care, Redhat said there is a problem, it has taken the driver, anyway Swaiiow toss too good Long time did not take care of, later to pay attention to.
Virt-install--connect qemu:///system--name=win7--os-variant=win7--ram=1024--vcpus=2--disk path=/d/ Virtual-machine/win7.img,format=qcow2,size=40,bus=virtio--accelerate--vnc--vncport=5910--vnclisten=0.0.0.0-- Network Bridge=br0,model=virtio--noautoconsole--cdrom=/var/lib/libvirt/images/micrsoft-win7.iso
This will be OK,
#virsh start win7 virtual machine up, in other places with VNC view connected up, installed system bar, O (∩_∩) o haha ~
But to choose the installation disk here is empty, lying trough, the above is clearly allocated 40G hard disk to it, is it too little? Originally is afraid installs the hours so specifies virtio driver, must install this driver first.
The driver installation ISO file must also be placed in the/var/lib/libvirt/images directory.
# Virsh Attach-device win7/var/lib/libvirt/images/virtio-win-0.1-81.iso hdc--type CDROM
For the time being, replace the CDROM with this one. Then in the VNC Win7 installation interface refresh, click on the installation driver, installed and then refresh to see the hard disk, but also to replace the CDROM back to continue to install Win7 Bai:
# Virsh Attach-device win7/var/lib/libvirt/images/micrsoft-win7.iso hdc--type CDROM
The rest of the work is well installed. But can not surf the internet, because tplink this USB card actually has been bridged failed, then change the configuration it:
#virsh edit Win7 To change the network device to:
<interface type= ' direct ' > <mac address= ' 52:54:00:b5:bd:ab '/> <source dev= ' enp0s26u1u4 ' mode= ' Vepa '/> <model type= ' virtio '/> <address type= ' pci ' domain= ' 0x0000 ' bus= ' 0x00 ' slot= ' 0x03 ' function= ' 0x0 ' /> </interface>
Inside the dev= ' Enp0s26u1u4 ' is the device on this machine, the other machines are not necessarily the same. In the Win7 may also see several devices are not recognized, continue to download the Virtio drive disk Virtio-win-0.1-81.iso hook up to install on the line.
Centos7 KVM installation win7 virtio et cetera