Installer fails to create startup.nsh for EFI system on VirtualBox

Bug #1665329 reported by Paddy Landau on 2017-02-16
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
High
Unassigned

Bug Description

Summary:

When installing Ubuntu using LUKS & LVM onto a VirtualBox system, it creates a non-bootable system because it fails to create the file startup.nsh on the EFI partition.

How to duplicate:

1. Create a new virtual machine on VirtualBox with a sufficiently large disk drive. Ensure that "Enable EFI" is ticked in Settings > System > Motherboard.

2. Run the Ubuntu installer from a Live CD. Chose the default "Erase disk and install Ubuntu". Also tick "Encrypt the new Ubuntu installation for security", which automatically selects "Use LVM with the new Ubuntu installation".

3. Allow the installation to finish.

What should happen:

1. On rebooting the virtual machine, it should boot into Ubuntu.

What does happen:

1. On rebooting the virtual machine, it boots into the UEFI Interactive Shell and cannot proceed.

Workaround:

1. Create a file named startup.nsh on the FS0: drive (either using the UEFI Interactive Shell or by booting into the Live CD). The file should contain the following single line:
\EFI\ubuntu\grubx64.efi

2. Reboot the virtual machine. It will boot into Ubuntu.

Proposed solution:

1. The Ubuntu installer should create the startup.nsh file when creating the EFI partition.

Further information:

• Tested on VirtualBox 5.1.14
• Tested with both Ubuntu 16.04.1 64-bit and Lubuntu 16.04.1 64-bit

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1665329/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
affects: ubuntu → ubiquity (Ubuntu)
tags: added: xenial
Joshua Bayfield (jbayfield) wrote :

Confirming this occurs on Ubuntu 16.04 and 16.10.

Changed in ubiquity (Ubuntu):
status: New → Confirmed
tags: added: yakkety
Phillip Susi (psusi) wrote :

So this is a proposed workaround for virtual machines that don't correctly implement EFI variables?

affects: ubiquity (Ubuntu) → grub2 (Ubuntu)
Paddy Landau (paddy-landau) wrote :

@Phillip Susi

Forgive me if I'm wrong on this — unfortunately, I'm not technically expert. As far as I could tell, the ESP should have startup.nsh.

If it's a bug with VirtualBox, I should post a bug report there, but I'd need to know details about how it's wrong. If you could explain, please, or point me to a suitable link online, I'll take it from there. I have been Googling but I'm not finding what I need to find.

Phillip Susi (psusi) wrote :

AFAIK, startup.nsh is entirely up to the user and optional -- not something that OS installers are normally supposed to mess with. The OS is supposed to make calls to the EFI firmware to register its boot loader in the EFI variables and that tells the firmware what to boot, but virtual machines have no persistent flash memory to save those variables, so that is where that breaks down.

Phillip Susi (psusi) wrote :

For that matter, even having an EFI shell installed that would have the ability to interpret startup.nsh is optional and not something that any real hardware I have seen comes with.

Paddy Landau (paddy-landau) wrote :

@Phillip Susi

Is this something should be filed as a bug on VirtualBox? If so, I have nowhere near sufficient knowledge to file a bug report that makes any sense. Would you be willing to file such a bug report?

I found these two bug reports, but I don't know if they are relevant (as I say, I'm not technically expert):

https://www.virtualbox.org/ticket/14279
https://www.virtualbox.org/ticket/16373

Changed in grub2 (Ubuntu):
importance: Undecided → High

I too have issue with this. HP elitebook 745 g3 installation with customer partitioning and luks (kubuntu 16.04.2). after installation i get dropped to initramfs and error about not able to reach root volume. it didn't ask for luks password.

Phillip Susi (psusi) wrote :

That is not related to this bug report Djordje.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.