0

I have a dual boot system with Win10 + Ubuntu 16.04 HWE kernel. I am trying to configure a Virtual Machine in Windows (in dev/sda) which can access the already installed Ubuntu (in /dev/sdb).

I am following the instructions at: Using a Physical Hard Drive Pariition as a VirtualBox VM and as a Bootable Partition

Two other links with similar topic covered: Link1 Link2

All of these mention that I have to copy /usr/lib/grub/i386-pc/* to ~/Desktop/iso/boot/grub. However, these are the directories I see under /usr/lib/grub/:

grub-mkconfig_lib x86_64-efi x86_64-efi-signed

As I don't have i386-pc, which files do I need to copy over to create the GRUB Recovery ISO, which the Virtual Machine will use to boot into Ubuntu?

  • Why don't you use grub-mkrescue -o grub.iso to create a grub rescue iso? – Ravexina Jun 2 '17 at 20:44
  • That's still the last step. I guess the only reason of copying the files over is to remove the windows entries from the grub menu. – akshayj Jun 2 '17 at 20:59
  • for me on 16.04 /usr/lib/grub/x86_64-efi/* did the job, but since 17.04 I cannot boot it under VirtualBox running on Win10 :P – gaa Aug 29 '17 at 19:23
0

Your computer is EFI-based, but the instructions you reference assume a BIOS-mode installation. This is a poor assumption to be made in 2015, when the instructions were written.

I've only skimmed those instructions, and I'm not familiar with the procedure described, so I may be missing something, but instead of creating a GRUB rescue .iso file, you might want to try the CD-R image of my rEFInd boot manager. (See the download link for the CD-R image.) You'd then point VirtualBox to the rEFInd .iso file as a CD image file. If my cursory glance at the instructions is not leading me astray, rEFInd should be able to boot your regular Ubuntu installation from within VirtualBox. In the long term, you might consider setting up a small virtualized disk with a FAT filesystem and install rEFInd to it; this might persist across uses better than a pointer to a CD image file. (Under Linux, at least, VirtualBox frequently "unmounts" CD images without being asked -- or maybe that's Ubuntu itself.)

  • Hi Rod, thanks for your reply! I tried with the CD image of rEFind boot manager, and the virtual box could not boot with it. "FATAL: No bootable medium found! System halted." – akshayj Jun 10 '17 at 4:41
  • I also tried super Grub2 disk, and virtualbox did boot with it. Though the Ubuntu went into emergency mode. Not sure if that's due to the boot options that Grub2 disk uses, or something else wrong with the virtualbox setup. – akshayj Jun 10 '17 at 4:57
  • VirtualBox's firmware is either BIOS or EFI, and you must set which is in use on the "System" tab in the settings -- check "Enable EFI" to use EFI, or leave that option unchecked to use BIOS. You'd need to use EFI firmware to use rEFInd. – Rod Smith Jun 10 '17 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.