Ubuntu - Boot - Prevent UEFI Boot Issues

If you installed on a UEFI system you may want to run the following commands before booting into your new installation:

efi="/target/boot/efi/EFI"; \
if [[ -e "${efi}/boot" ]]; then \
  echo "Backup:"; \
  mv -v "${efi}/boot/" "${efi}/boot-bak-$(lsb_release -cs)"; \
fi; \
echo "Copy:"; \
cp -va "${efi}/ubuntu" "${efi}/boot"; \
arch="$(ls -1 {efi}/ubuntu/shim*.efi)"; \
arch="${arch#*shim}"; \
arch="${arch%.efi}"; \
cp -v "${efi}/boot/shim${arch}.efi" "${efi}/boot/boot${arch}.efi";

This will copy Ubuntu's boot files to the default bootloader location and backup any previously existing files. By doing this you save yourself from headaches caused by non-standards compliant behavior of some UEFI firmwares found on VirtualBox as well as some older HP, Toshiba, Sony and other devices.

Related bug report.


References

http://askubuntu.com/questions/6328/how-do-i-install-ubuntu