virt使用cirros创建虚拟机失败记录

virt-manager使用cirros创建虚拟机失败,
出现错误代码
Booting from Hard Disk...
Boot failed: not a bootable disk
No bootable device.

解决方案
It appears that virt-manager does not read the hard drive image format of a pre-existing image when creating a new virtual machine and instead chooses the "raw" format. Since virt-manager seems to store it's setting internally, you cannot just edit the ~/.libvirt/qemu/VMNameHere.xml file.

You must export the libvirt vm settings to xml, fix the hard drive image formatting, and import the vm settings back into libvirt.

Export vm settings:
/etc/libvirt/qemu/vm.xml

virsh -c qemu:///session dumpxml VMName > ~/Desktop/VMName.xml

Update the hard drive format in the xml file:

From   
<devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/storage/vmimages/Windows7_x64-01/qcow2-60GB_HDD1.qcow2'/>
      <target dev='hda' bus='ide'/>
    </disk>
To
<devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/storage/vmimages/Windows7_x64-01/qcow2-60GB_HDD1.qcow2'/>
      <target dev='hda' bus='ide'/>
    </disk>

Import in the fixed xml file:

virsh -c qemu:///session define ~/Desktop/VMName.xml
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容