I have a dual-boot configuration with Linux and Windows. Now, I would like to keep dual-boot setup and also be able to run Windows inside of KVM on Linux.
The following configuration works fine. I include the entire disk (
/dev/sda) inside of KVM. For running Windows, I created an ISO image of grub (
grub-mkresque), which has been configured to boot Windows from its partition (
/dev/sda2). However, I am not happy with this solution, because the Windows guest then gets access to the whole disk with all partitions.
This, as commenters @telcoM & @kenneth-b-jensen had also pointed out, is/should_be part of my strategy to avoid corruption by avoiding concurrent access/mounting by both OSs.
The desired solution is only to include the Windows partition (
/dev/sda2) and then start Windows from there. Because this partition is not bootable, I cannot boot Windows just from there. Because KVM apparently binds the single partition to a disk with its own partition table,
grub from my image cannot find the corresponding partition from which to boot.
I need to finalize the configuration or some other idea to get a working configuration.
Use VirtualBox because it provides the possibility to create an image for raw disk access keeping the partitioning table, but specifying only the necessary partitions. IMHO, one should avoid this, as KVM brings more performance.
Find a solution to keep the partition table (as described above) with KVM.
grubto use the proper partition inside of KVM. I would like to receive expert guidance on configuring grub according to the goals.