Re: convert bhyve vm image to something linux lvm/kvm/qemu can use
- In reply to: void : "convert bhyve vm image to something linux lvm/kvm/qemu can use"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 08 Jul 2023 19:08:51 UTC
> On Jul 8, 2023, at 5:00 AM, void <void@f-m.fm> wrote: > > Hello list, > > I need to convert a bhyve filebacked (so: .img) freebsd instance to > something a linux host running lvm+kvm+qemu would understand. > > What format do I need to convert it to? Qemu can handle raw images just fine. If you want something more space friendly with more features you could do qcow2. (Use qemu-img to convert.) > Do I need to worry about the boot partition of the freebsd instance? If the VM is set up to boot with UEFI then the partitioning should be fine with no changes, just make sure you use an appropriate UEFI boot firmware with qemu (libvirtd makes this pretty straightforward). If you are using bhyve-load or similar to load the kernel from the bhyve hypervisor you’ll need to adapt to a normal boot (could be either BIOS or UEFI, IMO UEFI is easier and it’s much more modern). If doing the former then you will likely need a FreeBSD-boot partition and to make sure all the boot blocks are in the right places (see the man page for gpart’s “bootstrap” command). If doing the latter you’ll need an EFI MSDOS partition but you can just copy the EFI boot loader to it. See the handbook. Also keep in mind that EFI doesn’t have to be the first partition so if you’re out of space you can just extend the disk and add it at the end. JN