On 03/02/2018 08:33 AM, R0b0t1 wrote:
You can pass a block device directly to QEMU, and this is recommended for performance reasons. I have a Windows 10 VM that was passed an entire SSD; it runs fine, and you can take the disk and plug it into other computers. Passing a partition is a little different, if you wish to load it directly, you would need to chainload it with GRUB, as the MBR/GPT information would be duplicated.
Agreed on all accounts.
All OP needs to do is pass something like "-drive file=/dev/block,if=virtio". There should be more options, such as AIO implementation, but you likely won't need to mess with them.
If you pass a block device the MBR/GPT information will be stored there. In the case of passing a partition, this means you can't boot it "directly" because the BIOS/EFI firmware can't read it.
I think that it might be possible to pass the partitions (FS & swap) as individual drives to the guest VM. Make sure that the guest VM mounts them by the UUID and not by path as the path in the VM and bare metal will be different.
I've not tried this, but I think that it will work. Guest would "mkfs /dev/sda" and "mkswap /dev/sdb"
-- Grant. . . . unix || die