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=192.168.69.108,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=192.168.69.108
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=192.168.69.108
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.