No virtual system boot with grub2 on mbr for raw disk access to specific partitions
|Reported by:||Leo Pilachowski||Owned by:|
|Guest type:||Linux||Host type:||Windows|
Recent Linux systems, such as Fedora 16, use the newer grub2 boot loader. The usual grub2 setup places the boot code on the mbr and on the unpartitioned sectors immediately follow the mbr partition. If a virtual guest Linux system is made using raw parition access to Linux code on a partition(s) separate from the host system partition(s), the grub2 boot code is not accessible unless the whole disk is attached rather than just the partitions containing the guest system.
For example, with a Windows 7 64bit host on partition 3 of disk 0 and Fedora 16 on partitions 5 and 6, and with grub2 installed on the mbr of disk0, VirtualBox will not boot a Fedora 16 x86_64 guest unless the vmdk is created with whole disk access to disk0. If the vmdk is created with access to only partitions 5 and 6, Fedora does not boot and hangs after the boot code in the mbr is executed. The code in the sectors following the mbr sector is not reached. Given that it is dangerous for the virtual system to have direct access to the host operating system code, the grub2 boot code should be accessible when only individual partitions are attached. For Windows hosts, the -relative option is not available for createrawvmdk so this option cannot be tested as a solution with Windows hosts.