Page 1 of 1
EFI boot configuration cannot be persistent
Posted: 31. May 2014, 10:17
by davidshen84
Hi,
I installed my Lubuntu 64bit, and configured to use grub2-EFI mode. I setup the VM to boot in EFI mode, and everything works fine. As long as I don't shutdown the VM, the EFI boot correctly during reboot. But if I complete shutdown the VM, EFI boot configuration lost. I have to go to the BIOS EFI setup section to manually add a boot entry to boot my system.
I installed the system like normal, then I execute:
grub2-install --target=x86_64-efi --efi-directory /boot/efi
Then I try reboot, and it works fine. Maybe I missed something the VM settings?
Thanks,
David
Re: EFI boot configuration cannot be persistent
Posted: 31. May 2014, 12:45
by mpack
Why would anyone look in "Windows Hosts" for this discussion? Never mind - rhetorical question. Moved to "Linux Guests".
Are you sure you're actually installing the guest onto the (virtual) hard disk? I rather suspect that you're actually just running in live CD mode. And, since that mode uses a volatile RAMdisk as the working drive, the contents are of course lost after a shutdown.
Re: EFI boot configuration cannot be persistent
Posted: 31. May 2014, 15:00
by Perryg
Not a VirtualBox issue.
You need to create a startup.nsh file (not done automatically)
Start the shell then follow the example below:
Code: Select all
Shell> fs0:
edit startup.nsh
\EFI\ubuntu\grubx64.efi
ctrl-s <cr>
<enter>
ctrl-q <cr>
reset
Re: EFI boot configuration cannot be persistent
Posted: 1. Jun 2014, 07:14
by davidshen84
@Perryg, Thanks for the tip
My physical machine is also setup to use EFI, and I did not create such a script. Where can I find information/document about this kind of script?
Re: EFI boot configuration cannot be persistent
Posted: 1. Jun 2014, 14:44
by Perryg
You could type startup.nsh in google. That works for me.
I have posted the steps to create the script and even the the steps for a Debain based OS for the entries.
Re: EFI boot configuration cannot be persistent
Posted: 3. Jun 2014, 04:50
by davidshen84
Perryg wrote:You could type startup.nsh in google. That works for me.
I have posted the steps to create the script and even the the steps for a Debain based OS for the entries.
Yes, I saw your script, and I found
https://software.intel.com/en-us/articl ... -scripting very useful

But why sometime I don't need this script, sometime I do? Most people fall into this EFI shell because they did not set EFI correctly. But, in my case, everything looks correct, and I may fall into this EFI shell only after I restart the vbox manager.
Re: EFI boot configuration cannot be persistent
Posted: 17. Oct 2015, 13:53
by colinogreen
Hello
I have turned on EFI in Virtualbox 4.x Unfortunately, although a CENTOS iso that I have appears to boot fine with UEFI turned on in VirtualBox the Ubuntu 14.04 'ubuntu-14.04.3-desktop-amd64+mac.iso' does not get past the shell.
I have followed the instructions in this but it doesn't seem to work. Whe I launch the edit startup.nsh command in the UEFI shell, all I get is the following message
Can anyone please help? Does the ubuntu-14.04.3-desktop-amd64+mac.iso not support UEFI properly?
Re: EFI boot configuration cannot be persistent
Posted: 17. Oct 2015, 19:40
by colinogreen
colinogreen wrote:Hello
I have turned on EFI in Virtualbox 4.x Unfortunately, although a CENTOS iso that I have appears to boot fine with UEFI turned on in VirtualBox the Ubuntu 14.04 'ubuntu-14.04.3-desktop-amd64+mac.iso' does not get past the shell.
I have followed the instructions in this but it doesn't seem to work. Whe I launch the edit startup.nsh command in the UEFI shell, all I get is the following message
Can anyone please help? Does the ubuntu-14.04.3-desktop-amd64+mac.iso not support UEFI properly?
Actually solved my own problem. I usually download the alternate version (ubuntu-14.04.3-desktop-amd64+mac.iso') but the one I wanted was the default ubuntu-14.04.3-desktop-amd64.iso without the 'mac' at the end.
That default download had the 'EFI' folder at the root of the .iso. OS installed ok from there and then I had to apply the fix in this thread afterwards on the writable EFI boot partition. Problem solved.
Re: EFI boot configuration cannot be persistent
Posted: 18. Sep 2017, 20:28
by Winyl
Perryg wrote:Not a VirtualBox issue.
On contrary "My Dear Watson" it is a VirtualBox issue. It does not save contents of NVRAM to a file it can load on boot of VM. Although "PermanentSave" option of variables is present in NvRam.cpp code. But it is not used. Why?
Can someone enable saving of NVRAM contents to file? This issue still persists in 5.1.28 r117968 (Qt5.6.2). Nice.
Re: EFI boot configuration cannot be persistent
Posted: 24. Oct 2017, 20:18
by kyb
Unmount all CDs and DVDs. Than it will work.
I found an answer on a YouTube video:
How to Start EFI Vbox host for Ubuntu/ Linux OS
Thanks to Fahid Shehzad
try the "ls" command and see the list of file, maybe on your computer your virtual CD ROM is being mounted as fs0.
if by doing the "ls" command you see files like Autorun.inf, autorun.sh etc, that means your CD Rom is mounted as fs0, in such case, try going to the other mounted options. Look for the GPT in the Mount-Description.