bhyve Running Windows installations via Bhyve

I think I can get you started.

1) Convert the Windows physical machine's disk into a VHD virtual disk file running Disk2vhd on the Windows physical machine.
2) Already on FreeBSD, convert the VHD file into RAW format using qemu-img() (which I saw in this thread).
3) ... I don't know, but now I think you have a disk that Bhyve understands, so you shouldn't be far from the goal.
 
That depends. First, bhyve only supports UEFI and as such only GPT partitioning is supported. To P2V is a BIOS machine with MBR partitioning to a bhyve VM is IMO impossible. I tried it once with a Windows 10 partition from a multi-boot (2 FreeBSD partitions and one Windows 10 partition) Acer laptop. I created the correct EFI partition and booted it in bhyve and also on my HP 840. Both times it worked for about 15 minutes, then blue screened. It failed to boot thereafter. I ended up installing a fresh new Windows 11 in bhyve.

P2V Windows is difficult. I was able to do it with XP but have not been able to since then. With the XP P2V I had to use a binary editor to change some boot files and offsets in NTFS prior to the migration in order to make Windows ignore hard coded filesystem offsets. Certainly a white knucle moment because of the risk to the Windows partition. A dd backup is advised.

At $JOB our Windows team has had success with P2V of Windows servers from bare metal to VMware using a VMware supplied tool. It adjusts filesystem offsets similarly to what I had to do manually with my XP P2V.

All this is to say it is possible but I don't know how to do this without spending money on some untested tool (other than VMware) to do the migration for me.
 
I think I can get you started.

1) Convert the Windows physical machine's disk into a VHD virtual disk file running Disk2vhd on the Windows physical machine.
2) Already on FreeBSD, convert the VHD file into RAW format using qemu-img() (which I saw in this thread).
3) ... I don't know, but now I think you have a disk that Bhyve understands, so you shouldn't be far from the goal.
This assumes the physical disk is GPT partitioned and already boots using UEFI. If BIOS with MBR, all bets are off.

Windows is notorious for blue screening when it discovers too many changes, like different disk geometry.

I typically use ZFS zvols. A like to like dd copy should work but an unlike MBR to GPT (because bhyve is UEFI only) will not.
 
Back
Top