i have hyper-v gen2 win-guest and need to migrate on kvm with libvirt. I convert one guest from vhdx to qcow2 with qemu-img, start it with qemu-system and hda-drive, install virtio drivers. After that i start it with virtio storage with that commandline:

 qemu-system-x86_64 -machine type=pc-q35-2.8 \
-accel kvm -cpu host \
--bios /usr/share/OVMF/OVMF_CODE.fd \
-m 2048 -smp 2 \
-drive file=/var/lib/libvirt/image
/dc02.qcow2,index=0,media=disk,if=virtio \
-spice addr=,port=5910,disable-ticketing

Guest successfuly starts, powershell cmdlet "get-disk" shows "Red Hat VirtIO SCSI Disk Device" so all seems fine.

Next command was:

    virt-install --name dc02 --memory 1024,maxmemory=2048 \
--vcpus 1 --cpu host --boot uefi,hd,network \
--disk /var/lib/libvirt/images/dc02.qcow2,bus=virtio \
--network bridge=br.27,model=virtio --video=qxl \
--memballoon virtio --hvm --controller usb3 \
--machine=q35 --graphics spice,listen=

Guest starts and gets into bootloop with BSOD "Unaccessible boot device" and doesnt boot even in safe boot Changing virtio to sata helps to start guest but i need virtio There is log for bootloop. Where i went wrong?

I found solution and it was pretty simple. I decide to take virtio-drive from another win-guest and attach it to problem guest like i did in first step with qemy-system

    virt-install --name dc02 --memory 1024,maxmemory=2048 --vcpus 1 \
--cpu host-passthrough --boot uefi,hd,network \
--disk /var/lib/libvirt/images/dc02.qcow2,bus=sata \
--disk /var/lib/libvirt/images/parus03.qcow2,bus=virtio \
--network bridge=br.27,model=virtio --video=qxl \
--memballoon virtio --hvm --controller usb3 \
--machine=q35 --graphics spice,listen=

Guest successfuly stars, get-disk shows two disk: QEMUDISK and Red Hat VirtIO SCSI Disk Device. I shutdown vm, remove parus03.qcow2, replace "sata" to "virtio" for dc02 and start vm. Its successfuly boot, get-disk shows "Red Hat VirtIO SCSI Disk Device". So i get what i want.

  • Boot from the Windows installation media, and run Startup Repair. – Michael Hampton Mar 10 '18 at 5:00
  • it doesnt help, bootrec shows no windows intallation, diskpart shows no disk. seems like no virtio driver in bootloader – Иван Иванов Mar 10 '18 at 6:19
  • You'll have to load it from the virtio-win ISO. – Michael Hampton Mar 10 '18 at 6:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.