Win10 virtualbox migration to lxd

Hello, I have bunch of virtualbox vms, which I would like to migrate to LXD 4.0 stable.

I m not really used to QEMU, so maybe I m doing things wrong. And as far as I understand LXD doesnt support non uefi boot mode? I didint try to modify LXD’s qemu settings.

I followed this guide Running virtual machines with LXD 4.0

  1. Created empty VM.
  2. Installed lates vrtio drivers.
  3. In virtualbox changed from MBR to GPT so it would work in EFI.(had to tick virtualbox efi option and image booted)
  4. Converted virtualbox vdi to raw format and replaced root.img

curently I get windows BSOD with boot device inaccessable, and on second boot it always boots to recovery.

And I m stuck, windows seems to see only efi partition, because they are stuck in recovery mode. I tried repair boot from DISC and not from HDD it fails.

With basic qemu command I could launch original image without any modifications to efi and so on.

Maybe I Picked bad approach? Should I try to modify qemu settings or try to fix efi somehow.
Someone had success with converting virtualbox to qemu LXD compatible image?

I m trying to fix booting problem.

From recovery console diskpart: list volume shows only cdroms.

You’re most likely missing the virtio-scsi driver which is needed to see the disk controller.

I did install this driver in virtualbox from virtio-win iso through simple setup before converting image, but maybe driver has to be installed special way in boot partition or something.

And windows were converted from mbr to gpt + efi, so this might affect somehow.

I managed to boot, but I never was so bamboozled. I felt like doing magic and I dont like magic.

https://ogris.de/howtos/windows-uefi-virtio.html 14 - 17 steps which means to attach empty disk and remove something like this. This triggers something somewhere and then windows boots( i think I needed to choose from efi bios correct boot device once).

qemu-system-x86_64 -machine type=q35  -accel kvm -cpu host --bios /snap/lxd/current/share/qemu/OVMF_CODE.fd -m 4096 -smp 2 -drive file=./root.img,index=0,media=disk,format=raw -drive file=./tmp.raw,media=disk,index=1,if=virtio -device virtio-scsi

one thing I noticed that under windows 10 device manager now hard drive shows as “qemu qemu harddisk scsi disk device”, and without LXD I think it was red hat virtio drive something like that. So this is not right?

And it stopped working again.
I have to do more testing, to actually understand whats going on.