EFI boot order is not preserved between guest launches

Discussions related to using VirtualBox on Windows hosts.
Post Reply
AnrDaemon
Posts: 134
Joined: 7. Feb 2010, 23:41
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu Linux, Windows

EFI boot order is not preserved between guest launches

Post by AnrDaemon »

VB 4.12, WinXP x86/SP3 host.
64-bit Ubuntu guest.
Each time I start guest system, EFI boot order is reset to DVD>HDD>Shell.
If I go to "Boot Maintenance Manager" -> "Boot Options" -> "Add Boot Option" -> disk\EFI\ubuntu\grubx64.efi
Then change boot order to boot from file before shell, the guest system boot up fine after reset, but the changes are lost after guest shutdown.

Code: Select all

GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sda: 10.7GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system     Name  Flags
 1      1049kB  345MB   344MB   fat32           EFI   msftdata
 2      345MB   2377MB  2032MB  linux-swap(v1)  swap
 3      2377MB  10.7GB  8340MB  ext4            root
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: EFI boot order is not preserved between guest launches

Post by Perryg »

VBox EFI was not really designed for Linux. It was so users that have apple hardware could install Mac OS X as a guest.

However that said it does work, but you need to create a startup.nsh file in / of the launcher
AnrDaemon
Posts: 134
Joined: 7. Feb 2010, 23:41
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu Linux, Windows

Re: EFI boot order is not preserved between guest launches

Post by AnrDaemon »

Can you please point me to an example of such file, and where exactly it should be located? (I.e. in the root of EFI partition?)
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: EFI boot order is not preserved between guest launches

Post by Perryg »

Launch the guest and go to the startup screen. Wait it out and you will be at a shell prompt. Type edit startup.nsh and add the location of the grubx64.efi file. save and restart.
The installer has the help functions built in to see what the save and exit keys are.
AnrDaemon
Posts: 134
Joined: 7. Feb 2010, 23:41
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu Linux, Windows

Re: EFI boot order is not preserved between guest launches

Post by AnrDaemon »

Solved it with a little googling,

Code: Select all

sudo -e /boot/efi/startup.nsh
from the guest OS and

Code: Select all

fs0:\EFI\ubuntu\grubx64.efi
in there.
Thanks!
Post Reply