Boot Ubuntu in VirtualBox from a partition in Hard Drive

From the Virtual Box install folder, run the command

VBoxManage.exe internalcommands listpartitions –rawdisk \\.\PhysicalDrive0

This will list all the partitions on hard disk. Locate the partitions for Ubuntu.

Then run the command to create a vmdk,

VBoxManage.exe internalcommands createrawvmdk –filename {Path to vmdk} –rawdisk \\.\PhysicalDrive0 -partitions {Comma Separated Partition List}

Then, in Ubuntu, copy /boot/grub/grub.cfg to a folder in home, say GRUB/boot/grub. Then execute to create a bootable grub disk,

grub-mkrescue -o grub.iso GRUB

Copy the iso file created to a windows drive. After this, while creating a new VirtualBox VM (run VirtualBox with admin permission), use the vmdk file created as your hard drive, and choose grub.iso file as CDROM drive. Enable UEFI in VirtualBox.