windows iso镜像缺少virtio驱动

windows iso镜像安装系统过程中找不到磁盘。

原虚拟机配置


    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/home/windows_server_2012_en_vl_x64_dvd_917758.iso'/>
      <backingStore/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    disk>
......
    <qemu:arg value='-chardev'/>
    <qemu:arg value='socket,id=blk.1018,path=/var/tmp/blk.1018'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vhost-user-blk-pci,addr=0x0,chardev=blk.1018,id=blk.1018,bus=pci.1'/>
    

修改后的虚拟机配置


    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/home/windows_server_2012_en_vl_x64_dvd_917758.iso'/>
      <backingStore/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <boot order='1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/home/virtio-win-0.1.160.iso'/>
      <backingStore/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='writeback'/>
      <source file='/home/test.img'/>
      <backingStore/>
      <target dev='vdc' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0d' function='0x0'/>
    disk>
......
    <interface type='network'>
      <mac address='52:54:00:a3:4c:0a'/>
      <source network='vmnet01'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
    interface>


修改虚拟机配置前需要创建test.img和下载virtio驱动virtio-win-0.1.160.iso

创建test.img

qemu-img create -f qcow2 test.img 1G

你可能感兴趣的:(运维)