UEFI boot in virtualbox - Ubuntu 12.04
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.
- Why does "efidisk read error" appear?
- How do I boot directly into Ubuntu without moving to EFI-shell?
- How do I get into lightdm from tty1?
Solution 1:
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)) toEFI/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:
- Do a text-mode login.
- Type
sudo su
to acquireroot
privileges. - Type
Xorg -configure
. This should create a file called/root/xorg.conf.new
, IIRC. - Copy that newly-create file to
/etc/X11/xorg.conf
. - Optionally, edit
/etc/X11/xorg.conf
. This may or may not be required. Personally, I edit the file to set thefbdev
driver as the default, but you may prefer something else. There are lots of online guides toxorg.conf
, but I don't have any URLs handy, and it can be pretty complex, so completely describing it here is impractical.
Solution 2:
As it may be possible to install Ubuntu in Virtual Box EFI mode it may not work as expected. I for myself have given up on this after some failed experiments, and after reading the documentation to Virtual Box :
Note that the VirtualBox EFI support is experimental and will be enhanced as EFI matures and becomes more widespread.
So it can work fine, but like many experimental features it may not work as expected.
For a virtual machine a virtualized EFI firmware does not have any advantages over a virtual legacy BIOS it may (if not for testing) be better to install a virtual OS in legacy BIOS mode.