Ubuntu – UEFI boot in virtualbox – Ubuntu 12.04

uefivirtualbox

I am trying to boot Ubuntu 12.04 (64bit) by using UEFI in VirtualBox. When using UEFI boot in Virtualbox, I instantly get dropped into EFI-shell. I looked this up online and did as explained in this thread. When I do as explained in the thread, I get "efidisk read error". Despite this error, it somehow still boots into Ubuntu, but I end up in tty1.

I have tried this to avoid getting dropped into EFI-shell without any success.

  1. Why does "efidisk read error" appear?
  2. How do I boot directly into Ubuntu without moving to EFI-shell?
  3. How do I get into lightdm from tty1?

Best Answer

VirtualBox tends to forget its EFI boot entries. I know of two solutions to this problem:

  • Move/rename the boot loader you're using (probably EFI/ubuntu/grubx64.efi on the EFI System Partition (ESP)) to EFI/BOOT/bootx64.efi. This is the default/fallback filename, and so VirtualBox will boot from it by default if there are no other entries.
  • Use the VirtualBox EFI's menus to locate the boot loader you're using (again, probably EFI/ubuntu/grubx64.efi) and add it as a boot option. I don't recall the precise steps, and the menus aren't exactly user-friendly, but if you poke around in the menus, the options are there.

Doing either of these things should get GRUB starting, but then you've got the second issue, of X not starting. To solve this problem, try this:

  1. Do a text-mode login.
  2. Type sudo su to acquire root privileges.
  3. Type Xorg -configure. This should create a file called /root/xorg.conf.new, IIRC.
  4. Copy that newly-create file to /etc/X11/xorg.conf.
  5. Optionally, edit /etc/X11/xorg.conf. This may or may not be required. Personally, I edit the file to set the fbdev driver as the default, but you may prefer something else. There are lots of online guides to xorg.conf, but I don't have any URLs handy, and it can be pretty complex, so completely describing it here is impractical.
Related Question